|
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 _XNVIEWDATA_H |
|
20 #define _XNVIEWDATA_H |
|
21 |
|
22 // User inlcudes |
|
23 #include "xnplugindata.h" |
|
24 |
|
25 // Forward declarations |
|
26 class CXnViewManager; |
|
27 class CFbsBitmap; |
|
28 |
|
29 // Constants |
|
30 |
|
31 // Class declaration |
|
32 |
|
33 /** |
|
34 * Holds view data in UiEngine |
|
35 * |
|
36 * @ingroup group_xnlayoutengine |
|
37 * @lib xn3layoutengine.lib |
|
38 * @since S60 5.0 |
|
39 */ |
|
40 NONSHARABLE_CLASS( CXnViewData ) : public CXnPluginData |
|
41 { |
|
42 public: |
|
43 // Constructors and destructor |
|
44 |
|
45 /** |
|
46 * Two-phased constructor. |
|
47 */ |
|
48 static CXnViewData* NewL( CXnPluginData& aParent ); |
|
49 static CXnViewData* NewLC( CXnPluginData& aParent ); |
|
50 |
|
51 ~CXnViewData(); |
|
52 |
|
53 private: |
|
54 // private constructors |
|
55 |
|
56 CXnViewData( CXnPluginData& aParent ); |
|
57 void ConstructL(); |
|
58 |
|
59 public: |
|
60 // From CXnPluginData |
|
61 |
|
62 /** |
|
63 * @see CXnPluginData |
|
64 */ |
|
65 TInt Load(); |
|
66 |
|
67 /** |
|
68 * @see CXnPluginData |
|
69 */ |
|
70 void Destroy(); |
|
71 |
|
72 /** |
|
73 * @see CXnPluginData |
|
74 */ |
|
75 void ResourcesL( CArrayPtrSeg< CXnResource >& aList ) const; |
|
76 |
|
77 /** |
|
78 * @see CXnPluginData |
|
79 */ |
|
80 void ControlsL( RPointerArray< CXnControlAdapter >& aList ) const; |
|
81 |
|
82 /** |
|
83 * @see CXnPluginData |
|
84 */ |
|
85 void ContentSourceNodesL( RPointerArray< CXnNode >& aList ) const; |
|
86 |
|
87 /** |
|
88 * @see CXnPluginData |
|
89 */ |
|
90 void InitialFocusNodesL( RPointerArray< CXnNode >& aList ) const; |
|
91 |
|
92 /** |
|
93 * @see CXnPluginData |
|
94 */ |
|
95 void AppearanceNodesL( RPointerArray< CXnNode >& aList ) const; |
|
96 |
|
97 /** |
|
98 * @see CXnPluginData |
|
99 */ |
|
100 void PopupNodesL( RPointerArray< CXnNode >& aList ) const; |
|
101 |
|
102 /** |
|
103 * @see CXnPluginData |
|
104 */ |
|
105 void NotifyPublisherReadyL(); |
|
106 |
|
107 public: |
|
108 // New functions |
|
109 |
|
110 /** |
|
111 * Sets viewdata to active/ not active |
|
112 * |
|
113 * @param aActive ETrue active, EFalse not active |
|
114 * @return Activation Error code |
|
115 */ |
|
116 TInt SetActive( TBool aActive ); |
|
117 |
|
118 /** |
|
119 * Returns if active or not |
|
120 * |
|
121 * @return ETrue active, EFalse otherwise |
|
122 */ |
|
123 inline TBool Active() const; |
|
124 |
|
125 /** |
|
126 * Sets viewdata to be initial |
|
127 */ |
|
128 inline void SetInitial(); |
|
129 |
|
130 /** |
|
131 * Returns if initial or not |
|
132 * |
|
133 * @return ETrue initial, EFalse otherwise |
|
134 */ |
|
135 inline TBool Initial() const; |
|
136 |
|
137 /** |
|
138 * Sets this view data to use empty widget |
|
139 * |
|
140 * @param aUse ETrue use, EFalse don't use |
|
141 */ |
|
142 inline void SetUseEmptyWidget( TBool aUse ); |
|
143 |
|
144 /** |
|
145 * Returns whether empty widget is in use in this view |
|
146 * |
|
147 * @return ETrue if empty widget is used, EFalse otherwise |
|
148 */ |
|
149 inline TBool UseEmptyWidget() const; |
|
150 |
|
151 /** |
|
152 * Finds and reurns plugin/view data for node |
|
153 * |
|
154 * @param aNode Node |
|
155 * @return Plugin data |
|
156 */ |
|
157 CXnPluginData* Plugin( CXnNode* aNode ); |
|
158 |
|
159 /** |
|
160 * Finds and reurns plugin/view data for namespace |
|
161 * |
|
162 * @param aNamespace Namespace |
|
163 * @return Plugin data |
|
164 */ |
|
165 CXnPluginData* Plugin( const TDesC8& aNamespace ); |
|
166 |
|
167 /** |
|
168 * Gets view data's plugin nodes |
|
169 * |
|
170 * @param aList Data returned in list |
|
171 */ |
|
172 void PluginNodesL( RPointerArray< CXnNode >& aList ) const; |
|
173 |
|
174 /** |
|
175 * return view data's view node |
|
176 * |
|
177 * @return View node |
|
178 */ |
|
179 CXnNode* ViewNode() const; |
|
180 |
|
181 /** |
|
182 * Set wallpaper image. Ovnership is transferred. |
|
183 * |
|
184 * @param aBitmap Background image file name. |
|
185 */ |
|
186 void SetWallpaperImage( CFbsBitmap* aBitmap ); |
|
187 |
|
188 /** |
|
189 * Get background image. Ovnership is NOT transferred. |
|
190 * |
|
191 * @return Pointer to background image. |
|
192 * Returns NULL if image has not been set. |
|
193 */ |
|
194 CFbsBitmap* WallpaperImage() const; |
|
195 |
|
196 /** |
|
197 * Set path of the wallpaper image. |
|
198 * |
|
199 * @param aFileName Image path, including file name. |
|
200 */ |
|
201 void SetWallpaperImagePathL( const TDesC& aFileName ); |
|
202 |
|
203 /** |
|
204 * Get the path of wallpaper image. |
|
205 * |
|
206 * @return Image path, including file name. |
|
207 * Returns KNullCDes if wallpaper has not been set. |
|
208 */ |
|
209 const TDesC& WallpaperImagePath() const; |
|
210 |
|
211 /** |
|
212 * Loads publishers to this view |
|
213 */ |
|
214 void LoadPublishers( TInt aReason ); |
|
215 |
|
216 /** |
|
217 * Destroys all publishers in this view |
|
218 * |
|
219 * @param aReason Destroy reason |
|
220 */ |
|
221 void DestroyPublishers( TInt aReason ); |
|
222 |
|
223 private: |
|
224 // data |
|
225 |
|
226 /** Pointer to wallpaper image, Owned */ |
|
227 CFbsBitmap* iBgImage; |
|
228 /** Path of the wallpaper image, including filename */ |
|
229 HBufC* iBgImagePath; |
|
230 /** Load error code */ |
|
231 TInt iLoadError; |
|
232 }; |
|
233 |
|
234 #include "xnviewdata.inl" |
|
235 |
|
236 #endif // _XNVIEWDATA_H |