author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 14 Sep 2010 20:58:58 +0300 | |
branch | RCL_3 |
changeset 35 | 3321d3e205b6 |
parent 34 | 5456b4e8b3a8 |
permissions | -rw-r--r-- |
34 | 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: Data class to hold widget info |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef _XNPLUGINDATA_H |
|
20 |
#define _XNPLUGINDATA_H |
|
21 |
||
22 |
// System includes |
|
23 |
#include <e32base.h> |
|
24 |
#include <babitflags.h> |
|
25 |
||
26 |
// User includes |
|
27 |
||
28 |
// Forward declarations |
|
29 |
class CXnNode; |
|
30 |
class CXnDomNode; |
|
31 |
class CXnResource; |
|
32 |
class CXnControlAdapter; |
|
33 |
class CXnViewData; |
|
34 |
class CXnODT; |
|
35 |
class CXnViewManager; |
|
36 |
class CXnPublisherData; |
|
37 |
||
38 |
// Constants |
|
39 |
||
40 |
// Class declaration |
|
41 |
||
42 |
/** |
|
43 |
* Holds plugin data in UiEngine |
|
44 |
* |
|
45 |
* @ingroup group_xnlayoutengine |
|
46 |
* @lib xn3layoutengine.lib |
|
47 |
* @since S60 5.0 |
|
48 |
*/ |
|
49 |
NONSHARABLE_CLASS( CXnPluginData ) : public CBase |
|
50 |
{ |
|
51 |
public: |
|
52 |
// Data types |
|
53 |
enum |
|
54 |
{ |
|
55 |
EUseEmpty, |
|
56 |
EIsDispose, |
|
57 |
EIsOccupied, |
|
58 |
EIsEmpty, |
|
59 |
EIsRemovable, |
|
60 |
EIsActive, |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
61 |
EIsInitial, |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
62 |
EIsEditable |
34 | 63 |
}; |
64 |
||
65 |
public: |
|
66 |
// Constructors and destructor |
|
67 |
||
68 |
/** |
|
69 |
* Two-phased constructor. |
|
70 |
* |
|
71 |
* @param aParent Parent |
|
72 |
*/ |
|
73 |
static CXnPluginData* NewL( CXnPluginData& aParent ); |
|
74 |
||
75 |
/** |
|
76 |
* Two-phased constructor. Leaving on stack |
|
77 |
* |
|
78 |
* @param aParent Parent |
|
79 |
*/ |
|
80 |
static CXnPluginData* NewLC( CXnPluginData& aParent ); |
|
81 |
||
82 |
/** |
|
83 |
* Destructor |
|
84 |
*/ |
|
85 |
~CXnPluginData(); |
|
86 |
||
87 |
protected: |
|
88 |
||
89 |
/** |
|
90 |
* C++ constructor |
|
91 |
* |
|
92 |
* @param aParent |
|
93 |
*/ |
|
94 |
CXnPluginData( CXnPluginData& aParent ); |
|
95 |
||
96 |
/** |
|
97 |
* C++ constructor |
|
98 |
* |
|
99 |
* @param aManager |
|
100 |
*/ |
|
101 |
CXnPluginData( CXnViewManager& aManager ); |
|
102 |
||
103 |
/** |
|
104 |
* C++ constructor |
|
105 |
*/ |
|
106 |
CXnPluginData(); |
|
107 |
||
108 |
/** |
|
109 |
* Leaving constructor |
|
110 |
*/ |
|
111 |
void ConstructL(); |
|
112 |
||
113 |
public: |
|
114 |
// New functions |
|
115 |
||
116 |
/** |
|
117 |
* Loads content to plugin |
|
118 |
* |
|
119 |
* @return KErrNone if succesful, error code otherwise |
|
120 |
*/ |
|
121 |
virtual TInt Load(); |
|
122 |
||
123 |
/** |
|
124 |
* Destroys content from plugin |
|
125 |
*/ |
|
126 |
virtual void Destroy(); |
|
127 |
||
128 |
/** |
|
129 |
* Sets plugindata node |
|
130 |
* |
|
131 |
* @param aNode Node to be set. |
|
132 |
*/ |
|
133 |
inline void SetNode( CXnDomNode* aNode ); |
|
134 |
||
135 |
/** |
|
136 |
* Returns plugindata node |
|
137 |
* |
|
138 |
* @return Dom Node |
|
139 |
*/ |
|
140 |
inline CXnDomNode* Node() const; |
|
141 |
||
142 |
/** |
|
143 |
* Sets Owner |
|
144 |
* |
|
145 |
* @param Dom node owner |
|
146 |
*/ |
|
147 |
inline void SetOwner( CXnDomNode* aOwner ); |
|
148 |
||
149 |
/** |
|
150 |
* Returns owner |
|
151 |
* |
|
152 |
* @return Returns the owning dom node |
|
153 |
*/ |
|
154 |
inline CXnDomNode* Owner() const; |
|
155 |
||
156 |
/** |
|
157 |
* Returns parent |
|
158 |
* |
|
159 |
* @return ViewData Parent |
|
160 |
*/ |
|
161 |
inline CXnPluginData* Parent() const; |
|
162 |
||
163 |
/** |
|
164 |
* Returns View Manager |
|
165 |
* |
|
166 |
* @return View manager |
|
167 |
*/ |
|
168 |
inline CXnViewManager& ViewManager() const; |
|
169 |
||
170 |
/** |
|
171 |
* Returns state of the parent - active/ not active |
|
172 |
* |
|
173 |
* @return ETrue - parent active |
|
174 |
* EFalse - parent not active |
|
175 |
*/ |
|
176 |
inline virtual TBool Active() const; |
|
177 |
||
178 |
/** |
|
179 |
* Sets new configuration ID |
|
180 |
* |
|
181 |
* @param aConfigurationId Config ID |
|
182 |
*/ |
|
183 |
void SetConfigurationIdL( const TDesC8& aConfigurationId ); |
|
184 |
||
185 |
/** |
|
186 |
* Returns Config. ID |
|
187 |
* |
|
188 |
* @return Id |
|
189 |
*/ |
|
190 |
inline const TDesC8& ConfigurationId() const; |
|
191 |
||
192 |
/** |
|
193 |
* Sets new plugin ID |
|
194 |
* |
|
195 |
* @param aPluginId Plugin ID |
|
196 |
*/ |
|
197 |
void SetPluginIdL( const TDesC8& aPluginId ); |
|
198 |
||
199 |
/** |
|
200 |
* Returns plugin ID |
|
201 |
* |
|
202 |
* @return Plugin ID |
|
203 |
*/ |
|
204 |
inline const TDesC8& PluginId() const; |
|
205 |
||
206 |
/** |
|
207 |
* Sets new plugin UID |
|
208 |
* |
|
209 |
* @param aPluginUid Plugin UID |
|
210 |
*/ |
|
211 |
void SetPluginUidL( const TDesC8& aPluginUid ); |
|
212 |
||
213 |
/** |
|
214 |
* Returns plugin UID |
|
215 |
* |
|
216 |
* @return Plugin Uid |
|
217 |
*/ |
|
218 |
inline const TDesC8& PluginUid() const; |
|
219 |
||
220 |
/** |
|
221 |
* Sets new plugin name |
|
222 |
* |
|
223 |
* @param aPluginName Plugin name |
|
224 |
*/ |
|
225 |
void SetPluginNameL( const TDesC8& aPluginName ); |
|
226 |
||
227 |
/** |
|
228 |
* Returns plugin name |
|
229 |
* |
|
230 |
* @return Plugin name |
|
231 |
*/ |
|
232 |
inline const TDesC8& PluginName() const; |
|
233 |
||
234 |
/** |
|
235 |
* Sets new plugin type |
|
236 |
* |
|
237 |
* @param aPluginType Plugin type |
|
238 |
*/ |
|
239 |
void SetPluginTypeL( const TDesC8& aPluginType ); |
|
240 |
||
241 |
/** |
|
242 |
* Returns plugin type |
|
243 |
* |
|
244 |
* @return Plugin type |
|
245 |
*/ |
|
246 |
inline const TDesC8& Type() const; |
|
247 |
||
248 |
/** |
|
249 |
* void SetPublisherNameL( const TDesC8& aPublisherName ) |
|
250 |
* Sets the name of the publisher |
|
251 |
* |
|
252 |
* @param const TDesC& aPublisherName - Publisher name |
|
253 |
*/ |
|
254 |
void SetPublisherNameL( const TDesC8& aPublisherName ); |
|
255 |
||
256 |
/** |
|
257 |
* void SetPublisherNameL( const TDesC& aPublisherName ) |
|
258 |
* Sets the name of the publisher |
|
259 |
* |
|
260 |
* @param const TDesC& aPublisherName - Publisher name |
|
261 |
*/ |
|
262 |
void SetPublisherNameL( const TDesC& aPublisherName ); |
|
263 |
||
264 |
/** |
|
265 |
* inline const TDesC16& PublisherName() |
|
266 |
* Returns the publisher name |
|
267 |
* |
|
268 |
* @param |
|
269 |
* @return - *iPublisherName or KNullDesC16() |
|
270 |
*/ |
|
271 |
inline const TDesC& PublisherName() const; |
|
272 |
||
273 |
/** |
|
274 |
* Sets new resources. |
|
275 |
* |
|
276 |
* @param aResources resource list |
|
277 |
*/ |
|
278 |
void SetResources( CArrayPtrSeg< CXnResource >* aResources ); |
|
279 |
||
280 |
/** |
|
281 |
* Adds resources to the list |
|
282 |
* |
|
283 |
* @param aList List are added to |
|
284 |
*/ |
|
285 |
virtual void ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const; |
|
286 |
||
287 |
/** |
|
288 |
* Adds control from Node's control |
|
289 |
* |
|
290 |
* @param aNode Node which control should be added |
|
291 |
*/ |
|
292 |
void SetControlL( CXnNode* aNode ); |
|
293 |
||
294 |
/** |
|
295 |
* Returns list of controls |
|
296 |
* |
|
297 |
* @param aList List where controls are added |
|
298 |
*/ |
|
299 |
virtual void ControlsL( RPointerArray< CXnControlAdapter >& aList ) const; |
|
300 |
||
301 |
/** |
|
302 |
* Sets content source |
|
303 |
* |
|
304 |
* @param aNode Node to be added |
|
305 |
*/ |
|
306 |
void SetContentSourceNodeL( CXnNode* aNode ); |
|
307 |
||
308 |
/** |
|
309 |
* Returns all content source nodes |
|
310 |
* |
|
311 |
* @param aList List where they are returned |
|
312 |
*/ |
|
313 |
virtual void ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const; |
|
314 |
||
315 |
/** |
|
316 |
* Returns all publishers |
|
317 |
* |
|
318 |
* @param aList List publishers |
|
319 |
*/ |
|
320 |
virtual void PublishersL( RPointerArray< CXnPublisherData >& aList ) const; |
|
321 |
||
322 |
/** |
|
323 |
* Adds appearance nodes |
|
324 |
* |
|
325 |
* @param aNode Node to be added |
|
326 |
*/ |
|
327 |
void SetAppearanceNodeL( CXnNode* aNode ); |
|
328 |
||
329 |
/** |
|
330 |
* Returns list of appearance nodes |
|
331 |
* |
|
332 |
* @param aList List of apperance nodes |
|
333 |
*/ |
|
334 |
virtual void AppearanceNodesL( RPointerArray< CXnNode >& aList ) const; |
|
335 |
||
336 |
/** |
|
337 |
* Adds an initial focus node |
|
338 |
* |
|
339 |
* @param aNode Node |
|
340 |
*/ |
|
341 |
void SetInitialFocusNodeL( CXnNode* aNode ); |
|
342 |
||
343 |
/** |
|
344 |
* Returns list of focus nodes |
|
345 |
* |
|
346 |
* @param aList List of focus nodes |
|
347 |
*/ |
|
348 |
virtual void InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const; |
|
349 |
||
350 |
/** |
|
351 |
* Returns list of popup nodes |
|
352 |
* |
|
353 |
* @param aList List of popup nodes |
|
354 |
*/ |
|
355 |
virtual void PopupNodesL( RPointerArray< CXnNode >& aList ) const; |
|
356 |
||
357 |
/** |
|
358 |
* Sets the plugin occupied |
|
359 |
*/ |
|
360 |
inline void SetOccupied(); |
|
361 |
||
362 |
/* |
|
363 |
* Checks whether occupied |
|
364 |
* |
|
365 |
* @return ETrue when occupied EFalse when not |
|
366 |
*/ |
|
367 |
inline TBool Occupied() const; |
|
368 |
||
369 |
/* |
|
370 |
* Checks whether removable |
|
371 |
* |
|
372 |
* @return ETrue when removable EFalse when not |
|
373 |
*/ |
|
374 |
inline TBool Removable() const; |
|
375 |
||
376 |
/* |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
377 |
* Checks whether editable |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
378 |
* |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
379 |
* @return ETrue when editable EFalse when not |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
380 |
*/ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
381 |
inline TBool Editable() const; |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
382 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
383 |
/* |
34 | 384 |
* Queries whether this plugin is holding "empty" widget |
385 |
* |
|
386 |
* @return ETrue if empty, EFalse otherwise |
|
387 |
*/ |
|
388 |
TBool Empty() const; |
|
389 |
||
390 |
/* |
|
391 |
* Sets this plugin to hold "empty" widget |
|
392 |
* |
|
393 |
* @param aPluginId PluginId for later usage |
|
394 |
*/ |
|
395 |
void SetEmptyL( const TDesC8& aPluginId ); |
|
396 |
||
397 |
/** |
|
398 |
* Flushes plugin data |
|
399 |
*/ |
|
400 |
void Flush(); |
|
401 |
||
402 |
/** |
|
403 |
* Sets/Unsets the popup |
|
404 |
* @param aVisible sets the popup visible or invisible |
|
405 |
* @param aNode a pointer to the popup node |
|
406 |
*/ |
|
407 |
void SetIsDisplayingPopup( TBool aVisible, CXnNode* aNode ); |
|
408 |
||
409 |
/** |
|
410 |
* Checks if the popup is displayed |
|
411 |
*/ |
|
412 |
TBool IsDisplayingPopup() const; |
|
413 |
||
414 |
/** |
|
415 |
* Returns list of plugindata |
|
416 |
* |
|
417 |
* @return List of plugindata |
|
418 |
*/ |
|
419 |
inline RPointerArray< CXnPluginData >& PluginData() const; |
|
420 |
||
421 |
/** |
|
422 |
* Loads publishers |
|
423 |
* |
|
424 |
* @param aReason Load reason |
|
425 |
*/ |
|
426 |
void LoadPublishers( TInt aReason ); |
|
427 |
||
428 |
/** |
|
429 |
* Destroy publishers |
|
430 |
* |
|
431 |
* @param aReason Destroy reason |
|
432 |
*/ |
|
433 |
void DestroyPublishers( TInt aReason ); |
|
434 |
||
435 |
/** |
|
436 |
* Notifies a publisher is ready |
|
437 |
*/ |
|
438 |
virtual void NotifyPublisherReadyL(); |
|
439 |
||
440 |
/** |
|
441 |
* Show content removed error note |
|
442 |
*/ |
|
443 |
void ShowContentRemovedError(); |
|
444 |
||
445 |
/** |
|
446 |
* Show oom error note |
|
447 |
*/ |
|
448 |
void ShowOutOfMemError(); |
|
449 |
||
450 |
/** |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
451 |
* Sets locking_status attribute (none/locked/permanent) |
34 | 452 |
* |
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
453 |
* @param aStatus "none" / "locked" / "permanent" |
34 | 454 |
*/ |
455 |
void SetLockingStatus( const TDesC8& aStatus ); |
|
456 |
||
457 |
protected: |
|
458 |
// data |
|
459 |
||
460 |
/** Plugins data */ |
|
461 |
mutable RPointerArray< CXnPluginData > iPluginsData; |
|
462 |
/** List of plugin resources, Owned */ |
|
463 |
CArrayPtrSeg< CXnResource >* iResources; |
|
464 |
/** List of controls, Not owned */ |
|
465 |
RPointerArray< CXnControlAdapter > iControls; |
|
466 |
/** List of publishers, Owned */ |
|
467 |
RPointerArray< CXnPublisherData > iPublishers; |
|
468 |
/** List of appearance nodes, Not owned */ |
|
469 |
RPointerArray< CXnNode > iAppearanceNodes; |
|
470 |
/** List of initial focus nodes, Not owned */ |
|
471 |
RPointerArray< CXnNode > iInitialFocusNodes; |
|
472 |
/** List of popup focus nodes, Not owned */ |
|
473 |
RPointerArray< CXnNode > iPopupNodes; |
|
474 |
/** Parent, Not owned */ |
|
475 |
CXnPluginData* iParent; |
|
476 |
/** View manager, Not owned */ |
|
477 |
CXnViewManager& iManager; |
|
478 |
/** This plugin's node, Not owned */ |
|
479 |
CXnDomNode* iNode; |
|
480 |
/** This plugin's owner, Not owned */ |
|
481 |
CXnDomNode* iOwner; |
|
482 |
/** config ID, Owned */ |
|
483 |
HBufC8* iConfigurationId; |
|
484 |
/** Plugin ID, Owned */ |
|
485 |
HBufC8* iPluginId; |
|
486 |
/** Plugin UID, Owned */ |
|
487 |
HBufC8* iPluginUid; |
|
488 |
/** Plugin name, Owned */ |
|
489 |
HBufC8* iPluginName; |
|
490 |
/** Plugin type, Owned */ |
|
491 |
HBufC8* iPluginType; |
|
492 |
/** Publisher name, Owned */ |
|
493 |
HBufC* iPublisherName; |
|
494 |
/** Flags to define this plugin's state */ |
|
495 |
TBitFlags32 iFlags; |
|
496 |
}; |
|
497 |
||
498 |
// Inline functions |
|
499 |
#include "xnplugindata.inl" |
|
500 |
||
501 |
#endif // _XNPLUGINDATA_H |