|
1 /* |
|
2 * Copyright (c) 2002-2004 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 * Xuikon layout engine plugin interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNUIENGINEPLUGINIF_H |
|
20 #define XNUIENGINEPLUGINIF_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 |
|
25 // User includes |
|
26 |
|
27 // Forward declarations |
|
28 class CXnUiEngine; |
|
29 class CXnProperty; |
|
30 class CXnNodePluginIf; |
|
31 class CXnDomStringPool; |
|
32 class CXnResource; |
|
33 class CXnControlAdapter; |
|
34 struct TPointerEvent; |
|
35 |
|
36 // Class declaration |
|
37 /** |
|
38 * Xuikon layout engine plugin interface. |
|
39 * |
|
40 * @ingroup group_xnlayoutengine |
|
41 * @lib xnlayoutengine.lib |
|
42 * @since Series 60 3.1 |
|
43 */ |
|
44 class TXnUiEnginePluginIf |
|
45 { |
|
46 public: |
|
47 /** |
|
48 * C++ default constructor. |
|
49 */ |
|
50 TXnUiEnginePluginIf( CXnUiEngine& aUiEngine ); |
|
51 |
|
52 public: |
|
53 // New functions |
|
54 |
|
55 /** |
|
56 * Calculates the layout of the UI |
|
57 * |
|
58 * @since Series 60 3.1 |
|
59 * @param aNode Starting point for the layout |
|
60 * @exception KXnErrLoadLayoutFileFailed Loading the layout file failed. |
|
61 */ |
|
62 IMPORT_C void RenderUIL( CXnNodePluginIf* aNode = NULL ); |
|
63 |
|
64 /** |
|
65 * Gets the root node of the UI. Ownership is not transferred. |
|
66 * |
|
67 * @since Series 60 3.1 |
|
68 * @return Node |
|
69 */ |
|
70 IMPORT_C CXnNodePluginIf& RootNodeL(); |
|
71 |
|
72 /** |
|
73 * Find a node by its id. Ownership is not transferred. |
|
74 * |
|
75 * @since Series 60 3.1 |
|
76 * @param aNodeId Area id |
|
77 * @param aNamespace Namespace |
|
78 * @return Node with the given id |
|
79 */ |
|
80 IMPORT_C CXnNodePluginIf* FindNodeByIdL( |
|
81 const TDesC& aNodeId, |
|
82 const TDesC& aNamespace = KNullDesC ); |
|
83 |
|
84 /** |
|
85 * Find a node by its id. Ownership is not transferred. |
|
86 * |
|
87 * @since Series 60 3.1 |
|
88 * @param aNodeId Area id |
|
89 * @param aNamespace Namespace |
|
90 * @return Node with the given id |
|
91 */ |
|
92 IMPORT_C CXnNodePluginIf* FindNodeByIdL( |
|
93 const TDesC8& aNodeId, |
|
94 const TDesC8& aNamespace = KNullDesC8 ); |
|
95 |
|
96 /** |
|
97 * Find nodes by class. Ownership is not transferred. |
|
98 * |
|
99 * @since Series 60 3.1 |
|
100 * @param aClassId Class id |
|
101 * @return Nodes belonging to the class |
|
102 */ |
|
103 IMPORT_C RPointerArray< CXnNodePluginIf > FindNodeByClassL( |
|
104 const TDesC& aClassId ); |
|
105 |
|
106 /** |
|
107 * Find resources (images etc.) of the UI. Ownership is not transferred. |
|
108 * |
|
109 * @since Series 60 3.1 |
|
110 * @return Resources of the UI |
|
111 */ |
|
112 IMPORT_C CArrayPtrSeg< CXnResource >& Resources(); |
|
113 |
|
114 /** |
|
115 * Get currently focused node. Ownership is not transferred. |
|
116 * |
|
117 * @since Series 60 3.1 |
|
118 * @return Focused node |
|
119 */ |
|
120 IMPORT_C CXnNodePluginIf* FocusedNodeL(); |
|
121 |
|
122 /** |
|
123 * Set currently focused node |
|
124 * |
|
125 * @since Series 60 3.1 |
|
126 * @param aFocusedNode Focused node |
|
127 */ |
|
128 IMPORT_C void SetFocusedNode( CXnNodePluginIf* aFocusedNode ); |
|
129 |
|
130 /** |
|
131 * Restore focus to previously focused node |
|
132 * |
|
133 * @since Series 60 3.1 |
|
134 */ |
|
135 IMPORT_C void RestorePreviousFocusedNode(); |
|
136 |
|
137 /** |
|
138 * Get the string pool |
|
139 * |
|
140 * @since Series 60 3.1 |
|
141 * @return String pool |
|
142 */ |
|
143 IMPORT_C CXnDomStringPool& StringPool(); |
|
144 |
|
145 /** |
|
146 * Get a numeric value of a property in vertical pixels |
|
147 * |
|
148 * @since Series 60 3.1 |
|
149 * @param aValue Property |
|
150 * @param aReferenceValue Value used for percentage calculation |
|
151 * @return Value in vertical pixels |
|
152 */ |
|
153 IMPORT_C TInt VerticalPixelValueL( |
|
154 CXnProperty* aValue, |
|
155 TInt aReferenceValue ); |
|
156 |
|
157 /** |
|
158 * Get a numeric value of a property in horizontal pixels |
|
159 * |
|
160 * @since Series 60 3.1 |
|
161 * @param aValue Property |
|
162 * @param aReferenceValue Value used for percentage calculation |
|
163 * @return Value in horizontal pixels |
|
164 */ |
|
165 IMPORT_C TInt HorizontalPixelValueL( |
|
166 CXnProperty* aValue, |
|
167 TInt aReferenceValue ); |
|
168 |
|
169 /** |
|
170 * Get a numeric value of a property in vertical twips |
|
171 * |
|
172 * @since Series 60 3.1 |
|
173 * @param aValue Property |
|
174 * @param aReferenceValue Value used for percentage calculation |
|
175 * @return Value in vertical twips |
|
176 */ |
|
177 IMPORT_C TInt VerticalTwipValueL( |
|
178 CXnProperty* aValue, |
|
179 TInt aReferenceValue ); |
|
180 |
|
181 /** |
|
182 * Get a numeric value of a property in horizontal twips |
|
183 * |
|
184 * @since Series 60 3.1 |
|
185 * @param aValue Property |
|
186 * @param aReferenceValue Value used for percentage calculation |
|
187 * @return Value in horizontal pixels |
|
188 */ |
|
189 IMPORT_C TInt HorizontalTwipValueL( |
|
190 CXnProperty* aValue, |
|
191 TInt aReferenceValue ); |
|
192 |
|
193 /** |
|
194 * Activate a view |
|
195 * |
|
196 * @since Series 60 3.1 |
|
197 * @param aViewNode View node |
|
198 */ |
|
199 IMPORT_C void ActivateViewL( CXnNodePluginIf& aViewNode ); |
|
200 |
|
201 /** |
|
202 * Get the size of the current screen device |
|
203 * |
|
204 * @since Series 60 3.1 |
|
205 * @return Size of the current screen device |
|
206 */ |
|
207 IMPORT_C TSize ScreenDeviceSize(); |
|
208 |
|
209 /** |
|
210 * Checks whether the dialog is displaying. |
|
211 * |
|
212 * @since Series 60 3.1 |
|
213 * @return ETrue if dialog is displaying. |
|
214 */ |
|
215 IMPORT_C TBool IsDialogDisplaying(); |
|
216 |
|
217 /** |
|
218 * Sets the given node dirty. |
|
219 * |
|
220 * @since Series 60 3.1 |
|
221 * @param aNode A node to be set dirty. |
|
222 */ |
|
223 IMPORT_C void AddDirtyNodeL( CXnNodePluginIf& aNode ); |
|
224 |
|
225 /** |
|
226 * Checks whether the menu is displaying. |
|
227 * |
|
228 * @since Series 60 3.1 |
|
229 * @return ETrue if menu is displaying. |
|
230 */ |
|
231 IMPORT_C TBool IsMenuDisplaying(); |
|
232 |
|
233 /** |
|
234 * Calculates the layout of the UI. |
|
235 * |
|
236 * @since Series 60 3.1 |
|
237 * @param aNode Starting point for the layout |
|
238 */ |
|
239 IMPORT_C void LayoutUIL( CXnNodePluginIf* aNode = NULL ); |
|
240 |
|
241 /** |
|
242 * Gets the edit mode state from UI Engine. |
|
243 * |
|
244 * @since Series 60 5.0 |
|
245 * @return A state of edit mode. |
|
246 */ |
|
247 IMPORT_C TInt EditMode(); |
|
248 |
|
249 /** |
|
250 * Gets widgets visibilty state |
|
251 * |
|
252 * @since Series 60 5.0 |
|
253 * @return ETrue if widgets visible, EFalse otherwise |
|
254 */ |
|
255 IMPORT_C TBool WidgetsVisible() const; |
|
256 |
|
257 /** |
|
258 * Gets control defining hit region |
|
259 * |
|
260 * @since Series 60 5.0 |
|
261 * @return Control defining the hit region |
|
262 */ |
|
263 IMPORT_C CXnControlAdapter* HitRegion() const; |
|
264 |
|
265 /** |
|
266 * Deactivates focused node |
|
267 * |
|
268 * @since Series 60 5.0 |
|
269 */ |
|
270 IMPORT_C void DeactivateFocusedNodeL(); |
|
271 |
|
272 /** |
|
273 * Queries wheter focus is visible |
|
274 * |
|
275 * @since Series 60 5.0 |
|
276 * @return ETrue if focus is shown, EFalse otherwise |
|
277 */ |
|
278 IMPORT_C TBool ShowFocus(); |
|
279 |
|
280 /** |
|
281 * Gets a plugin node which the given node is. |
|
282 * |
|
283 * @since Series 60 5.0 |
|
284 * @param aNode Node to start. |
|
285 * @return A Plugin node. |
|
286 */ |
|
287 IMPORT_C CXnNodePluginIf& PluginNodeL( CXnNodePluginIf* aNode ); |
|
288 |
|
289 /** |
|
290 * Sets focus visibility for active view |
|
291 * @since Series 60 5.0 |
|
292 * @param aVisible Visibility state |
|
293 */ |
|
294 IMPORT_C void SetFocusVisibleL( TBool aVisible ); |
|
295 |
|
296 /** |
|
297 * Return focus visibility of active view |
|
298 * @since Series 60 5.0 |
|
299 * @return ETrue if active view focus is visible, EFalse otherwise |
|
300 */ |
|
301 IMPORT_C TBool FocusVisible(); |
|
302 |
|
303 /** |
|
304 * Enables or disables swipe for active view |
|
305 * @since Series 60 5.0 |
|
306 * @param aEnable True will enable swipe, false will disable |
|
307 */ |
|
308 IMPORT_C void EnableSwipeL( TBool aEnable ); |
|
309 |
|
310 /** |
|
311 * Return whether swipe is enabled or not |
|
312 * @since Series 60 5.0 |
|
313 * @return ETrue if swipe is enable, EFalse otherwise |
|
314 */ |
|
315 IMPORT_C TBool SwipeEnabledL(); |
|
316 |
|
317 /** |
|
318 * Disables layoyt and redraw, places cleanup item to cleanup stack |
|
319 * for enabling layot and redraw |
|
320 * |
|
321 * @since Series 60 5.0 |
|
322 */ |
|
323 IMPORT_C void DisableRenderUiLC(); |
|
324 |
|
325 private: |
|
326 // Data |
|
327 |
|
328 /** |
|
329 * The layout calculation and ui rendering implementation. |
|
330 * Not own. |
|
331 */ |
|
332 CXnUiEngine* iUiEngine; |
|
333 }; |
|
334 |
|
335 #endif |