|
1 /* |
|
2 * Copyright (c) 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 #ifndef C_WIDGETDESCRIPTION_H |
|
18 #define C_WIDGETDESCRIPTION_H |
|
19 |
|
20 // INCLUDES |
|
21 #include <e32base.h> |
|
22 // CONSTANTS |
|
23 |
|
24 // FORWARD DECLARATIONS |
|
25 class CCaInnerEntry; |
|
26 |
|
27 /** |
|
28 * Widget Parser |
|
29 * |
|
30 * @since Series Series60 5.x |
|
31 */ |
|
32 class CCaWidgetDescription : public CBase |
|
33 { |
|
34 |
|
35 public: |
|
36 // Constructors and destructor |
|
37 |
|
38 /** |
|
39 * Two-phased constructor. |
|
40 */ |
|
41 static CCaWidgetDescription* NewL( ); |
|
42 static CCaWidgetDescription* NewLC( ); |
|
43 static CCaWidgetDescription* NewLC( CCaInnerEntry* aEntry ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CCaWidgetDescription(); |
|
49 |
|
50 /** |
|
51 * Static method to compare two CCaWidgetDescription objects |
|
52 * @param aFirst first item to compare |
|
53 * @param aSecond second item to compare |
|
54 * @return ETrue if iLibrary value is the same in both objects, |
|
55 * otherwise returns EFalse |
|
56 */ |
|
57 static TBool Compare( const CCaWidgetDescription& aFirst, |
|
58 const CCaWidgetDescription& aSecond); |
|
59 |
|
60 /** |
|
61 * Method to compare two CCaWidgetDescription objects |
|
62 * @param aToCompare first item to compare |
|
63 * @return ETrue if all value is the same in both objects, |
|
64 * otherwise returns EFalse |
|
65 */ |
|
66 TBool Compare( const CCaWidgetDescription& aToCompare ); |
|
67 |
|
68 /* |
|
69 * MMC id setter |
|
70 * @param aMmcId MMC id |
|
71 */ |
|
72 void SetMmcId( TUint aMmcId ); |
|
73 |
|
74 /* |
|
75 * PackageUid setter |
|
76 * @param aPackageUid package UID |
|
77 */ |
|
78 void SetPackageUidL( const TDesC& aPackageUid ); |
|
79 |
|
80 /* |
|
81 * Title setter |
|
82 * @param aTitle widget title |
|
83 */ |
|
84 void SetTitleL( const TDesC& aTitle ); |
|
85 |
|
86 /* |
|
87 * Description setter |
|
88 * @param aTitle widget title |
|
89 */ |
|
90 void SetDescriptionL( const TDesC& aDescription ); |
|
91 |
|
92 /* |
|
93 * Uri setter |
|
94 * @param aUri widget uri |
|
95 */ |
|
96 void SetUriL( const TDesC& aUri ); |
|
97 |
|
98 /* |
|
99 * Icon Uri setter |
|
100 * @param aIconUri widget icon uri |
|
101 */ |
|
102 void SetIconUriL( const TDesC& aIconUri ); |
|
103 |
|
104 /* |
|
105 * Library setter |
|
106 * @param aLibrary widget library |
|
107 */ |
|
108 void SetLibraryL( const TDesC& aLibrary ); |
|
109 |
|
110 /* |
|
111 * Missing flag setter |
|
112 * @param aMissing flag |
|
113 */ |
|
114 void SetMissing( TBool aMissing ); |
|
115 |
|
116 /* |
|
117 * Visible flag setter |
|
118 * @param aVisible flag |
|
119 */ |
|
120 void SetVisible( TBool aVisible ); |
|
121 |
|
122 /* |
|
123 * Used flag setter |
|
124 * @param aUsed flag |
|
125 */ |
|
126 void SetUsed( TBool aUsed ); |
|
127 |
|
128 /* |
|
129 * Content arsenal entry id getter |
|
130 * @return CA entry id |
|
131 */ |
|
132 TInt GetEntryId( ) const; |
|
133 |
|
134 /* |
|
135 * MMC id getter |
|
136 * @return CA entry id |
|
137 */ |
|
138 TUint GetMmcId( ) const; |
|
139 |
|
140 /* |
|
141 * Library getter |
|
142 * @return widget library |
|
143 */ |
|
144 TPtrC GetLibrary( ) const; |
|
145 |
|
146 /* |
|
147 * Description getter |
|
148 * @return widget Description |
|
149 */ |
|
150 TPtrC GetDescription( ) const; |
|
151 |
|
152 /* |
|
153 * Uri getter |
|
154 * @return widget Uri |
|
155 */ |
|
156 TPtrC GetUri( ) const; |
|
157 |
|
158 /* |
|
159 * IconUri getter |
|
160 * @return widget IconUri |
|
161 */ |
|
162 TPtrC GetIconUri( ) const; |
|
163 |
|
164 /* |
|
165 * Title getter |
|
166 * @return widget IconUri |
|
167 */ |
|
168 TPtrC GetTitle( ) const; |
|
169 |
|
170 /* |
|
171 * Missing flag |
|
172 * @return ETrue if flag missing is set |
|
173 */ |
|
174 TBool IsMissing( ) const; |
|
175 |
|
176 /* |
|
177 * Used flag |
|
178 * @return ETrue if flag used is set |
|
179 */ |
|
180 TBool IsUsed( ) const; |
|
181 |
|
182 /* |
|
183 * Entry getter |
|
184 * @return entry representing widget |
|
185 */ |
|
186 CCaInnerEntry* GetEntryLC( ) const; |
|
187 |
|
188 /* |
|
189 * Modification time setter |
|
190 * @param aModificationTime |
|
191 */ |
|
192 void SetModificationTimeL( const TDesC& aModificationTime ); |
|
193 |
|
194 /* |
|
195 * Modification time getter |
|
196 * @return widget Modification time |
|
197 */ |
|
198 TPtrC GetModificationTime( ) const; |
|
199 |
|
200 private: |
|
201 |
|
202 /* |
|
203 * Library name getter |
|
204 * @return libraru name |
|
205 */ |
|
206 TPtrC GetLibraryName( ) const; |
|
207 |
|
208 /* |
|
209 * Flag setter |
|
210 * @param aFlag flag |
|
211 * @param aValue flag value |
|
212 */ |
|
213 void SetFlag( TInt aFlag, TBool aValue ); |
|
214 |
|
215 private: |
|
216 |
|
217 /** |
|
218 * C++ default constructor. |
|
219 */ |
|
220 CCaWidgetDescription(); |
|
221 |
|
222 /** |
|
223 * By default Symbian 2nd phase constructor is private. |
|
224 */ |
|
225 void ConstructL( ); |
|
226 void ConstructL( CCaInnerEntry* aEntry ); |
|
227 |
|
228 |
|
229 private: |
|
230 // Data |
|
231 |
|
232 /* |
|
233 * Content Storage entry id |
|
234 */ |
|
235 TInt iEntryId; |
|
236 |
|
237 /* |
|
238 * Package UID |
|
239 */ |
|
240 TUint iPackageUid; |
|
241 |
|
242 /* |
|
243 * MMC id |
|
244 */ |
|
245 TUint iMmcId; |
|
246 |
|
247 /* |
|
248 * Widget title. Own |
|
249 */ |
|
250 RBuf iTitle; |
|
251 |
|
252 /* |
|
253 * Widget description. Own |
|
254 */ |
|
255 RBuf iDescription; |
|
256 |
|
257 /* |
|
258 * Widget uri. Own |
|
259 */ |
|
260 RBuf iUri; |
|
261 |
|
262 /* |
|
263 * Widget icon uri. Own |
|
264 */ |
|
265 RBuf iIconUri; |
|
266 |
|
267 |
|
268 /* |
|
269 * Widget library. Own |
|
270 */ |
|
271 RBuf iLibrary; |
|
272 |
|
273 /* |
|
274 * Widgets flags. |
|
275 */ |
|
276 TInt iFlags; |
|
277 |
|
278 /* |
|
279 * Modification time. |
|
280 */ |
|
281 RBuf iModificationTime; |
|
282 }; |
|
283 |
|
284 typedef RPointerArray<CCaWidgetDescription> RWidgetArray; |
|
285 |
|
286 #endif // C_WIDGETDESCRIPTION_H |
|
287 // End of File |