85
|
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: ?Description
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef __CAINNERENTRY_H__
|
|
19 |
#define __CAINNERENTRY_H__
|
|
20 |
|
|
21 |
#include <e32base.h>
|
|
22 |
|
|
23 |
#include "caentryattribute.h"
|
92
|
24 |
#include "cainnericondescription.h"
|
85
|
25 |
|
|
26 |
/**
|
|
27 |
* Class represents Content Arsenal entry
|
|
28 |
*/
|
|
29 |
NONSHARABLE_CLASS( CCaInnerEntry ): public CBase
|
|
30 |
{
|
|
31 |
public:
|
|
32 |
|
98
|
33 |
|
|
34 |
enum TLocalizedType
|
|
35 |
{
|
|
36 |
ENameLocalized = 0,
|
|
37 |
EDescriptionLocalized
|
|
38 |
};
|
85
|
39 |
/**
|
|
40 |
* Destructor.
|
|
41 |
*/
|
|
42 |
virtual ~CCaInnerEntry();
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Two-phased constructor.
|
|
46 |
* @return The created object.
|
|
47 |
*/
|
|
48 |
IMPORT_C static CCaInnerEntry* NewL();
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Two-phased constructor.
|
|
52 |
* @return The created object.
|
|
53 |
*/
|
|
54 |
IMPORT_C static CCaInnerEntry* NewLC();
|
|
55 |
|
|
56 |
// GETTERS
|
|
57 |
/**
|
|
58 |
* Gets entry id.
|
|
59 |
* @return Entry id.
|
|
60 |
*/
|
|
61 |
IMPORT_C TInt GetId() const;
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Gets entry text.
|
|
65 |
* @return Entry text.
|
|
66 |
*/
|
|
67 |
IMPORT_C const RBuf& GetText() const;
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Gets entry description.
|
|
71 |
* @return Entry description.
|
|
72 |
*/
|
|
73 |
IMPORT_C const RBuf& GetDescription() const;
|
92
|
74 |
|
85
|
75 |
/**
|
|
76 |
* Gets entry typename.
|
|
77 |
* @return Entry typename.
|
|
78 |
*/
|
|
79 |
IMPORT_C const RBuf& GetEntryTypeName() const;
|
|
80 |
|
|
81 |
/**
|
92
|
82 |
* Gets icon description.
|
|
83 |
* @return Icon description.
|
85
|
84 |
*/
|
92
|
85 |
IMPORT_C const CCaInnerIconDescription* Icon() const;
|
85
|
86 |
|
|
87 |
/**
|
|
88 |
* Gets entry flags.
|
|
89 |
* @return Entry flags.
|
|
90 |
*/
|
|
91 |
IMPORT_C TUint GetFlags() const;
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Gets entry attributes.
|
|
95 |
* @return Entry attributes table.
|
|
96 |
*/
|
|
97 |
IMPORT_C const RCaEntryAttrArray& GetAttributes() const;
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Gets entry role.
|
|
101 |
* @return Entry role.
|
|
102 |
*/
|
|
103 |
IMPORT_C TUint GetRole() const;
|
|
104 |
|
|
105 |
/**
|
|
106 |
* Gets entry uid.
|
|
107 |
* @return Entry uid.
|
|
108 |
*/
|
|
109 |
IMPORT_C TInt32 GetUid() const;
|
|
110 |
|
|
111 |
/**
|
|
112 |
* Gets icon id.
|
|
113 |
* @return Icon id.
|
|
114 |
*/
|
|
115 |
IMPORT_C TInt GetIconId() const;
|
|
116 |
|
|
117 |
// SETTERS
|
|
118 |
/**
|
|
119 |
* Sets entry id.
|
|
120 |
* @param aId Entry id.
|
|
121 |
*/
|
|
122 |
IMPORT_C void SetId( TUint aId );
|
|
123 |
|
|
124 |
/**
|
98
|
125 |
* Sets localized entry text.
|
85
|
126 |
* @param aText Entry text.
|
|
127 |
*/
|
98
|
128 |
IMPORT_C void SetTextL(
|
|
129 |
const TDesC& aText, TBool localized = false );
|
85
|
130 |
/**
|
98
|
131 |
* Sets localized entry description.
|
85
|
132 |
* @param aText Entry description.
|
|
133 |
*/
|
98
|
134 |
IMPORT_C void SetDescriptionL(
|
|
135 |
const TDesC& aText, TBool localized = false );
|
92
|
136 |
|
85
|
137 |
/**
|
|
138 |
* Sets the entry typename.
|
|
139 |
* @param aTypeName Entry typename.
|
|
140 |
*/
|
|
141 |
IMPORT_C void SetEntryTypeNameL( const TDesC& aTypeName );
|
|
142 |
|
|
143 |
/**
|
|
144 |
* Sets icon data.
|
|
145 |
* @param aFilename Filename.
|
88
|
146 |
* @param aSkinId Skin id.
|
|
147 |
* @param aApplicationId application id.
|
85
|
148 |
*/
|
92
|
149 |
IMPORT_C void SetIconDataL(
|
|
150 |
const TDesC& aFilename, const TDesC& aSkinId, const TDesC& aApplicationId );
|
85
|
151 |
|
|
152 |
/**
|
|
153 |
* Adds attribute to entry.
|
|
154 |
* @param aKey Attribute key.
|
|
155 |
* @param aValue Attribute value.
|
|
156 |
*/
|
|
157 |
IMPORT_C void AddAttributeL( const TDesC& aKey, const TDesC& aValue );
|
|
158 |
|
|
159 |
/**
|
|
160 |
* Sets flags for the entry
|
|
161 |
* @param aFlags Flags.
|
|
162 |
*/
|
|
163 |
IMPORT_C void SetFlags( TUint aFlags );
|
|
164 |
|
|
165 |
/**
|
|
166 |
* Sets the entry's role.
|
|
167 |
* @param aRole Entry role.
|
|
168 |
*/
|
|
169 |
IMPORT_C void SetRole( TUint aRole );
|
|
170 |
|
|
171 |
/**
|
|
172 |
* Remove attribute with given key.
|
|
173 |
* @param aKey Key of attribute to be removed.
|
|
174 |
*/
|
|
175 |
IMPORT_C void RemoveAttributeL( const TDesC& aKey );
|
|
176 |
|
|
177 |
/**
|
|
178 |
* Verifies if attribute exists, and returns its value for the given key.
|
|
179 |
* @param aKey Attribute key.
|
|
180 |
* @param aAttrVal Attribute value.
|
|
181 |
* @return ETrue if attribute exists.
|
|
182 |
*/
|
|
183 |
IMPORT_C TBool FindAttribute( const TDesC& aKey, TDes& aAttrVal );
|
92
|
184 |
|
|
185 |
/**
|
|
186 |
* Verifies if attribute exists, and returns its value for the given key.
|
|
187 |
* @param aKey Attribute key.
|
|
188 |
* @param aAttrVal Attribute value.
|
|
189 |
* @return ETrue if attribute exists.
|
|
190 |
*/
|
|
191 |
IMPORT_C TBool FindAttribute( const TDesC& aKey, TPtrC& aAttrVal );
|
|
192 |
|
85
|
193 |
/**
|
|
194 |
* Sets the entry uid.
|
|
195 |
* @param aUid Entry uid.
|
|
196 |
*/
|
|
197 |
IMPORT_C void SetUid( TInt32 aUid );
|
|
198 |
|
|
199 |
/**
|
|
200 |
* Sets the entry icon id (id from storage).
|
|
201 |
* @param aIconId Icon id.
|
|
202 |
*/
|
|
203 |
IMPORT_C void SetIconId( TInt aIconId );
|
|
204 |
|
|
205 |
/**
|
|
206 |
* Externalizes object to the stream
|
|
207 |
* @param aStream a write stream
|
|
208 |
*/
|
|
209 |
IMPORT_C void ExternalizeL( RWriteStream& aStream ) const;
|
|
210 |
|
|
211 |
/**
|
|
212 |
* Internalizes stream to the object
|
|
213 |
* @param aStream a read stream
|
|
214 |
*/
|
|
215 |
IMPORT_C void InternalizeL( RReadStream& aStream );
|
98
|
216 |
|
|
217 |
/**
|
|
218 |
* Gets if Description is localized.
|
|
219 |
* @return ETrue if entry desscription is localized.
|
|
220 |
*/
|
|
221 |
IMPORT_C TBool isLocalized(TLocalizedType aLocalized) const;
|
85
|
222 |
|
|
223 |
private:
|
|
224 |
|
|
225 |
/**
|
|
226 |
* Second phased constructor.
|
|
227 |
*/
|
|
228 |
void ConstructL();
|
|
229 |
|
|
230 |
/**
|
|
231 |
* Constructor
|
|
232 |
*/
|
|
233 |
CCaInnerEntry();
|
|
234 |
|
|
235 |
private:
|
|
236 |
// data
|
|
237 |
|
|
238 |
/*
|
|
239 |
* Unique identifier of the entry.
|
|
240 |
*/
|
|
241 |
TInt iId;
|
|
242 |
|
|
243 |
/*
|
|
244 |
* Name.
|
|
245 |
* Own.
|
|
246 |
*/
|
|
247 |
RBuf iText;
|
|
248 |
|
|
249 |
/*
|
|
250 |
* Description.
|
|
251 |
* Own.
|
|
252 |
*/
|
|
253 |
RBuf iDescription;
|
92
|
254 |
|
85
|
255 |
/*
|
|
256 |
* Entry type.
|
|
257 |
* Own.
|
|
258 |
*/
|
|
259 |
RBuf iEntryTypeName;
|
|
260 |
|
|
261 |
/*
|
92
|
262 |
* Icon.
|
85
|
263 |
* Own.
|
|
264 |
*/
|
92
|
265 |
CCaInnerIconDescription* iIcon;
|
85
|
266 |
|
|
267 |
/*
|
|
268 |
* Flags.
|
|
269 |
*/
|
|
270 |
TUint iFlags;
|
|
271 |
|
|
272 |
/*
|
|
273 |
* Attributes array. Own
|
|
274 |
*/
|
|
275 |
RCaEntryAttrArray iAttributes;
|
|
276 |
|
|
277 |
/*
|
|
278 |
* Entry role ( group, item )
|
|
279 |
*/
|
|
280 |
TUint iRole;
|
|
281 |
|
|
282 |
/*
|
|
283 |
* Uid
|
|
284 |
*/
|
|
285 |
TInt32 iUid;
|
98
|
286 |
|
|
287 |
TBool iTextLocalized;
|
|
288 |
|
|
289 |
TBool iDescriptionLocalized;
|
|
290 |
|
85
|
291 |
|
|
292 |
};
|
|
293 |
|
|
294 |
#endif // __CAINNERENTRY_H__
|