menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdmenuitem.h
changeset 0 f72a12da539e
child 4 4d54b72983ae
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 
       
    20 #ifndef C_HNMDMENUITEM_H
       
    21 #define C_HNMDMENUITEM_H
       
    22 
       
    23 #include <e32hashtab.h>
       
    24 #include <e32base.h>
       
    25 #include <xmlengelement.h> 
       
    26 
       
    27 struct THnMdCommonPointers;
       
    28 class CHnCondition;
       
    29 class CLiwGenericParamList;
       
    30 class CHnMenuItemModel;
       
    31 class CHnConditionInterface;
       
    32 
       
    33 /**
       
    34  * Menu Item.
       
    35  * 
       
    36  * This class represents items in the Options menu.
       
    37  *
       
    38  * @lib hnmetadatamodel
       
    39  * @since S60 5.0
       
    40  * @ingroup group_hnmetadatamodel
       
    41  */
       
    42 NONSHARABLE_CLASS(CHnMdMenuItem) : public CBase
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phase constructor.
       
    48      *
       
    49      * @since S60 5.0
       
    50      * @param aElement Xml element.
       
    51      * @param aCmnPtrs Common pointers.
       
    52      * @return Fully constructed object.
       
    53      */
       
    54     static CHnMdMenuItem* NewL( TXmlEngElement aElement,
       
    55             THnMdCommonPointers* aCmnPtrs );
       
    56 
       
    57     /**
       
    58      * Two-phase constructor.
       
    59      *
       
    60      * @since S60 5.0
       
    61      * @param aElement Xml element.
       
    62      * @param aCmnPtrs Common pointers.
       
    63      * @return Fully constructed object.
       
    64      */
       
    65     static CHnMdMenuItem* NewLC( TXmlEngElement aElement,
       
    66             THnMdCommonPointers* aCmnPtrs );
       
    67 
       
    68     /**
       
    69      * Standard C++ virtual destructor.
       
    70      *
       
    71      * @since S60 5.0
       
    72      */
       
    73     ~CHnMdMenuItem( );
       
    74     
       
    75     /**
       
    76      * Gets position.
       
    77      *
       
    78      * @since S60 5.0
       
    79      * @param aMenuModel Menu model.
       
    80      * @param aQueriesResultsList Queries results list.
       
    81      * @param aPos Position of the record in the results list.
       
    82      */
       
    83     void EvaluateL( CHnMenuItemModel* aMenuModel,
       
    84             const CLiwGenericParamList& aQueriesResultsList, TInt aPos );
       
    85 
       
    86 public:    
       
    87     // from MHnMdMenuItemBase
       
    88          
       
    89     /**
       
    90      * Gets the menu item's name
       
    91      *
       
    92      * @return Name of menu item.
       
    93      */
       
    94     const TDesC& NameL();
       
    95         
       
    96     /**
       
    97      * Checks if the menu item is valid.
       
    98      *
       
    99      * @since S60 5.0
       
   100      * @param aQueryResults Query results.
       
   101      * @param aPos Position.
       
   102      * @return True if a condition is satisfied.
       
   103      */
       
   104     TBool IsValidL( const CLiwGenericParamList& aQueryResults, 
       
   105                     TInt aPos = 0 );
       
   106 
       
   107 private:
       
   108 
       
   109     /**
       
   110      * Standard C++ constructor.
       
   111      *
       
   112      * @since S60 5.0
       
   113      */
       
   114     CHnMdMenuItem();
       
   115 
       
   116     /**
       
   117      * Standard symbian 2nd pahse constructor.
       
   118      *
       
   119      * @since S60 5.0
       
   120      * @param aElement Xml element.
       
   121      * @param aCmnPtrs Common pointers.
       
   122      */
       
   123     void ConstructL( TXmlEngElement aElement,
       
   124             THnMdCommonPointers* aCmnPtrs );
       
   125     
       
   126     /**
       
   127      * Creates children.
       
   128      *
       
   129      * @since S60 5.0
       
   130      * @param aElement Xml element.
       
   131      * @param aCmnPtrs Common pointers.
       
   132      */
       
   133     void CreateChildrenL( TXmlEngElement aElement, 
       
   134                              THnMdCommonPointers* aCmnPtrs );
       
   135 
       
   136     /**
       
   137      * Appends child item.
       
   138      *
       
   139      * @since S60 5.0
       
   140      * @param aMenuItem Menu item.
       
   141      */
       
   142     void AppendChildItemL( CHnMdMenuItem* aMenuItem );
       
   143     
       
   144     /**
       
   145      * Creates properties.
       
   146      *
       
   147      * @since S60 5.0
       
   148      * @param aElement Xml element.
       
   149      * @param aCmnPtrs Common pointers.
       
   150      */
       
   151     void CreatePropertiesL( TXmlEngElement aElement, 
       
   152                             THnMdCommonPointers* aCmnPtrs );
       
   153 
       
   154 private: // data
       
   155 
       
   156     /**
       
   157      * Own - Name.
       
   158      */
       
   159     RBuf iName;
       
   160 
       
   161     /**
       
   162      * Position.
       
   163      */
       
   164     TInt iPosition;
       
   165 
       
   166     /**
       
   167      * Event element.
       
   168      */
       
   169     TInt iEvent;    
       
   170     
       
   171     /**
       
   172      * Own - Children pointer array.
       
   173      */
       
   174     RPointerArray<CHnMdMenuItem> iChildren;
       
   175 
       
   176     /**
       
   177      * Own - Name value cache. 
       
   178      */
       
   179     RBuf iNameValueCache;
       
   180     
       
   181     /**
       
   182      * Own - Condition.
       
   183      */
       
   184     CHnConditionInterface* iCondition;
       
   185     
       
   186     /**
       
   187      * Is menu item "item specific".
       
   188      */
       
   189     TBool iSpecific;
       
   190 
       
   191     };
       
   192 
       
   193 #endif // C_HNMULMENUITEM_H