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: Layout calculation and UI rendering mechanism implementations. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef _CXNUIENGINEIMPL_H |
|
20 |
#define _CXNUIENGINEIMPL_H |
|
21 |
||
22 |
// System includes |
|
23 |
||
24 |
// User includes |
|
25 |
#include "xnuistatelistener.h" |
|
26 |
#include "xnviewmanager.h" |
|
27 |
#include "xnmenu.h" |
|
28 |
||
29 |
// Forward declarations |
|
30 |
class CCoeControl; |
|
31 |
class CXnControlAdapter; |
|
32 |
class CXnNode; |
|
33 |
class CXnPointerArray; |
|
34 |
class CXnODT; |
|
35 |
class CGraphicsDevice; |
|
36 |
class CXnUiEngine; |
|
37 |
class CXnKeyEventDispatcher; |
|
38 |
class CXnEditor; |
|
39 |
class CXnResource; |
|
40 |
class CXnEditMode; |
|
41 |
class CXnViewManager; |
|
42 |
class CXnViewData; |
|
43 |
class CXnPluginData; |
|
44 |
||
45 |
// Constants |
|
46 |
namespace XnLayoutPhase |
|
47 |
{ |
|
48 |
const TInt ENone = 0x00; |
|
49 |
const TInt ELayout = 0x01; |
|
50 |
const TInt EMeasure = 0x02; |
|
51 |
} |
|
52 |
||
53 |
namespace XnLayoutControl |
|
54 |
{ |
|
55 |
const TInt ELayoutUI = 0x01; |
|
56 |
const TInt ERenderUI = 0x02; |
|
57 |
const TInt ERefreshMenu = 0x04; |
|
58 |
const TInt EIgnoreState = 0x08; |
|
59 |
const TInt EViewDirty = 0x10; |
|
60 |
const TInt EEffectStarted = 0x20; |
|
61 |
} |
|
62 |
||
63 |
NONSHARABLE_STRUCT( TXnDirtyRegion ) |
|
64 |
{ |
|
65 |
RRegion iRegion; |
|
66 |
CCoeControl* iControl; // Not own. |
|
67 |
||
68 |
~TXnDirtyRegion() |
|
69 |
{ |
|
70 |
iRegion.Close(); |
|
71 |
} |
|
72 |
}; |
|
73 |
||
74 |
||
75 |
NONSHARABLE_STRUCT( TXnSplitScreenState ) |
|
76 |
{ |
|
77 |
/** Partial screen editor node. Not own */ |
|
78 |
CXnNode* iPartialScreenEditorNode; |
|
79 |
/** Is partial screen input open */ |
|
80 |
TBool iPartialScreenOpen; |
|
81 |
/** Partial screen block progression. Own. */ |
|
82 |
const TDesC8* iPartialScreenBlock; |
|
83 |
||
84 |
// ctor |
|
85 |
TXnSplitScreenState() : |
|
86 |
iPartialScreenEditorNode( NULL ), |
|
87 |
iPartialScreenOpen( EFalse ), |
|
88 |
iPartialScreenBlock( NULL ) {} |
|
89 |
}; |
|
90 |
||
91 |
||
92 |
// Class declaration |
|
93 |
||
94 |
/** |
|
95 |
* Layout calculation and UI rendering mechanism |
|
96 |
* implementations. |
|
97 |
* |
|
98 |
* @ingroup group_xnlayoutengine |
|
99 |
* @lib xn3layoutengine.lib |
|
100 |
* @since Series 60 3.1 |
|
101 |
*/ |
|
102 |
NONSHARABLE_CLASS( CXnUiEngineImpl ) : public CBase, |
|
103 |
public MXnViewObserver, |
|
104 |
public MXnUiResourceChangeObserver, |
|
105 |
public XnMenuInterface::MXnMenuObserver |
|
106 |
{ |
|
107 |
||
108 |
public: |
|
109 |
// Constructors and destructor |
|
110 |
||
111 |
/** |
|
112 |
* Two-phased constructor. |
|
113 |
* |
|
114 |
* @param aUiEngine Ui engine |
|
115 |
* @param aViewManager View manager |
|
116 |
*/ |
|
117 |
static CXnUiEngineImpl* NewL( CXnUiEngine& aUiEngine, |
|
118 |
CXnAppUiAdapter& aAdapter ); |
|
119 |
||
120 |
/** |
|
121 |
* 2nd phase constructor |
|
122 |
*/ |
|
123 |
void ConstructL(); |
|
124 |
||
125 |
/** |
|
126 |
* Destructor. |
|
127 |
*/ |
|
128 |
virtual ~CXnUiEngineImpl(); |
|
129 |
||
130 |
public: |
|
131 |
// New functions |
|
132 |
||
133 |
/** |
|
134 |
* Gets AppUi |
|
135 |
* |
|
136 |
* @since S60 5.0 |
|
137 |
* @return AppUi |
|
138 |
*/ |
|
139 |
CXnAppUiAdapter& AppUiAdapter() const; |
|
140 |
||
141 |
/** |
|
142 |
* Lays out the UI |
|
143 |
* |
|
144 |
* @since Series 60 3.1 |
|
145 |
* @param aNode Starting point of the layout |
|
146 |
*/ |
|
147 |
void LayoutUIL( CXnNode* aNode = NULL ); |
|
148 |
||
149 |
/** |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
150 |
* Lays out the UI |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
151 |
* |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
152 |
* This generates full re-layout starting from the given node, |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
153 |
* regardless of the current dirty set or the active view. |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
154 |
* I.e. this can be used to layout an inactive view. |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
155 |
* |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
156 |
* @since Series 60 5.2 |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
157 |
* @param aNode Starting point of the layout |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
158 |
*/ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
159 |
void LayoutFromNodeL( CXnNode& aNode ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
160 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
161 |
/** |
34 | 162 |
* Creates UI implementations for the UI, adjusts control coordinates |
163 |
* according to the layout |
|
164 |
* |
|
165 |
* @since Series 60 3.1 |
|
166 |
* @param aNode Starting point |
|
167 |
*/ |
|
168 |
void RenderUIL( CXnNode* aNode = NULL ); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
169 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
170 |
/** |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
171 |
* Creates UI implementations for the UI, adjusts control coordinates |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
172 |
* according to the layout |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
173 |
* |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
174 |
* This generates full re-layout starting from the given node, |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
175 |
* regardless of the current dirty set or the active view. |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
176 |
* I.e. this can be used to layout an inactive view. |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
177 |
* |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
178 |
* @since Series 60 5.2 |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
179 |
* @param aNode Starting point |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
180 |
*/ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
181 |
void RenderFromNodeL( CXnNode& aNode ); |
34 | 182 |
|
183 |
/** |
|
184 |
* Gets the root node of the UI |
|
185 |
* |
|
186 |
* @since Series 60 3.1 |
|
187 |
* @return Root node |
|
188 |
*/ |
|
189 |
CXnNode* RootNode(); |
|
190 |
||
191 |
/** |
|
192 |
* Gets the ODT |
|
193 |
* |
|
194 |
* @since Series 60 3.1 |
|
195 |
* @return ODT |
|
196 |
*/ |
|
197 |
CXnODT* ODT(); |
|
198 |
||
199 |
/** |
|
200 |
* Finds a node by id |
|
201 |
* |
|
202 |
* @since Series 60 3.1 |
|
203 |
* @param aNode Node id |
|
204 |
* @param aNamespace Namespace |
|
205 |
* @return Node with given id |
|
206 |
*/ |
|
207 |
CXnNode* FindNodeByIdL( const TDesC& aNodeId, |
|
208 |
const TDesC& aNamespace = KNullDesC ); |
|
209 |
/** |
|
210 |
* Finds a node by id, b-bit version |
|
211 |
* |
|
212 |
* @since Series 60 3.1 |
|
213 |
* @param aNode Node id |
|
214 |
* @param aNamespace Namespace |
|
215 |
* @return Node with given id |
|
216 |
*/ |
|
217 |
CXnNode* FindNodeByIdL( const TDesC8& aNodeId, |
|
218 |
const TDesC8& aNamespace = KNullDesC8 ); |
|
219 |
/** |
|
220 |
* Finds nodes by class |
|
221 |
* |
|
222 |
* @since Series 60 3.1 |
|
223 |
* @param aClassId Class id |
|
224 |
* @return Nodes with given class id |
|
225 |
*/ |
|
226 |
CXnPointerArray* FindNodeByClassL( const TDesC& aClassId, |
|
227 |
const TDesC& aNamespace = KNullDesC ); |
|
228 |
||
229 |
/** |
|
230 |
* Finds nodes by class |
|
231 |
* |
|
232 |
* @since Series 60 3.1 |
|
233 |
* @param aClassId Class id |
|
234 |
* @return Nodes with given class id |
|
235 |
*/ |
|
236 |
CXnPointerArray* FindNodeByClassL( const TDesC8& aClassId, |
|
237 |
const TDesC8& aNamespace = KNullDesC8 ); |
|
238 |
||
239 |
/** |
|
240 |
* Find content source nodes from namespace. Ownership is not transferred. |
|
241 |
* |
|
242 |
* @since S60 5.2 |
|
243 |
* @param aNamespace Namespace |
|
244 |
* @return Content source nodes from namespace |
|
245 |
*/ |
|
246 |
CXnPointerArray* CXnUiEngineImpl::FindContentSourceNodesL( |
|
247 |
const TDesC8& aNamespace ); |
|
248 |
||
249 |
/** |
|
250 |
* Gets resources of the UI |
|
251 |
* |
|
252 |
* @since Series 60 3.1 |
|
253 |
* @return List of resources |
|
254 |
*/ |
|
255 |
CArrayPtrSeg< CXnResource >& Resources(); |
|
256 |
||
257 |
/** |
|
258 |
* Sets currently focused node |
|
259 |
* |
|
260 |
* @since Series 60 3.1 |
|
261 |
* @param aFocusedNode Currently focused node |
|
262 |
* @param aSource A source of event that triggered focus change. |
|
263 |
*/ |
|
264 |
void SetFocusedNodeL( CXnNode* aFocusedNode, TInt aSource = 0 ); |
|
265 |
||
266 |
/** |
|
267 |
* Get currently focused node |
|
268 |
* |
|
269 |
* @since Series 60 3.1 |
|
270 |
* @return Focused node. |
|
271 |
*/ |
|
272 |
CXnNode* FocusedNode(); |
|
273 |
||
274 |
/** |
|
275 |
* Checks if the UI is in Edit mode. |
|
276 |
* |
|
277 |
* @since Series 60 5.0 |
|
278 |
* @return ETrue if the current mode is edit, otherwise EFalse. |
|
279 |
*/ |
|
280 |
TBool IsEditMode(); |
|
281 |
||
282 |
/** |
|
283 |
* Get a numeric value of a property in vertical pixels |
|
284 |
* |
|
285 |
* @since Series 60 3.1 |
|
286 |
* @param aValue Property |
|
287 |
* @param aReferenceValue Value used for percentage calculation |
|
288 |
* @return Value in vertical pixels |
|
289 |
*/ |
|
290 |
TInt VerticalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); |
|
291 |
||
292 |
/** |
|
293 |
* Get a numeric value of a property in horizontal pixels |
|
294 |
* |
|
295 |
* @since Series 60 3.1 |
|
296 |
* @param aValue Property |
|
297 |
* @param aReferenceValue Value used for percentage calculation |
|
298 |
* @return Value in horizontal pixels |
|
299 |
*/ |
|
300 |
TInt HorizontalPixelValueL( CXnProperty* aValue, TInt aReferenceValue ); |
|
301 |
||
302 |
/** |
|
303 |
* Get a numeric value of a property in vertical twips |
|
304 |
* |
|
305 |
* @since Series 60 3.1 |
|
306 |
* @param aValue Property |
|
307 |
* @param aReferenceValue Value used for percentage calculation |
|
308 |
* @return Value in vertical twips |
|
309 |
*/ |
|
310 |
TInt VerticalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); |
|
311 |
||
312 |
/** |
|
313 |
* Get a numeric value of a property in horizontal twips |
|
314 |
* |
|
315 |
* @since Series 60 3.1 |
|
316 |
* @param aValue Property |
|
317 |
* @param aReferenceValue Value used for percentage calculation |
|
318 |
* @return Value in horizontal pixels |
|
319 |
*/ |
|
320 |
TInt HorizontalTwipValueL( CXnProperty* aValue, TInt aReferenceValue ); |
|
321 |
||
322 |
/** |
|
323 |
* Refresh current menu |
|
324 |
* |
|
325 |
* @since Series 60 3.1 |
|
326 |
*/ |
|
327 |
void RefreshMenuL(); |
|
328 |
||
329 |
/** |
|
330 |
* Returns view manager |
|
331 |
* |
|
332 |
* @since S60 5.0 |
|
333 |
* @return view manager |
|
334 |
*/ |
|
335 |
CXnViewManager* ViewManager(); |
|
336 |
||
337 |
/** |
|
338 |
* Returns the active view |
|
339 |
||
340 |
* @since Series 60 3.1 |
|
341 |
* @return Active view node |
|
342 |
*/ |
|
343 |
CXnNode* ActiveView(); |
|
344 |
||
345 |
/** |
|
346 |
* Add a dirty node. LayoutUiL and RenderUiL will only perform operations |
|
347 |
* on the set of dirty nodes. |
|
348 |
* |
|
349 |
* @since Series 60 3.1 |
|
350 |
* @param aNode Dirty node. |
|
351 |
* @param aLayoutPhaseHint, a hint where to start next layout phase |
|
352 |
*/ |
|
353 |
void AddDirtyNodeL( CXnNode* aNode, TInt aLevel ); |
|
354 |
||
355 |
/** |
|
356 |
* Get the size of the current screen device |
|
357 |
* |
|
358 |
* @since Series 60 3.1 |
|
359 |
* @return Size of the current screen device |
|
360 |
*/ |
|
361 |
TSize ScreenDeviceSize() const; |
|
362 |
||
363 |
/** |
|
364 |
* Checks whether the dialog is displaying. |
|
365 |
* |
|
366 |
* @since Series 60 3.1 |
|
367 |
* @return ETrue if dialog is displaying. |
|
368 |
*/ |
|
369 |
TBool IsDialogDisplaying(); |
|
370 |
||
371 |
/** |
|
372 |
* Handles a change to the control's resources of type aType |
|
373 |
* |
|
374 |
* @since Series 60 3.1 |
|
375 |
* @param aType Changed resource type |
|
376 |
*/ |
|
377 |
void HandleResourceChangeL( TInt aType ); |
|
378 |
||
379 |
/** |
|
380 |
* Checks whether the menu is displaying. |
|
381 |
* |
|
382 |
* @since Series 60 3.1 |
|
383 |
* @return ETrue if menu is displaying. |
|
384 |
*/ |
|
385 |
TBool IsMenuDisplaying(); |
|
386 |
||
387 |
/** |
|
388 |
* Returns menubar node |
|
389 |
* |
|
390 |
* @since Series 60 3.2 |
|
391 |
* @return Menubar node |
|
392 |
*/ |
|
393 |
CXnNode* MenuBarNode() const; |
|
394 |
||
395 |
/** |
|
396 |
* Returns stylus popup node |
|
397 |
* |
|
398 |
* @since S60 60 5.0 |
|
399 |
* @return stylus popup node |
|
400 |
*/ |
|
401 |
CXnNode* StylusPopupNode() const; |
|
402 |
||
403 |
/** |
|
404 |
* Set node as passive, and add it to the passive focused node array. |
|
405 |
* |
|
406 |
* @since Series 60 3.2 |
|
407 |
* @param aNode Node to use. |
|
408 |
*/ |
|
409 |
void AddPassiveFocusedNodeL( CXnNode* aNode ); |
|
410 |
||
411 |
/** |
|
412 |
* Unset the passive focus from the node, and remove it from the passive |
|
413 |
* focused node array. |
|
414 |
* |
|
415 |
* @since Series 60 3.2 |
|
416 |
* @param aNode Node to use. |
|
417 |
*/ |
|
418 |
void RemovePassiveFocusedNodeL( CXnNode* aNode ); |
|
419 |
||
420 |
/** |
|
421 |
* Clear the passive focused node array, and unset the passive focus |
|
422 |
* states. |
|
423 |
* |
|
424 |
* @since Series 60 3.2 |
|
425 |
*/ |
|
426 |
void ClearPassiveFocusedNodesL(); |
|
427 |
||
428 |
/** |
|
429 |
* Sets node's dropped state |
|
430 |
* |
|
431 |
* @since Series 60 3.2 |
|
432 |
* @param aNode Node |
|
433 |
* @param aDropped Dropped |
|
434 |
*/ |
|
435 |
void SetNodeDroppedL( CXnNode& aNode, TInt aDropped ) const; |
|
436 |
||
437 |
/** |
|
438 |
* Checks if node is adaptive, but doesn't have any content |
|
439 |
* |
|
440 |
* @since Series 60 3.2 |
|
441 |
* @param aNode node |
|
442 |
* @param aAvailableSize size to be checked |
|
443 |
*/ |
|
444 |
void CheckAdaptiveContentL( CXnNode& aNode, TSize aAvailableSize ) const; |
|
445 |
||
446 |
/** |
|
447 |
* Adds a node which can be focused |
|
448 |
* |
|
449 |
* @since Series 60 3.2 |
|
450 |
* @param aNode Node |
|
451 |
*/ |
|
452 |
void AddFocusCandidateL( CXnNode* aNode ); |
|
453 |
||
454 |
/** |
|
455 |
* Sets client rect |
|
456 |
* |
|
457 |
* @since Series 60 3.2 |
|
458 |
* @param aRect area to be set |
|
459 |
* @param aDrawNow Call rendering routines if ETrue |
|
460 |
*/ |
|
461 |
void SetClientRectL( TRect aRect, TBool aDrawNow = ETrue ); |
|
462 |
||
463 |
/** |
|
464 |
* Fetch editor to operate on AI3 widgets. |
|
465 |
* |
|
466 |
* @since Series 60 5.0 |
|
467 |
* @return Pointer to Editor |
|
468 |
*/ |
|
469 |
CXnEditor* Editor() const; |
|
470 |
||
471 |
/** |
|
472 |
* Gets client rect |
|
473 |
* |
|
474 |
* @since Series 60 3.2 |
|
475 |
* @return client rect |
|
476 |
*/ |
|
477 |
TRect ClientRect() const; |
|
478 |
||
479 |
/** |
|
480 |
* Gets pointer to edit mode storage. |
|
481 |
* |
|
482 |
* @since Series 60 5.0 |
|
483 |
* @return edit mode storage |
|
484 |
*/ |
|
485 |
CXnEditMode* EditMode(); |
|
486 |
||
487 |
/** |
|
488 |
* Get current view plugins nodes. |
|
489 |
* |
|
490 |
* @since Series 60 5.0 |
|
491 |
* @return Pointer to plugin node array |
|
492 |
*/ |
|
493 |
RPointerArray< CXnNode >* Plugins(); |
|
494 |
||
495 |
/** |
|
496 |
* Gets theme resource file |
|
497 |
* |
|
498 |
* @since S60 5.1 |
|
499 |
* @param aPath path from which file is found |
|
500 |
* @param aFile file to which resource is set |
|
501 |
* @return errorcode |
|
502 |
*/ |
|
503 |
TInt GetThemeResource( const TDesC& aPath, RFile& aFile ); |
|
504 |
||
505 |
/** |
|
506 |
* Analyse added widget |
|
507 |
* |
|
508 |
* @since S60 5.1 |
|
509 |
* @param aNode Widget to be analyzed |
|
510 |
* @return ETrue if fits, EFalse otherwise |
|
511 |
*/ |
|
512 |
TBool AnalyseAddedWidgetL( CXnNode& aNode ); |
|
513 |
||
514 |
/** |
|
515 |
* Disables layoyt and redraw, places cleanup item to cleanup stack |
|
516 |
* for enabling layot and redraw |
|
517 |
* |
|
518 |
* @since Series 60 5.0 |
|
519 |
*/ |
|
520 |
void DisableRenderUiLC(); |
|
521 |
||
522 |
/** |
|
523 |
* Set event dispatcher |
|
524 |
* |
|
525 |
* @since Series 60 5.0 |
|
526 |
* @param aDispather Event dispatcher |
|
527 |
*/ |
|
528 |
void SetEventDispatcher( CXnKeyEventDispatcher* aDispatcher ); |
|
529 |
||
530 |
/** |
|
531 |
* Enables partial touch input |
|
532 |
* |
|
533 |
* @since Series 60 5.2 |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
534 |
* @param aNode Editor Node, can be NULL when disabling partial input |
34 | 535 |
* @param TBool Partial input is enabled |
536 |
*/ |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
537 |
void EnablePartialTouchInput( CXnNode* aNode, TBool aEnable ); |
34 | 538 |
|
539 |
/** |
|
540 |
* Is partial input active |
|
541 |
* |
|
542 |
* @since Series 60 5.2 |
|
543 |
* @return TBool is partial input active |
|
544 |
*/ |
|
545 |
TBool IsPartialInputActive(); |
|
546 |
||
547 |
/** |
|
548 |
* Checks if text editor is focused or partioal touch input open. |
|
549 |
* |
|
550 |
* @since Series 60 5.2 |
|
551 |
* @return TBool True if partial input is open or editor focused |
|
552 |
*/ |
|
553 |
TBool IsTextEditorActive(); |
|
554 |
||
555 |
private: |
|
556 |
||
557 |
IMPORT_C static void EnableRenderUi( TAny* aAny ); |
|
558 |
||
559 |
private: |
|
560 |
// constructors |
|
561 |
||
562 |
/** |
|
563 |
* C++ default constructor. |
|
564 |
*/ |
|
565 |
CXnUiEngineImpl( CXnUiEngine& aUiEngine, CXnAppUiAdapter& aAdapter ); |
|
566 |
||
567 |
private: |
|
568 |
// new functions |
|
569 |
||
570 |
/** |
|
571 |
* Prepares to the layout algorithm run |
|
572 |
* |
|
573 |
* @since Series 60 3.2 |
|
574 |
*/ |
|
575 |
void PrepareRunLayoutL(); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
576 |
void PrepareRunLayoutL( CXnNode& aNode ); |
34 | 577 |
|
578 |
/** |
|
579 |
* Runs the layout algorithm |
|
580 |
* |
|
581 |
* @since Series 60 3.2 |
|
582 |
*/ |
|
583 |
TInt RunLayoutL( CXnNode* aNode ); |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
584 |
TInt RunLayoutFromNodeL( CXnNode& aNode ); |
34 | 585 |
|
586 |
/** |
|
587 |
* Checks if layout is currently disabled |
|
588 |
* |
|
589 |
* @since Series 60 3.2 |
|
590 |
*/ |
|
591 |
TBool IsLayoutDisabled(); |
|
592 |
||
593 |
void AddToRedrawListL( CXnNode* aNode, TRect aRect = |
|
594 |
TRect::EUninitialized ); |
|
595 |
||
596 |
void AddToDirtyListL( CXnNode* aNode ); |
|
597 |
||
598 |
/** |
|
599 |
* Finds a node where to start layout |
|
600 |
* |
|
601 |
* @since Series 60 5.0 |
|
602 |
*/ |
|
603 |
CXnNode* StartLayoutFromL(); |
|
604 |
||
605 |
void ForceRenderUIL( TBool aLayoutOnly = EFalse ); |
|
606 |
||
607 |
CCoeControl* WindowOwningControl( CXnNode& aNode ); |
|
608 |
||
609 |
TXnDirtyRegion* FindDirtyRegionL( CXnNode& aNode ); |
|
610 |
||
611 |
void AddRedrawRectL( TRect aRect, CXnNode& aNode ); |
|
612 |
||
613 |
void ReportScreenDeviceChangeL(); |
|
614 |
||
615 |
/** |
|
616 |
* Handle partial touch input |
|
617 |
* |
|
618 |
* @since Series 60 5.2 |
|
619 |
* @param TInt aType |
|
620 |
*/ |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
621 |
void HandlePartialTouchInputL( CXnNode* aNode, TBool aEnable ); |
34 | 622 |
|
623 |
/** |
|
624 |
* Set node visible |
|
625 |
* |
|
626 |
* @since Series 60 5.2 |
|
627 |
* @param aNode node to hide/show |
|
628 |
* @param TBool aVisible boolean to set node visible |
|
629 |
*/ |
|
630 |
void SetNodeVisibleL( CXnNode* aNode, TBool aVisible ); |
|
631 |
||
632 |
/** |
|
633 |
* Set partial screen block |
|
634 |
* |
|
635 |
* @since Series 60 5.2 |
|
636 |
* @param CXnNode aParent parent node |
|
637 |
* @param TDesC8 aBlockProgression set layout direction |
|
638 |
*/ |
|
639 |
void SetPartialScreenBlockProgressionL( |
|
640 |
CXnNode* aParent, const TDesC8& aBlockProgression ); |
|
641 |
||
642 |
/** |
|
643 |
* Handles skin change resource change |
|
644 |
* |
|
645 |
* @since Series 60 5.2 |
|
646 |
*/ |
|
647 |
void HandleSkinChangeL(); |
|
648 |
||
649 |
/** |
|
650 |
* Handles KEikDynamicLayoutVariantSwitch resource change |
|
651 |
* |
|
652 |
* @since Series 60 5.2 |
|
653 |
*/ |
|
654 |
void HandleDynamicLayoutVariantSwitchL(); |
|
655 |
||
656 |
private: |
|
657 |
//Derived functions |
|
658 |
||
659 |
/** |
|
660 |
* from MXnViewObserver |
|
661 |
*/ |
|
662 |
void NotifyViewActivatedL( const CXnViewData& aViewData ); |
|
663 |
||
664 |
/** |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
665 |
* from MXnViewObserver |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
666 |
*/ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
667 |
void NotifyViewLoadedL( const CXnViewData& aViewData ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
668 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
669 |
/** |
34 | 670 |
* from MXnViewObserver |
671 |
*/ |
|
672 |
void NotifyViewDeactivatedL( const CXnViewData& /*aViewData*/ ); |
|
673 |
||
674 |
/** |
|
675 |
* from MXnViewObserver |
|
676 |
*/ |
|
677 |
void NotifyConfigureWidgetL( const CHsContentInfo& /*aContentInfo*/, |
|
678 |
CXnPluginData& /*aPluginData*/ ); |
|
679 |
||
680 |
/** |
|
681 |
* from MXnViewObserver |
|
682 |
*/ |
|
683 |
void NotifyWidgetAdditionL( const CXnPluginData& aPluginData ); |
|
684 |
||
685 |
/** |
|
686 |
* from MXnViewObserver |
|
687 |
*/ |
|
688 |
void NotifyWidgetRemovalL( const CXnPluginData& /*aPluginData*/ ); |
|
689 |
||
690 |
/** |
|
691 |
* from MXnViewObserver |
|
692 |
*/ |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
693 |
void NotifyViewAdditionL( const CXnViewData& aViewData ); |
34 | 694 |
|
695 |
/** |
|
696 |
* from MXnViewObserver |
|
697 |
*/ |
|
35
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
698 |
void NotifyViewRemovalL( const CXnViewData& /*aViewData*/ ){}; |
34 | 699 |
|
700 |
/** |
|
701 |
* from MXnViewObserver |
|
702 |
*/ |
|
703 |
void NotifyAllViewsLoadedL(){}; |
|
704 |
||
705 |
/** |
|
706 |
* from MXnViewObserver |
|
707 |
*/ |
|
708 |
void NotifyContainerActivatedL( const CXnViewData& /*aViewData*/ ){}; |
|
709 |
||
710 |
private: |
|
711 |
// from MXnMenuObserver |
|
712 |
||
713 |
TBool DynInitMenuItemL( CXnNodeAppIf& aMenuItem, CXnNodeAppIf* aPlugin = NULL ); |
|
714 |
||
715 |
private: |
|
716 |
// from MXnPropertyChangeObserver |
|
717 |
||
718 |
/** |
|
719 |
* Property changed |
|
720 |
* |
|
721 |
* @since S60 5.1 |
|
722 |
* @param aKey key value |
|
723 |
* @param aValue property value |
|
724 |
*/ |
|
725 |
void PropertyChangedL( const TUint32 aKey, const TInt aValue ); |
|
726 |
||
727 |
private: |
|
728 |
// from MXnUiResourceChangeObserver |
|
729 |
||
730 |
/** |
|
731 |
* @see MXnUiResourceChangeObserver |
|
732 |
*/ |
|
733 |
void NotifyStatusPaneSizeChanged(); |
|
734 |
||
735 |
/** |
|
736 |
* @see MXnUiResourceChangeObserver |
|
737 |
*/ |
|
738 |
void NotifyResourceChanged( TInt aType ); |
|
739 |
||
740 |
private: |
|
741 |
// Data |
|
742 |
||
743 |
/** Current screen device, Owned */ |
|
744 |
CGraphicsDevice* iCurrentGraphicsDevice; |
|
745 |
/** UI engine - received from constructor's input parameters, Not owned */ |
|
746 |
CXnUiEngine* iUiEngine; |
|
747 |
/** AppUi, Not owned */ |
|
748 |
CXnAppUiAdapter& iAppUiAdapter; |
|
749 |
/** Not owned. View manager */ |
|
750 |
CXnViewManager& iViewManager; |
|
751 |
/** Key event dispatcher, Not owned */ |
|
752 |
CXnKeyEventDispatcher* iKeyEventDispatcher; |
|
753 |
/** ControlAdapters, not owned */ |
|
754 |
const RPointerArray< CXnControlAdapter >* iControlAdapterList; |
|
755 |
/** Region pending redraw */ |
|
756 |
RPointerArray<TXnDirtyRegion> iRedrawRegions; |
|
757 |
/** List of currently dirty nodes */ |
|
758 |
RPointerArray< CXnNode > iDirtyList; |
|
759 |
/** Array of nodes which can be focused */ |
|
760 |
RPointerArray< CXnNode > iFocusCandidateList; |
|
761 |
/** current view */ |
|
762 |
CXnNode* iCurrentView; |
|
763 |
/** current view control adapter, not owned */ |
|
764 |
CXnControlAdapter* iCurrentViewControlAdapter; |
|
765 |
/** Controls layouting */ |
|
766 |
TInt iLayoutControl; |
|
767 |
/** Layout algo phase */ |
|
768 |
TInt iLayoutPhase; |
|
769 |
/** Unit in pixels (width). */ |
|
770 |
TReal iHorizontalUnitInPixels; |
|
771 |
/** Unit in pixels (height). */ |
|
772 |
TReal iVerticalUnitInPixels; |
|
773 |
/** Cached menu node */ |
|
774 |
CXnNode* iMenuNode; |
|
775 |
/** Cached styluspopup node */ |
|
776 |
CXnNode* iStylusPopupNode; |
|
777 |
/** Drawing area */ |
|
778 |
TRect iClientRect; |
|
779 |
/** Owned. Edit mode storage; */ |
|
780 |
CXnEditMode* iEditMode; |
|
781 |
/** Disable count */ |
|
782 |
TInt iDisableCount; |
|
783 |
/**Split screen states*/ |
|
784 |
TXnSplitScreenState iSplitScreenState; |
|
785 |
}; |
|
786 |
||
787 |
#endif // _CXNUIENGINEIMPL_H |