menufw/hierarchynavigator/hnmetadatamodel/inc/hnmduimappingelement.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 
       
    20 #ifndef C_HNMDUIAPPINGELEMENT_H
       
    21 #define C_HNMDUIAPPINGELEMENT_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <xmlengdom.h>
       
    25 #include <e32hashtab.h>
       
    26 
       
    27 class CHnMdValueBase;
       
    28 class CHnItemModel;
       
    29 class CLiwGenericParamList;
       
    30 class CHnConditionInterface;
       
    31 struct THnMdCommonPointers;
       
    32 
       
    33 /**
       
    34  * UI Mapping Element.
       
    35  * 
       
    36  * This class is designed to support output attributes defined in the
       
    37  * xml configuration. Most common case is when these attributes
       
    38  * define the content of the items, e.g.: text, icons.
       
    39  * 
       
    40  * @lib hnmetadatamodel
       
    41  * @since S60 5.0
       
    42  * @ingroup group_hnmetadatamodel
       
    43  */
       
    44 NONSHARABLE_CLASS(CHnMdUiMappingElement) : public CBase
       
    45     {
       
    46 public:
       
    47     
       
    48     /**
       
    49      * Two-phase constructor.
       
    50      *
       
    51      * @param aElement Element.
       
    52      * @param aCmnPtrs Common pointers.
       
    53      * @return Fully constructed object.
       
    54      */
       
    55     static CHnMdUiMappingElement* NewL( TXmlEngElement aElement,
       
    56                                         THnMdCommonPointers* aCmnPtrs );
       
    57 
       
    58     /**
       
    59      * Two-phase constructor.
       
    60      *
       
    61      * @param aElement Element.
       
    62      * @param aCmnPtrs Common pointers.
       
    63      * @return Fully constructed object.
       
    64      */
       
    65     static CHnMdUiMappingElement* NewLC( TXmlEngElement aElement,
       
    66                                          THnMdCommonPointers* aCmnPtrs );
       
    67 
       
    68     /**
       
    69      * Standard C++ virtual destructor.
       
    70      */
       
    71     virtual ~CHnMdUiMappingElement();
       
    72     
       
    73     /**
       
    74      * Gets alias.
       
    75      *
       
    76      * @return Alias.
       
    77      */
       
    78     const TDesC8& Alias() const;
       
    79     
       
    80     /**
       
    81      * Fills graphical item.
       
    82      * 
       
    83      * @param aItemModel Item's model.
       
    84      * @param aQueriesResultsList Parameters used when filling.
       
    85      * @param aPos Position of a record in a parameters list.
       
    86      * @return True if filling was correctly finished.
       
    87      */
       
    88     TBool FillGraphicalItemL( CHnItemModel* aItemModel ,
       
    89             const CLiwGenericParamList& aQueriesResultsList, TInt aPos );
       
    90     
       
    91     /**
       
    92      * Checks if the uimappingelement is valid.
       
    93      *
       
    94      * @since S60 5.0
       
    95      * @param aQueryResults Parameters used when validating.
       
    96      * @param aPos Position of a record in a parameters list.
       
    97      * @return True if condition was satisfied.
       
    98      */
       
    99     TBool IsValidL( const CLiwGenericParamList& aQueryResults, TInt aPos );
       
   100            
       
   101 private:
       
   102 
       
   103     /**
       
   104      * Standard C++ constructor.
       
   105      */
       
   106     CHnMdUiMappingElement();
       
   107 
       
   108     /**
       
   109      * Standard symbian 2nd phase constructor.
       
   110      *
       
   111      * @param aElement Element.
       
   112      * @param aCmnPtrs Common pointers.
       
   113      */
       
   114     void ConstructL( const TXmlEngElement& aElement , 
       
   115                      THnMdCommonPointers* aCmnPtrs);
       
   116     
       
   117     /**
       
   118      * Sets string handler.
       
   119      *
       
   120      * @param aName Name.
       
   121      */
       
   122     void SetValueL( const TXmlEngAttr& aName);
       
   123     
       
   124     /**
       
   125      * Sets type.
       
   126      *
       
   127      * @param aType Type.
       
   128      */
       
   129     void SetTypeL( const TXmlEngAttr& aType );
       
   130     
       
   131     /**
       
   132      * Set alias.
       
   133      *
       
   134      * @param aName Name.
       
   135      */
       
   136     void SetAliasL( const TXmlEngAttr& aName );
       
   137     
       
   138     /**
       
   139      * Set value.
       
   140      *
       
   141      * @param aElement Element.
       
   142      * @param aCmnPtrs Common parameters.
       
   143      */    
       
   144     void SetValueL( const TXmlEngElement& aElement,
       
   145             THnMdCommonPointers* aCmnPtrs );
       
   146     
       
   147 
       
   148 private: // data
       
   149 
       
   150     /**
       
   151      *
       
   152      * Alias.
       
   153      */
       
   154     RBuf8 iAlias;
       
   155     
       
   156     /**
       
   157      * ValueL.
       
   158      */
       
   159     CHnMdValueBase* iValue;
       
   160     
       
   161     /**
       
   162      * Not own - common pointers structure.
       
   163      */
       
   164     THnMdCommonPointers* iCmnPtrs;
       
   165     
       
   166     /**
       
   167      * Own - condition.
       
   168      */
       
   169     CHnConditionInterface* iCondition;
       
   170     };
       
   171 
       
   172 #endif // C_HNMUIAPPINGELEMENT_H