|
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 * Node of layout tree, plugin interface |
|
16 * |
|
17 */ |
|
18 |
|
19 #ifndef XNNODEPLUGINIF_H |
|
20 #define XNNODEPLUGINIF_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 |
|
25 // Forward declarations |
|
26 class CXnType; |
|
27 class CXnProperty; |
|
28 class CXnNode; |
|
29 class CXnViewNodeImpl; |
|
30 class CXnComponentNodeImpl; |
|
31 class TXnUiEnginePluginIf; |
|
32 class CXnNodeAppIf; |
|
33 class CXnControlAdapter; |
|
34 |
|
35 namespace XnComponentInterface |
|
36 { |
|
37 class MXnComponentInterface; |
|
38 } |
|
39 |
|
40 // Class declaration |
|
41 /** |
|
42 * Node of layout tree, plugin interface |
|
43 * |
|
44 * @ingroup group_xnlayoutengine |
|
45 * @lib xn3layoutengine.lib |
|
46 * @since Series 60 3.1 |
|
47 */ |
|
48 class CXnNodePluginIf : public CBase |
|
49 { |
|
50 public: |
|
51 /** |
|
52 * C++ default constructor. |
|
53 */ |
|
54 CXnNodePluginIf( CXnNode& aNode ); |
|
55 |
|
56 public: |
|
57 // New functions |
|
58 |
|
59 /** |
|
60 * Get the view node implementation |
|
61 * |
|
62 * @since Series 60 3.1 |
|
63 * @return View node implementation |
|
64 */ |
|
65 IMPORT_C CXnViewNodeImpl* ViewNodeImpl(); |
|
66 |
|
67 /** |
|
68 * Get the component node implementation |
|
69 * |
|
70 * @since Series 60 3.1 |
|
71 * @return Component node implementation |
|
72 */ |
|
73 IMPORT_C CXnComponentNodeImpl* ComponentNodeImpl(); |
|
74 |
|
75 /** |
|
76 * Get the UI engine |
|
77 * |
|
78 * @since Series 60 3.1 |
|
79 * @return UI engine |
|
80 */ |
|
81 IMPORT_C TXnUiEnginePluginIf* UiEngineL(); |
|
82 |
|
83 /** |
|
84 * Set node's layout capability |
|
85 * |
|
86 * @since Series 60 3.1 |
|
87 * @param aLayoutCapable Layout capability |
|
88 */ |
|
89 IMPORT_C void SetLayoutCapable( const TBool aLayoutCapable ); |
|
90 |
|
91 /** |
|
92 * Get node's layout capability |
|
93 * |
|
94 * @since Series 60 3.1 |
|
95 * @return Layout capability |
|
96 */ |
|
97 IMPORT_C TBool IsLayoutCapable() const; |
|
98 |
|
99 /** |
|
100 * Set the node's characted data |
|
101 * |
|
102 * @since Series 60 3.1 |
|
103 * @param aData Character data |
|
104 */ |
|
105 IMPORT_C void SetPCDataL( const TDesC8& aData ); |
|
106 |
|
107 /** |
|
108 * Get the node's characted data |
|
109 * |
|
110 * @since Series 60 3.1 |
|
111 * @return Character data |
|
112 */ |
|
113 IMPORT_C const TDesC8& GetPCData() const; |
|
114 |
|
115 /** |
|
116 * Set a property. |
|
117 * |
|
118 * The list will assume ownership of the property. |
|
119 * If an equal property is already in the list, it will be |
|
120 * replaced with the new property and the old property will be destroyed. |
|
121 * |
|
122 * @since Series 60 3.1 |
|
123 * @param aProperty Property to set. |
|
124 */ |
|
125 IMPORT_C void SetPropertyL( CXnProperty* aProperty ); |
|
126 |
|
127 /** |
|
128 * Set a property without notification being sent. |
|
129 * |
|
130 * @see SetPropertyL |
|
131 * @param aProperty Property to set. |
|
132 */ |
|
133 IMPORT_C void SetPropertyWithoutNotificationL( CXnProperty* aProperty ); |
|
134 |
|
135 /** |
|
136 * Gets a property. |
|
137 * |
|
138 * The list will retain ownership of the property, |
|
139 * the caller must not destroy the property. The returned pointer will |
|
140 * become invalid if the property is replaced in the list by a subsequent |
|
141 * SetL(). |
|
142 * |
|
143 * @since Series 60 3.1 |
|
144 * @param aProperty Property key |
|
145 * @return The property mapped to the key or NULL if not found. |
|
146 */ |
|
147 IMPORT_C CXnProperty* GetPropertyL( CXnProperty& aProperty ) const; |
|
148 |
|
149 /** |
|
150 * Gets a property. |
|
151 * |
|
152 * The list will retain ownership of the property, |
|
153 * the caller must not destroy the property. The returned pointer will |
|
154 * become invalid if the property is replaced in the list by a subsequent |
|
155 * SetL(). |
|
156 * |
|
157 * @since Series 60 3.1 |
|
158 * @param aKey Name of the property |
|
159 * @return The property mapped to the key or NULL if not found. |
|
160 */ |
|
161 IMPORT_C CXnProperty* GetPropertyL( const TDesC8& aKey ) const; |
|
162 |
|
163 /** |
|
164 * Set a state |
|
165 * |
|
166 * @since Series 60 3.1 |
|
167 * @param aState State to set. |
|
168 */ |
|
169 IMPORT_C void SetStateL( const TDesC8& aState ); |
|
170 |
|
171 /** |
|
172 * Unset a state |
|
173 * |
|
174 * @since Series 60 3.1 |
|
175 * @param aState State to unset. |
|
176 */ |
|
177 IMPORT_C void UnsetStateL( const TDesC8& aState ); |
|
178 |
|
179 /** |
|
180 * Is the node in focused state |
|
181 * |
|
182 * @since Series 60 3.1 |
|
183 * @return ETrue if node is focused. |
|
184 */ |
|
185 IMPORT_C TBool IsFocusedState(); |
|
186 |
|
187 /** |
|
188 * Get node type |
|
189 * |
|
190 * @since Series 60 3.1 |
|
191 * @return Node type |
|
192 */ |
|
193 IMPORT_C CXnType* Type(); |
|
194 |
|
195 /** |
|
196 * Set node's content rect |
|
197 * |
|
198 * @since Series 60 3.1 |
|
199 * @param aRect Content rect |
|
200 */ |
|
201 IMPORT_C void SetRect( const TRect& aRect ); |
|
202 |
|
203 /** |
|
204 * Get node's content rect |
|
205 * |
|
206 * @since Series 60 3.1 |
|
207 * @return Content rect |
|
208 */ |
|
209 IMPORT_C TRect Rect(); |
|
210 |
|
211 /** |
|
212 * Set node's border rect |
|
213 * |
|
214 * @since Series 60 3.1 |
|
215 * @param aRect Border rect |
|
216 */ |
|
217 IMPORT_C void SetBorderRect( const TRect& aRect ); |
|
218 |
|
219 /** |
|
220 * Get node's border rect |
|
221 * |
|
222 * @since Series 60 3.1 |
|
223 * @return Border rect |
|
224 */ |
|
225 IMPORT_C TRect BorderRect(); |
|
226 |
|
227 /** |
|
228 * Set node's margin rect |
|
229 * |
|
230 * @since Series 60 3.1 |
|
231 * @param aRect Margin rect |
|
232 */ |
|
233 IMPORT_C void SetMarginRect( const TRect& aRect ); |
|
234 |
|
235 /** |
|
236 * Get node's margin rect |
|
237 * |
|
238 * @since Series 60 3.1 |
|
239 * @return Margin rect |
|
240 */ |
|
241 IMPORT_C TRect MarginRect(); |
|
242 |
|
243 /** |
|
244 * Set node's padding rect |
|
245 * |
|
246 * @since Series 60 3.1 |
|
247 * @param aRect Padding rect |
|
248 */ |
|
249 IMPORT_C void SetPaddingRect( const TRect& aRect ); |
|
250 |
|
251 /** |
|
252 * Get node's padding rect |
|
253 * |
|
254 * @since Series 60 3.1 |
|
255 * @return Padding rect |
|
256 */ |
|
257 IMPORT_C TRect PaddingRect(); |
|
258 |
|
259 /** |
|
260 * Returns the parent. The ownership is not transferred. |
|
261 * |
|
262 * @since Series 60 3.1 |
|
263 * @return The parent area, NULL if not set. |
|
264 */ |
|
265 IMPORT_C CXnNodePluginIf* ParentL() const; |
|
266 |
|
267 /** |
|
268 * Adds a child node under this node. Assumes ownership of the node. |
|
269 * |
|
270 * @since Series 60 3.1 |
|
271 * @param aChild Child to be added |
|
272 * @exception KXnErrAddChildToAreaFailed Adding child failed. |
|
273 */ |
|
274 IMPORT_C void AddChildL( CXnNodePluginIf* aChild ); |
|
275 |
|
276 /** |
|
277 * Get the child nodes |
|
278 * |
|
279 * @since Series 60 3.1 |
|
280 * @return Child nodes |
|
281 */ |
|
282 IMPORT_C RPointerArray< CXnNodePluginIf > ChildrenL(); |
|
283 |
|
284 /** |
|
285 * Get whether the node is to be drawn |
|
286 * |
|
287 * @since Series 60 3.1 |
|
288 * @return Flag indicating whether the node should be drawn or not |
|
289 */ |
|
290 IMPORT_C TBool IsDrawingAllowed() const; |
|
291 |
|
292 /* |
|
293 * Get node application interface |
|
294 * |
|
295 * @return Node application interface |
|
296 */ |
|
297 IMPORT_C CXnNodeAppIf& AppIfL(); |
|
298 |
|
299 /** |
|
300 * Sets handle tooltip flag. |
|
301 * |
|
302 * If set to EFalse, tooltip |
|
303 * is not handled by node. |
|
304 * |
|
305 * @since S60 3.1 |
|
306 * @return Pointer to DOM node |
|
307 */ |
|
308 IMPORT_C void SetHandleTooltip( TBool aFlag ); |
|
309 |
|
310 /** |
|
311 * Offers interface to report trigger event. |
|
312 * |
|
313 * @since S60 3.1 |
|
314 * @param aTriggerName is a name of the trigger |
|
315 * @params aValueName and aValue delivers an attribute |
|
316 */ |
|
317 IMPORT_C void ReportTriggerEventL( |
|
318 const TDesC8& aTriggerName, |
|
319 const TDesC8& aValueName, |
|
320 const TDesC8& aValue ); |
|
321 |
|
322 /** |
|
323 * Gets namespace of node |
|
324 * |
|
325 * @since Series 60 5.0 |
|
326 * @return namespace |
|
327 */ |
|
328 IMPORT_C const TDesC8& Namespace(); |
|
329 |
|
330 /** |
|
331 * Gets control of node |
|
332 * |
|
333 * @since Series 60 5.0 |
|
334 * @return Control, NULL if not found |
|
335 */ |
|
336 IMPORT_C CXnControlAdapter* Control() const; |
|
337 |
|
338 /** |
|
339 * Get the internal node |
|
340 * |
|
341 * @since Series 60 3.1 |
|
342 * @return Internal node |
|
343 */ |
|
344 CXnNode& Node(); |
|
345 |
|
346 /** |
|
347 * Create a component interface according to the given type. |
|
348 * |
|
349 * @param aType Type of the interface to create |
|
350 * @return Created interface or NULL if the provided type is not supported. |
|
351 */ |
|
352 IMPORT_C XnComponentInterface::MXnComponentInterface* MakeInterfaceL( |
|
353 const TDesC8& aType ); |
|
354 |
|
355 /** |
|
356 * Get property as indicated by method name. |
|
357 * |
|
358 * @see GetPropertyL |
|
359 * @return The property mapped to the key or NULL if not found. |
|
360 */ |
|
361 IMPORT_C CXnProperty* DisplayL(); |
|
362 |
|
363 /** |
|
364 * Get property as indicated by method name. |
|
365 * |
|
366 * @see GetPropertyL |
|
367 * @return The property mapped to the key or NULL if not found. |
|
368 */ |
|
369 IMPORT_C CXnProperty* VisibilityL(); |
|
370 |
|
371 /** |
|
372 * Get property as indicated by method name. |
|
373 * |
|
374 * @see GetPropertyL |
|
375 * @return The property mapped to the key or NULL if not found. |
|
376 */ |
|
377 IMPORT_C CXnProperty* LabelL(); |
|
378 |
|
379 /** |
|
380 * Get property as indicated by method name. |
|
381 * |
|
382 * @see GetPropertyL |
|
383 * @return The property mapped to the key or NULL if not found. |
|
384 */ |
|
385 IMPORT_C CXnProperty* IdL(); |
|
386 |
|
387 /** |
|
388 * Get property as indicated by method name. |
|
389 * |
|
390 * @see GetPropertyL |
|
391 * @return The property mapped to the key or NULL if not found. |
|
392 */ |
|
393 IMPORT_C CXnProperty* VisibleRowsL(); |
|
394 |
|
395 /** |
|
396 * Get property as indicated by method name. |
|
397 * |
|
398 * @see GetPropertyL |
|
399 * @return The property mapped to the key or NULL if not found. |
|
400 */ |
|
401 IMPORT_C CXnProperty* GridColumnsL(); |
|
402 |
|
403 /** |
|
404 * Get property as indicated by method name. |
|
405 * |
|
406 * @see GetPropertyL |
|
407 * @return The property mapped to the key or NULL if not found. |
|
408 */ |
|
409 IMPORT_C CXnProperty* GridOrientationL(); |
|
410 |
|
411 /** |
|
412 * Get property as indicated by method name. |
|
413 * |
|
414 * @see GetPropertyL |
|
415 * @return The property mapped to the key or NULL if not found. |
|
416 */ |
|
417 IMPORT_C CXnProperty* GridVerDirectionL(); |
|
418 |
|
419 /** |
|
420 * Get property as indicated by method name. |
|
421 * |
|
422 * @see GetPropertyL |
|
423 * @return The property mapped to the key or NULL if not found. |
|
424 */ |
|
425 IMPORT_C CXnProperty* GridHorDirectionL(); |
|
426 |
|
427 /** |
|
428 * Get property as indicated by method name. |
|
429 * |
|
430 * @see GetPropertyL |
|
431 * @return The property mapped to the key or NULL if not found. |
|
432 */ |
|
433 IMPORT_C CXnProperty* FocusHorLoopingL(); |
|
434 |
|
435 /** |
|
436 * Get property as indicated by method name. |
|
437 * |
|
438 * @see GetPropertyL |
|
439 * @return The property mapped to the key or NULL if not found. |
|
440 */ |
|
441 IMPORT_C CXnProperty* FocusVerLoopingL(); |
|
442 |
|
443 /** |
|
444 * Get property as indicated by method name. |
|
445 * |
|
446 * @see GetPropertyL |
|
447 * @return The property mapped to the key or NULL if not found. |
|
448 */ |
|
449 IMPORT_C CXnProperty* RefL(); |
|
450 |
|
451 /** |
|
452 * Get property as indicated by method name. |
|
453 * |
|
454 * @see GetPropertyL |
|
455 * @return The property mapped to the key or NULL if not found. |
|
456 */ |
|
457 IMPORT_C CXnProperty* GridScrollBarWidthL(); |
|
458 |
|
459 /** |
|
460 * Get property as indicated by method name. |
|
461 * |
|
462 * @see GetPropertyL |
|
463 * @return The property mapped to the key or NULL if not found. |
|
464 */ |
|
465 IMPORT_C CXnProperty* GridScrollBarMarginL(); |
|
466 |
|
467 /** |
|
468 * Get property as indicated by method name. |
|
469 * |
|
470 * @see GetPropertyL |
|
471 * @return The property mapped to the key or NULL if not found. |
|
472 */ |
|
473 IMPORT_C CXnProperty* PathL(); |
|
474 |
|
475 /** |
|
476 * Get property as indicated by method name. |
|
477 * |
|
478 * @see GetPropertyL |
|
479 * @return The property mapped to the key or NULL if not found. |
|
480 */ |
|
481 IMPORT_C CXnProperty* MaskPathL(); |
|
482 |
|
483 /** |
|
484 * Marks node as dirty, adds it to UiEngine's dirty list and |
|
485 * clears rendered and laidout from the node and its children. |
|
486 */ |
|
487 IMPORT_C void SetDirtyL(); |
|
488 |
|
489 private: |
|
490 // Data |
|
491 |
|
492 /** |
|
493 * Pointer to internal node object. |
|
494 * Not own. |
|
495 */ |
|
496 CXnNode* iNode; |
|
497 }; |
|
498 |
|
499 #endif |