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