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