menufw/hierarchynavigator/hnmetadatamodel/inc/hnmdvaluetext.h
changeset 0 f72a12da539e
child 21 76d6129f27f7
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 CHNMDTEXT_H
       
    20 #define CHNMDTEXT_H
       
    21 
       
    22 #include <e32base.h>
       
    23 
       
    24 #include "hnmdvaluebase.h"
       
    25 #include "hnglobals.h"
       
    26 
       
    27 class TXmlEngElement;
       
    28 class CLiwGenericParamList;
       
    29 struct THnMdCommonPointers;
       
    30 class CDesC16Array;
       
    31 class CDesC8Array;
       
    32 class CArrayFix<TInt>;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37  * Value Text
       
    38  * 
       
    39  * Specific class inherigint from CHnMdValue Base. This
       
    40  * class is responsible for texts: implements text handling in UI mapping phase
       
    41  * 
       
    42  * @lib hnmetadatamodel
       
    43  * @since S60 5.0
       
    44  * @ingroup group_hnmetadatamodel
       
    45  */
       
    46 NONSHARABLE_CLASS(CHnMdValueText) : public CHnMdValueBase
       
    47     {
       
    48 public:
       
    49 
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      * 
       
    53      * @param aElement XML element.
       
    54      * @param aCmnPtrs Common pointers.
       
    55      */
       
    56     static CHnMdValueText* NewL( const TXmlEngElement& aElement,
       
    57             THnMdCommonPointers* aCmnPtrs );
       
    58         
       
    59     /**
       
    60      * Destructor.
       
    61      */
       
    62     ~CHnMdValueText();
       
    63 
       
    64     /**
       
    65      * From CHnMdValueBase.
       
    66      * 
       
    67      * Retruns localized formatted text.
       
    68      * 
       
    69      * @param aQueriesResultsList Parameters used when getting localized formatted text. 
       
    70      * @param aPos Position of the correspoing record in the parameters list. 
       
    71      * @param aValue Localized formatted text.
       
    72      * @return Error code.
       
    73      */
       
    74     TInt GetL( const CLiwGenericParamList* aQueriesResultsList,
       
    75             TInt aPos, TPtrC& aValue );
       
    76     
       
    77     /**
       
    78      * Creates attribute.
       
    79      * 
       
    80      * @param aQueriesResultsList Parameters used when creating an attribute. 
       
    81      * @param aPos Position of the correspoing record in the parameters list. 
       
    82      * @return Attribute object.
       
    83      */
       
    84     CHnAttributeBase* CreateAttributeL( const CLiwGenericParamList* aQueriesResultsList,
       
    85                 TInt aPos );
       
    86 
       
    87 private:
       
    88 
       
    89     /**
       
    90      * Constructor for performing 1st stage construction
       
    91      */
       
    92     CHnMdValueText();
       
    93     
       
    94     /**
       
    95      * EPOC default constructor for performing 2nd stage construction.
       
    96      * 
       
    97      * @param aElement XML element.
       
    98      * @param aCmnPtrs Common pointers.
       
    99      */
       
   100     void ConstructL( const TXmlEngElement& aElement,
       
   101                      THnMdCommonPointers* aCmnPtrs );
       
   102 
       
   103     /**
       
   104      * Fills list of parameters for text formating.
       
   105      * 
       
   106      * @param aQueryList query results use for dynamic data.
       
   107      * @param aPos position if data are in list format.
       
   108      * @param aDesParams array of descriptor parameters to be filled .
       
   109      * @param aNumericParams array of numeric parameters to be filled  .
       
   110      */
       
   111     void FillParamsL( const CLiwGenericParamList* aQueryList, TInt aPos,
       
   112                       CDesC16Array& aDesParams, CArrayFix<TInt>& aNumericParams);
       
   113     
       
   114     
       
   115     /**
       
   116      * Gets value from resource file
       
   117      *
       
   118      * @param aQueriesResultsList Query results use for dynamic data
       
   119      * @param aPos Position if data are in list format
       
   120      * @param aValue Return value
       
   121      * @return Error code      
       
   122      */
       
   123     TInt GetFromResourceFileL( const CLiwGenericParamList* aQueriesResultsList,
       
   124             TInt aPos, RBuf& aValue );
       
   125     
       
   126     
       
   127     /**
       
   128      * Gets simple value.
       
   129      *
       
   130      * @param aQueriesResultsList Query results use for dynamic data.
       
   131      * @param aPos Position if data are in list format.
       
   132      * @param aValue Return value.
       
   133      * @return Error code.
       
   134      */
       
   135     TInt GetSimpleValueL( const CLiwGenericParamList* aQueriesResultsList,
       
   136             TInt aPos, RBuf& aValue );
       
   137     
       
   138 private: // data
       
   139     /**
       
   140      * Container of common pointers used in Hierarchy navigator
       
   141      * Not own.
       
   142      */
       
   143     THnMdCommonPointers* iCmnPtrs;
       
   144     
       
   145     /**
       
   146      * Simple value, it can be unlocalized text,
       
   147      * or text with localization namespace
       
   148      * or path to query.
       
   149      */
       
   150     RBuf8 iSimpleValue;
       
   151     
       
   152     /**
       
   153      * Resource file name or path for query.
       
   154      * Own.
       
   155      */
       
   156     RBuf8 iResourceFile;
       
   157     
       
   158     /**
       
   159      * Resource id value or path for query.
       
   160      * Own.
       
   161      */
       
   162     RBuf8 iResourceId;
       
   163     
       
   164     /**
       
   165      * It is cached value that is returned to client of this class.
       
   166      * Own.
       
   167      */
       
   168     RBuf iCachedValue;
       
   169     
       
   170     /**
       
   171      * Parameters list defined in XML, it should be path to query.
       
   172      * Own.
       
   173      */
       
   174     CDesC8Array* iParameters;
       
   175     
       
   176     /**
       
   177      * Cached list of descriptor parameters used for formating.
       
   178      * Own.
       
   179      */
       
   180     CDesC16Array* iCachedDesParameters;
       
   181     
       
   182     /**
       
   183      * Cached list of numeric parameters used for formating.
       
   184      * Own.
       
   185      */
       
   186     CArrayFix<TInt>* iCachedIntParameters;
       
   187     
       
   188     };
       
   189 
       
   190 #endif // CHNMDTEXT_H