menufw/hierarchynavigator/hnmetadatamodel/inc/hnfilter.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_HNFILTER_H
       
    20 #define C_HNFILTER_H
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CHnItemId;
       
    26 
       
    27 /**
       
    28  * Evaluation Filter
       
    29  * 
       
    30  * This class is a filter which is used during evaluation.
       
    31  * Due to the content of this filter the appropriate actions are taken.  
       
    32  *
       
    33  * @lib hnmetadatamodel
       
    34  * @since S60 v3.2
       
    35  * @ingroup group_hnmetadatamodel
       
    36  */
       
    37 NONSHARABLE_CLASS( CHnFilter ) : public CBase
       
    38     {
       
    39 public:
       
    40     /**
       
    41      * Standard factory method.
       
    42      *
       
    43      * since S60 v5.0
       
    44      * @return Filer object.
       
    45      */
       
    46     IMPORT_C static CHnFilter* NewL();
       
    47     
       
    48     /**
       
    49      * Standard factory method.
       
    50      *
       
    51      * since S60 v5.0
       
    52      * @return Filter object.
       
    53      */
       
    54     IMPORT_C static CHnFilter* NewLC();
       
    55     
       
    56     /**
       
    57      * standard destructor
       
    58      */
       
    59     ~CHnFilter();
       
    60 
       
    61 public:    
       
    62 
       
    63     /**
       
    64      * Returns iGenre
       
    65      *
       
    66      * @since S60 v5.0
       
    67      * @return Suite's name.
       
    68      */
       
    69     const TDesC& SuiteName() const;
       
    70     
       
    71     /**
       
    72      * Checks if has item ids.
       
    73      *
       
    74      * @since S60 v5.0
       
    75      * @return True if a filter has item ids.
       
    76      */    
       
    77     TBool HasItemIds() const;
       
    78 
       
    79     /**
       
    80      * Checks if has genre
       
    81      *
       
    82      * @since S60 v5.0
       
    83      * @return True if suite has name.
       
    84      */    
       
    85     TBool HasSuiteName() const;
       
    86     
       
    87     /**
       
    88      * Resets iterator.
       
    89      *
       
    90      * @since S60 v5.0
       
    91      */    
       
    92     void ResetIterator();
       
    93     
       
    94     /**
       
    95      * Gets next item id.
       
    96      *
       
    97      * @since S60 v5.0
       
    98      * @return Next item id.
       
    99      */    
       
   100     const CHnItemId* GetNextItemId() const;
       
   101     
       
   102     /**
       
   103      * Checks if has next item id.
       
   104      *
       
   105      * @since S60 v5.0
       
   106      * @return True if there is next item id.
       
   107      */    
       
   108     TBool HasNextItemId();
       
   109 
       
   110     /**
       
   111      * Resets genre.
       
   112      *
       
   113      * @since S60 v5.0
       
   114      */    
       
   115     void ResetSuiteName();
       
   116     
       
   117     /**
       
   118      * Resets item ids
       
   119      *
       
   120      * @since S60 v5.0
       
   121      */    
       
   122     void ResetItemIds();
       
   123     
       
   124     /**
       
   125      * Set genre.
       
   126      *
       
   127      * @since S60 v5.0
       
   128      * @param aGenre Suite's name.
       
   129      */    
       
   130     IMPORT_C void SetSuiteNameL( const TDesC& aGenre );
       
   131     
       
   132     /**
       
   133      * Append item id. 
       
   134      * NOTE: This class takes the ownership of the given CHnItemId.
       
   135      *
       
   136      * @since S60 v5.0
       
   137      * @param iItemId Item id.
       
   138      */    
       
   139     IMPORT_C void AppendItemIdL( CHnItemId* iItemId );
       
   140     
       
   141     /**
       
   142      * Marks suites for evaluation.
       
   143      *
       
   144      * @since S60 v5.0
       
   145      * @param aEvaluate ValueL of the flag
       
   146      */    
       
   147     IMPORT_C void SetEvaluateSuiteL( TBool aEvaluate );
       
   148     
       
   149     /**
       
   150      * Checks if the suite(s) should be evalauted.
       
   151      *
       
   152      * @since S60 v5.0
       
   153      */    
       
   154     TBool IsEvaluateSuite();
       
   155     
       
   156     /**
       
   157      * Set suite id.
       
   158      *
       
   159      * @since S60 v5.0
       
   160      * @param aSuiteId Suite's id.
       
   161      */    
       
   162     IMPORT_C void SetSuiteId( const TInt aSuiteId );
       
   163     
       
   164     /**
       
   165      * Returns iSuiteId
       
   166      *
       
   167      * @since S60 v5.0
       
   168      * @return Suite's id.
       
   169      */
       
   170     TInt SuiteId() const;
       
   171     
       
   172     /**
       
   173      * Checks if has suite id
       
   174      *
       
   175      * @since S60 v5.0
       
   176      * @return True if suite has id.
       
   177      */ 
       
   178     TBool HasSuiteId() const;
       
   179 
       
   180 private:
       
   181 
       
   182     /**
       
   183      * standard constructor
       
   184      */
       
   185     CHnFilter();
       
   186     
       
   187     /**
       
   188      * EPOC default constructor for performing 2nd stage construction
       
   189      */
       
   190     void ConstructL();
       
   191     
       
   192 
       
   193 private: // data
       
   194         
       
   195     /**
       
   196      * Suite's genre/name.
       
   197      */
       
   198     RBuf iGenre;
       
   199     
       
   200     /**
       
   201      * Items' ids.
       
   202      */
       
   203     RPointerArray< CHnItemId > iItemIds;
       
   204     
       
   205     /**
       
   206      * Flag determines if the suites should also be evaluated.
       
   207      * If set to false, just items are evaluated.
       
   208      * By default it is set to true.
       
   209      */
       
   210     TBool iEvaluateSuite;
       
   211     
       
   212     /**
       
   213      * Current index of item id -> for iterator support
       
   214      */
       
   215     mutable TInt iIter;
       
   216     
       
   217     /**
       
   218      * Suite Id
       
   219      */
       
   220     TInt iSuiteId;
       
   221     
       
   222     };
       
   223 
       
   224 #endif //C_HNFILTER_H