author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 15 Sep 2010 12:00:00 +0300 | |
branch | RCL_3 |
changeset 93 | b01126ce0bec |
parent 88 | 3321d3e205b6 |
child 102 | ba63c83f4716 |
permissions | -rw-r--r-- |
83 | 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: Xuikon view adapter source file |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <aknViewAppUi.h> |
|
20 |
#include <eikbtgpc.h> |
|
21 |
#include <avkon.rsg> |
|
22 |
||
23 |
// User includes |
|
24 |
#include "xnappuiadapter.h" |
|
25 |
#include "xnviewmanager.h" |
|
26 |
#include "xnviewdata.h" |
|
27 |
#include "xnuiengine.h" |
|
28 |
||
29 |
#include "xnkeyeventdispatcher.h" |
|
30 |
#include "xncontroladapter.h" |
|
31 |
||
32 |
#include "xndomdocument.h" |
|
33 |
#include "xndomnode.h" |
|
34 |
#include "xndomlist.h" |
|
35 |
#include "xnodt.h" |
|
36 |
#include "xnproperty.h" |
|
37 |
#include "xnnodeimpl.h" |
|
38 |
#include "xnnode.h" |
|
39 |
#include "xntype.h" |
|
40 |
#include "xnfocuscontrol.h" |
|
41 |
#include "xneditor.h" |
|
42 |
#include "xnbackgroundmanager.h" |
|
43 |
#include "xneffectmanager.h" |
|
44 |
#include "xnwallpaperview.h" |
|
45 |
||
46 |
#include "xnviewadapter.h" |
|
47 |
#include "xnmenu.h" |
|
48 |
#include "xneditmode.h" |
|
49 |
#include "xnrootdata.h" |
|
50 |
||
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
51 |
#include "xnpopupcontroladapter.h" |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
52 |
|
83 | 53 |
#include "debug.h" |
54 |
||
55 |
// Constants |
|
56 |
const TUid KXmlViewUid = { 1 }; |
|
57 |
||
58 |
_LIT8( KActivateDefaultView, "activatedefault" ); |
|
59 |
_LIT8( KSetWallpaper, "setwallpaper" ); |
|
60 |
||
61 |
_LIT8( KMenuBar, "menubar" ); |
|
62 |
||
63 |
// Data types |
|
64 |
enum |
|
65 |
{ |
|
66 |
EIsActivated, |
|
67 |
EIsInCall, |
|
68 |
EIsLightsOn, |
|
69 |
EIsForeground, |
|
70 |
EIsControlsAwake, |
|
71 |
EIsDestructionRunning |
|
72 |
}; |
|
73 |
||
74 |
enum TAction |
|
75 |
{ |
|
76 |
ENoAction = 0, |
|
77 |
EActivateDefault, |
|
78 |
ESetWallpaper |
|
79 |
}; |
|
80 |
||
81 |
// ============================= LOCAL FUNCTIONS =============================== |
|
82 |
// ----------------------------------------------------------------------------- |
|
83 |
// CleanupEffect |
|
84 |
// ----------------------------------------------------------------------------- |
|
85 |
// |
|
86 |
static void CleanupEffect( TAny* aAny ) |
|
87 |
{ |
|
88 |
static_cast< CXnEffectManager* >( aAny )->CleanupControlEffect(); |
|
89 |
} |
|
90 |
||
91 |
// ----------------------------------------------------------------------------- |
|
92 |
// DetermineStatusPaneLayout |
|
93 |
// ----------------------------------------------------------------------------- |
|
94 |
// |
|
95 |
static TInt DetermineStatusPaneLayout( CXnProperty* aProperty ) |
|
96 |
{ |
|
97 |
TInt spane( KErrNotFound ); |
|
98 |
||
99 |
if ( aProperty ) |
|
100 |
{ |
|
101 |
const TDesC8& value( aProperty->StringValue() ); |
|
102 |
||
103 |
// Currently supported status pane layout |
|
104 |
if ( value == XnPropertyNames::view::statuspanelayout::KNone ) |
|
105 |
{ |
|
106 |
spane = R_AVKON_STATUS_PANE_LAYOUT_EMPTY; |
|
107 |
} |
|
108 |
if ( value == XnPropertyNames::view::statuspanelayout::KBasic ) |
|
109 |
{ |
|
110 |
spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE; |
|
111 |
} |
|
112 |
else if ( value == XnPropertyNames::view::statuspanelayout::KBasicFlat ) |
|
113 |
{ |
|
114 |
spane = R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT; |
|
115 |
} |
|
116 |
else if ( value == |
|
117 |
XnPropertyNames::view::statuspanelayout::KWideScreen ) |
|
118 |
{ |
|
119 |
spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE; |
|
120 |
} |
|
121 |
else if ( value == |
|
122 |
XnPropertyNames::view::statuspanelayout::KWideScreenFlat ) |
|
123 |
{ |
|
124 |
spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT; |
|
125 |
} |
|
126 |
else if ( value == |
|
127 |
XnPropertyNames::view::statuspanelayout:: |
|
128 |
KWideScreenFlat3Softkeys ) |
|
129 |
{ |
|
130 |
spane = R_AVKON_WIDESCREEN_PANE_LAYOUT_IDLE_FLAT_NO_SOFTKEYS; |
|
131 |
} |
|
132 |
} |
|
133 |
||
134 |
return spane; |
|
135 |
} |
|
136 |
||
137 |
// ----------------------------------------------------------------------------- |
|
138 |
// BuildTriggerL |
|
139 |
// ----------------------------------------------------------------------------- |
|
140 |
// |
|
141 |
static CXnNode* BuildTriggerL( |
|
142 |
CXnUiEngine& aUiEngine, |
|
143 |
const TDesC8& aTriggerName ) |
|
144 |
{ |
|
145 |
CXnNode* node = CXnNode::NewL(); |
|
146 |
CleanupStack::PushL( node ); |
|
147 |
CXnType* type = CXnType::NewL( XnPropertyNames::action::KTrigger ); |
|
148 |
CleanupStack::PushL( type ); |
|
149 |
CXnNodeImpl* impl = CXnNodeImpl::NewL( type ); |
|
150 |
CleanupStack::Pop( type ); |
|
151 |
node->SetImpl( impl ); |
|
152 |
node->SetUiEngine( aUiEngine ); |
|
153 |
||
154 |
CXnDomPropertyValue* nameValue = CXnDomPropertyValue::NewL( |
|
155 |
aUiEngine.ODT()->DomDocument().StringPool() ); |
|
156 |
CleanupStack::PushL( nameValue ); |
|
157 |
nameValue->SetStringValueL( CXnDomPropertyValue::EString, aTriggerName ); |
|
158 |
CXnProperty* name = CXnProperty::NewL( |
|
159 |
XnPropertyNames::action::trigger::KName, |
|
160 |
nameValue, |
|
161 |
*aUiEngine.ODT()->DomDocument().StringPool() ); |
|
162 |
CleanupStack::Pop( nameValue ); |
|
163 |
CleanupStack::PushL( name ); |
|
164 |
node->SetPropertyL( name ); |
|
165 |
CleanupStack::Pop( 2, node ); // name |
|
166 |
||
167 |
return node; |
|
168 |
} |
|
169 |
||
170 |
// ----------------------------------------------------------------------------- |
|
171 |
// BuildActivateTriggerL |
|
172 |
// ----------------------------------------------------------------------------- |
|
173 |
// |
|
174 |
static CXnNode* BuildActivateTriggerL( CXnUiEngine& aUiEngine ) |
|
175 |
{ |
|
176 |
return BuildTriggerL( |
|
177 |
aUiEngine, XnPropertyNames::action::trigger::name::KViewActivate ); |
|
178 |
} |
|
179 |
||
180 |
// ----------------------------------------------------------------------------- |
|
181 |
// BuildDeactivateTriggerL |
|
182 |
// ----------------------------------------------------------------------------- |
|
183 |
// |
|
184 |
static CXnNode* BuildDeactivateTriggerL( CXnUiEngine& aUiEngine ) |
|
185 |
{ |
|
186 |
return BuildTriggerL( |
|
187 |
aUiEngine, XnPropertyNames::action::trigger::name::KViewDeactivate ); |
|
188 |
} |
|
189 |
||
190 |
// ----------------------------------------------------------------------------- |
|
191 |
// BuildEditStateTriggerL |
|
192 |
// ----------------------------------------------------------------------------- |
|
193 |
// |
|
194 |
static CXnNode* BuildEditStateTriggerL( CXnUiEngine& aUiEngine ) |
|
195 |
{ |
|
196 |
CXnDomStringPool* sp( aUiEngine.ODT()->DomDocument().StringPool() ); |
|
197 |
||
198 |
CXnProperty* value = CXnProperty::NewL( |
|
199 |
XnPropertyNames::action::KValue, |
|
200 |
KNullDesC8, CXnDomPropertyValue::EString, *sp ); |
|
201 |
CleanupStack::PushL( value ); |
|
202 |
||
203 |
CXnNode* trigger( BuildTriggerL( |
|
204 |
aUiEngine, XnPropertyNames::action::trigger::name::KEditMode ) ); |
|
205 |
CleanupStack::PushL( trigger ); |
|
206 |
||
207 |
trigger->SetPropertyL( value ); |
|
208 |
CleanupStack::Pop( 2, value ); // trigger |
|
209 |
||
210 |
return trigger; |
|
211 |
} |
|
212 |
||
213 |
// ============================ MEMBER FUNCTIONS =============================== |
|
214 |
||
215 |
// ----------------------------------------------------------------------------- |
|
216 |
// CXnViewAdapter::CXnViewAdapter |
|
217 |
// C++ default constructor can NOT contain any code, that |
|
218 |
// might leave. |
|
219 |
// ----------------------------------------------------------------------------- |
|
220 |
// |
|
221 |
CXnViewAdapter::CXnViewAdapter( CXnAppUiAdapter& aAdapter ) |
|
222 |
: iAppUiAdapter( aAdapter ) |
|
223 |
{ |
|
224 |
} |
|
225 |
||
226 |
// ----------------------------------------------------------------------------- |
|
227 |
// CXnViewAdapter::~CXnViewAdapter |
|
228 |
// Destructor. |
|
229 |
// ----------------------------------------------------------------------------- |
|
230 |
// |
|
231 |
CXnViewAdapter::~CXnViewAdapter() |
|
232 |
{ |
|
233 |
delete iTimer; |
|
234 |
delete iActivate; |
|
235 |
delete iDeactivate; |
|
236 |
delete iEditState; |
|
237 |
delete iBgManager; |
|
238 |
delete iFocusControl; |
|
239 |
} |
|
240 |
||
241 |
// ----------------------------------------------------------------------------- |
|
242 |
// CXnViewAdapter::NewL |
|
243 |
// 2nd phase construction. |
|
244 |
// ----------------------------------------------------------------------------- |
|
245 |
// |
|
246 |
CXnViewAdapter* CXnViewAdapter::NewL( CXnAppUiAdapter& aAdapter ) |
|
247 |
{ |
|
248 |
CXnViewAdapter* self = new ( ELeave ) CXnViewAdapter( aAdapter ); |
|
249 |
CleanupStack::PushL( self ); |
|
250 |
self->ConstructL(); |
|
251 |
CleanupStack::Pop( self ); |
|
252 |
return self; |
|
253 |
} |
|
254 |
||
255 |
// ----------------------------------------------------------------------------- |
|
256 |
// CXnViewAdapter::ConstructL |
|
257 |
// 2nd phase construction. |
|
258 |
// ----------------------------------------------------------------------------- |
|
259 |
// |
|
260 |
void CXnViewAdapter::ConstructL() |
|
261 |
{ |
|
262 |
BaseConstructL(); |
|
263 |
||
264 |
iTimer = CPeriodic::NewL( CActive::EPriorityIdle ); |
|
265 |
||
266 |
// Base class CAknViewAppUi takes ownership of iViewAdapter |
|
267 |
iAppUiAdapter.AddViewL( this ); |
|
268 |
iAppUiAdapter.SetDefaultViewL( *this ); |
|
269 |
||
270 |
iBgManager = CXnBackgroundManager::NewL( iAppUiAdapter.ViewManager(), |
|
271 |
iAppUiAdapter.ViewManager().Editor().HspsWrapper() ); |
|
272 |
||
273 |
iFocusControl = CXnFocusControl::NewL( iAppUiAdapter ); |
|
274 |
||
275 |
iEventDispatcher = |
|
276 |
CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() ); |
|
277 |
||
278 |
iAppUiAdapter.UiEngine().SetEventDispatcher( iEventDispatcher ); |
|
279 |
||
280 |
iAppUiAdapter.UiStateListener().AddObserver( *this ); |
|
281 |
} |
|
282 |
||
283 |
// ----------------------------------------------------------------------------- |
|
284 |
// CXnViewAdapter::ReloadUiL |
|
285 |
// Called when application UI is reloaded |
|
286 |
// ----------------------------------------------------------------------------- |
|
287 |
// |
|
288 |
void CXnViewAdapter::ReloadUiL() |
|
289 |
{ |
|
290 |
iTimer->Cancel(); |
|
291 |
iAction = ENoAction; |
|
292 |
||
293 |
DeactivateContainerL(); |
|
294 |
||
295 |
iAppUiAdapter.RemoveFromStack( iEventDispatcher ); |
|
296 |
||
297 |
delete iEventDispatcher; |
|
298 |
iEventDispatcher = NULL; |
|
299 |
||
300 |
delete iActivate; |
|
301 |
iActivate = NULL; |
|
302 |
||
303 |
delete iDeactivate; |
|
304 |
iDeactivate = NULL; |
|
305 |
||
306 |
delete iEditState; |
|
307 |
iEditState = NULL; |
|
308 |
||
309 |
iEventDispatcher = CXnKeyEventDispatcher::NewL( iAppUiAdapter.UiEngine() ); |
|
310 |
||
311 |
iAppUiAdapter.UiEngine().SetEventDispatcher( iEventDispatcher ); |
|
312 |
||
313 |
if ( iFlags.IsSet( EIsActivated ) ) |
|
314 |
{ |
|
315 |
iAppUiAdapter.AddToStackL( *this, iEventDispatcher ); |
|
316 |
} |
|
317 |
} |
|
318 |
||
319 |
// ----------------------------------------------------------------------------- |
|
320 |
// CXnViewAdapter::PrepareToExit |
|
321 |
// Sets view to be destroyed |
|
322 |
// ----------------------------------------------------------------------------- |
|
323 |
// |
|
324 |
void CXnViewAdapter::PrepareToExit() |
|
325 |
{ |
|
326 |
iAppUiAdapter.RemoveFromStack( iEventDispatcher ); |
|
327 |
||
328 |
delete iEventDispatcher; |
|
329 |
iEventDispatcher = NULL; |
|
330 |
||
331 |
iAppUiAdapter.UiEngine().SetEventDispatcher( NULL ); |
|
332 |
||
333 |
iContainer = NULL; |
|
334 |
||
335 |
iFlags.Set( EIsDestructionRunning ); |
|
336 |
} |
|
337 |
||
338 |
// ----------------------------------------------------------------------------- |
|
339 |
// CXnViewAdapter::EventDispatcher |
|
340 |
// Get event dispatcher |
|
341 |
// ----------------------------------------------------------------------------- |
|
342 |
// |
|
343 |
CXnKeyEventDispatcher* CXnViewAdapter::EventDispatcher() const |
|
344 |
{ |
|
345 |
return iEventDispatcher; |
|
346 |
} |
|
347 |
||
348 |
// ----------------------------------------------------------------------------- |
|
349 |
// CXnViewAdapter::BgManager |
|
350 |
// Returns background manager. |
|
351 |
// ----------------------------------------------------------------------------- |
|
352 |
// |
|
353 |
CXnBackgroundManager& CXnViewAdapter::BgManager() const |
|
354 |
{ |
|
355 |
return *iBgManager; |
|
356 |
} |
|
357 |
||
358 |
// ----------------------------------------------------------------------------- |
|
359 |
// CXnViewAdapter::FocusControl |
|
360 |
// Returns focus control. |
|
361 |
// ----------------------------------------------------------------------------- |
|
362 |
// |
|
363 |
CXnFocusControl& CXnViewAdapter::FocusControl() const |
|
364 |
{ |
|
365 |
return *iFocusControl; |
|
366 |
} |
|
367 |
||
368 |
// ----------------------------------------------------------------------------- |
|
369 |
// CXnViewAdapter::Id |
|
370 |
// Returns view uid. |
|
371 |
// ----------------------------------------------------------------------------- |
|
372 |
// |
|
373 |
TUid CXnViewAdapter::Id() const |
|
374 |
{ |
|
375 |
return KXmlViewUid; |
|
376 |
} |
|
377 |
||
378 |
// ----------------------------------------------------------------------------- |
|
379 |
// CXnViewAdapter::DoActivateL |
|
380 |
// Activates view. |
|
381 |
// ----------------------------------------------------------------------------- |
|
382 |
// |
|
383 |
void CXnViewAdapter::DoActivateL( const TVwsViewId& /*aPrevViewId*/, |
|
384 |
TUid /*aCustomMessageId*/, |
|
385 |
const TDesC8& aCustomMessage ) |
|
386 |
{ |
|
387 |
if ( iFlags.IsSet( EIsDestructionRunning ) ) |
|
388 |
{ |
|
389 |
return; |
|
390 |
} |
|
391 |
||
392 |
__TICK( "CXnViewAdapter::DoActivateL" ); |
|
393 |
__TIME_MARK( time ); |
|
394 |
||
395 |
TBool wasActive( iFlags.IsSet( EIsActivated ) ); |
|
396 |
||
397 |
iFlags.Set( EIsActivated ); |
|
398 |
||
399 |
iEventDispatcher->ClearStateL(); |
|
400 |
||
401 |
iAppUiAdapter.RemoveFromStack( iEventDispatcher ); |
|
402 |
iAppUiAdapter.AddToStackL( *this, iEventDispatcher ); |
|
403 |
||
404 |
CEikButtonGroupContainer* bgc( iAppUiAdapter.Cba() ); |
|
405 |
||
406 |
if ( bgc ) |
|
407 |
{ |
|
408 |
// EventDispatcher will handle sotkey keyevents |
|
409 |
CEikCba* cba( |
|
410 |
static_cast< CEikCba* >( bgc->ButtonGroup() ) ); |
|
411 |
||
412 |
iAppUiAdapter.RemoveFromStack( cba ); |
|
413 |
} |
|
414 |
||
415 |
iBgManager->MakeVisible( ETrue ); |
|
416 |
||
417 |
CXnViewData& viewData( iAppUiAdapter.ViewManager().ActiveViewData() ); |
|
418 |
||
419 |
if ( !wasActive ) |
|
420 |
{ |
|
421 |
// Set status pane layout |
|
422 |
CXnProperty* prop( viewData.Node()->LayoutNode()->GetPropertyL( |
|
423 |
XnPropertyNames::view::KStatusPaneLayout ) ); |
|
424 |
||
425 |
CEikStatusPane* sp( iAppUiAdapter.StatusPane() ); |
|
426 |
||
427 |
// Is there status pane declaration available |
|
428 |
TInt spane( DetermineStatusPaneLayout( prop ) ); |
|
429 |
||
430 |
if ( spane != KErrNotFound ) |
|
431 |
{ |
|
432 |
if ( sp && sp->CurrentLayoutResId() != spane ) |
|
433 |
{ |
|
434 |
sp->SwitchLayoutL( spane ); |
|
435 |
sp->ApplyCurrentSettingsL(); |
|
436 |
} |
|
437 |
} |
|
438 |
||
439 |
// enable statuspane transparancy |
|
440 |
if ( sp && !sp->IsTransparent() ) |
|
441 |
{ |
|
442 |
sp->EnableTransparent( ETrue ); |
|
443 |
sp->DrawNow(); |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
if ( aCustomMessage == KSetWallpaper ) |
|
448 |
{ |
|
449 |
iAction = ESetWallpaper; |
|
450 |
||
451 |
iTimer->Cancel(); |
|
452 |
iTimer->Start( 1000, 1000, TCallBack( TimerCallback, this ) ); |
|
453 |
} |
|
454 |
||
455 |
// Set the active container |
|
456 |
if ( aCustomMessage == KActivateDefaultView ) |
|
457 |
{ |
|
458 |
__PRINTS( "*** CXnViewAdapter::DoActivateL - activating default container" ); |
|
459 |
||
460 |
ActivateDefaultContainerL(); |
|
461 |
||
462 |
iAction = EActivateDefault; |
|
463 |
||
464 |
iTimer->Cancel(); |
|
465 |
iTimer->Start( 1000, 1000, TCallBack( TimerCallback, this ) ); |
|
466 |
} |
|
467 |
else |
|
468 |
{ |
|
469 |
__PRINTS( "*** CXnViewAdapter::DoActivateL - activating container" ); |
|
470 |
||
471 |
ActivateContainerL( viewData ); |
|
472 |
} |
|
473 |
||
474 |
__TIME_ENDMARK( "CXnViewAdapter::DoActivateL, done", time ); |
|
475 |
||
476 |
__TICK( "CXnViewAdapter::DoActivateL - HS UI Ready" ); |
|
477 |
} |
|
478 |
||
479 |
// ----------------------------------------------------------------------------- |
|
480 |
// CXnViewAdapter::TimerCallback |
|
481 |
// |
|
482 |
// ----------------------------------------------------------------------------- |
|
483 |
// |
|
484 |
TInt CXnViewAdapter::TimerCallback( TAny *aPtr ) |
|
485 |
{ |
|
486 |
__PRINTS( "*** CXnViewAdapter::TimerCallback" ); |
|
487 |
||
488 |
CXnViewAdapter* self = reinterpret_cast< CXnViewAdapter* >( aPtr ); |
|
489 |
self->iTimer->Cancel(); |
|
490 |
||
491 |
if ( self->iAction == EActivateDefault ) |
|
492 |
{ |
|
493 |
self->iCoeEnv->WsSession().SetWindowGroupOrdinalPosition( |
|
494 |
self->iCoeEnv->RootWin().Identifier(), 0 ); |
|
495 |
} |
|
496 |
else if ( self->iAction == ESetWallpaper ) |
|
497 |
{ |
|
498 |
CAknViewAppUi& appui = static_cast< CAknViewAppUi& >( self->iAppUiAdapter ); |
|
499 |
||
500 |
CXnWallpaperView* view = |
|
501 |
static_cast< CXnWallpaperView* >( appui.View( KWallpaperViewUid ) ); |
|
502 |
||
503 |
if ( view ) |
|
504 |
{ |
|
505 |
TFileName filename( KNullDesC ); |
|
506 |
||
507 |
// Get selected wallpaper |
|
508 |
view->SelectedWallpaper( filename ); |
|
509 |
||
510 |
if ( filename != KNullDesC ) |
|
511 |
{ |
|
512 |
if ( self->BgManager().SetWallpaper( filename ) ) |
|
513 |
{ |
|
514 |
self->iAppUiAdapter.EffectManager()->BgAppearEffect( |
|
515 |
self->iBgManager, ETrue ); |
|
516 |
} |
|
517 |
} |
|
518 |
} |
|
519 |
} |
|
520 |
||
521 |
self->iAction = ENoAction; |
|
522 |
||
523 |
__PRINTS( "*** CXnViewAdapter::TimerCallback, done" ); |
|
524 |
||
525 |
return KErrNone; |
|
526 |
} |
|
527 |
||
528 |
// ----------------------------------------------------------------------------- |
|
529 |
// CXnViewAdapter::DoDeactivate |
|
530 |
// Deactivates view. |
|
531 |
// ----------------------------------------------------------------------------- |
|
532 |
// |
|
533 |
void CXnViewAdapter::DoDeactivate() |
|
534 |
{ |
|
535 |
if ( iFlags.IsSet( EIsDestructionRunning ) ) |
|
536 |
{ |
|
537 |
return; |
|
538 |
} |
|
539 |
||
540 |
__PRINTS( "*** CXnViewAdapter::DoDeactivate" ); |
|
541 |
__TIME_MARK( time ); |
|
542 |
||
543 |
iAppUiAdapter.RemoveFromStack( iEventDispatcher ); |
|
544 |
||
545 |
TRAP_IGNORE( DeactivateContainerL() ); |
|
546 |
||
547 |
iBgManager->MakeVisible( EFalse ); |
|
548 |
||
549 |
iFocusControl->MakeVisible( EFalse ); |
|
550 |
||
551 |
iFlags.Clear( EIsActivated ); |
|
552 |
||
553 |
__TIME_ENDMARK( "CXnViewAdapter::DoDeactivate, done", time ); |
|
554 |
} |
|
555 |
||
556 |
// ----------------------------------------------------------------------------- |
|
557 |
// CXnViewAdapter::ActivateContainerL |
|
558 |
// Activates container |
|
559 |
// ----------------------------------------------------------------------------- |
|
560 |
// |
|
561 |
void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
562 |
TBool aEnterEditState, TUid aEffect, TBool aUpdateBg ) |
83 | 563 |
{ |
564 |
// Returns if the container remains the same and activation is not forced |
|
565 |
// Otherwise the old container is deactivated and the new is activated |
|
566 |
if ( iFlags.IsSet( EIsDestructionRunning ) || iContainer == &aContainer ) |
|
567 |
{ |
|
568 |
return; |
|
569 |
} |
|
570 |
||
571 |
if ( iFlags.IsClear( EIsActivated ) ) |
|
572 |
{ |
|
573 |
// Some other view than this in this appui is currently active, |
|
574 |
// postpone container activation |
|
575 |
return; |
|
576 |
} |
|
577 |
||
578 |
const CXnViewData& active( iAppUiAdapter.ViewManager().ActiveViewData() ); |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
579 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
580 |
TBool started = EFalse; |
83 | 581 |
CXnEffectManager* mgr( iAppUiAdapter.EffectManager() ); |
582 |
CleanupStack::PushL( TCleanupItem( CleanupEffect, mgr ) ); |
|
583 |
||
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
584 |
if( aEffect != TUid::Null() ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
585 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
586 |
started = mgr->BeginActivateViewEffect( active, aContainer, aEffect ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
587 |
} |
83 | 588 |
|
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
589 |
DeactivateContainerL(); |
83 | 590 |
|
591 |
// Update |
|
592 |
iContainer = &aContainer; |
|
593 |
||
594 |
// Disable layout and redraw until container activation is done |
|
595 |
iAppUiAdapter.UiEngine().DisableRenderUiLC(); |
|
596 |
||
597 |
// Try exit controls from powersave mode |
|
598 |
ChangeControlsStateL( ETrue ); |
|
599 |
||
600 |
if ( !iActivate ) |
|
601 |
{ |
|
602 |
iActivate = BuildActivateTriggerL( iAppUiAdapter.UiEngine() ); |
|
603 |
} |
|
604 |
||
605 |
CXnNode* node( aContainer.Node()->LayoutNode() ); |
|
606 |
||
607 |
CXnDomStringPool* sp( node->DomNode()->StringPool() ); |
|
608 |
||
609 |
CXnProperty* prop = CXnProperty::NewL( |
|
610 |
XnPropertyNames::style::common::KDisplay, |
|
611 |
XnPropertyNames::style::common::display::KBlock, |
|
612 |
CXnDomPropertyValue::EString, *sp ); |
|
613 |
CleanupStack::PushL( prop ); |
|
614 |
||
615 |
node->SetPropertyWithoutNotificationL( prop ); |
|
616 |
CleanupStack::Pop( prop ); |
|
617 |
||
618 |
node->ReportXuikonEventL( *iActivate ); |
|
619 |
||
620 |
if ( iFlags.IsSet( EIsInCall ) ) |
|
621 |
{ |
|
622 |
iFlags.Clear( EIsInCall ); |
|
623 |
||
624 |
// This container is in-call state |
|
625 |
NotifyInCallStateChaged( ETrue ); |
|
626 |
} |
|
627 |
||
628 |
if ( aEnterEditState || iAppUiAdapter.UiEngine().IsEditMode() ) |
|
629 |
{ |
|
630 |
EnterEditStateL( aContainer, ETrue ); |
|
631 |
} |
|
632 |
else |
|
633 |
{ |
|
634 |
EnterEditStateL( aContainer, EFalse ); |
|
635 |
} |
|
636 |
||
637 |
CXnControlAdapter* adapter( node->Control() ); |
|
638 |
adapter->MakeVisible( ETrue ); |
|
639 |
||
640 |
iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer ); |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
641 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
642 |
if( aUpdateBg ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
643 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
644 |
iBgManager->ChangeWallpaper( active, aContainer, !started ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
645 |
} |
83 | 646 |
|
647 |
iAppUiAdapter.UiEngine().RenderUIL(); |
|
648 |
||
649 |
CleanupStack::PopAndDestroy(); // DisableRenderUiLC |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
650 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
651 |
if( aEffect != TUid::Null() ) |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
652 |
{ |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
653 |
mgr->EndActivateViewEffect( active, aContainer, aEffect ); |
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
654 |
} |
83 | 655 |
|
656 |
CleanupStack::PopAndDestroy(); // cleanupitem |
|
657 |
||
658 |
iAppUiAdapter.ViewManager().UpdatePageManagementInformationL(); |
|
659 |
||
660 |
if ( iEventDispatcher ) |
|
661 |
{ |
|
662 |
iEventDispatcher->SetMenuNodeL( |
|
663 |
iAppUiAdapter.UiEngine().MenuBarNode() ); |
|
664 |
} |
|
665 |
} |
|
666 |
||
667 |
// ----------------------------------------------------------------------------- |
|
668 |
// CXnViewAdapter::ActivateDefaultContainerL |
|
669 |
// Activates default container |
|
670 |
// ----------------------------------------------------------------------------- |
|
671 |
// |
|
672 |
void CXnViewAdapter::ActivateDefaultContainerL( TBool aEnterEditState ) |
|
673 |
{ |
|
674 |
CXnRootData& rootData( iAppUiAdapter.ViewManager().ActiveAppData() ); |
|
675 |
||
676 |
RPointerArray< CXnPluginData >& views( rootData.PluginData() ); |
|
677 |
||
678 |
if ( !views.Count() ) |
|
679 |
{ |
|
680 |
return; |
|
681 |
} |
|
682 |
||
683 |
// first view is default |
|
684 |
CXnViewData* viewData = static_cast<CXnViewData*>( views[0] ); |
|
685 |
||
686 |
if ( viewData ) |
|
687 |
{ |
|
688 |
EnterEditStateL( *viewData, aEnterEditState ); |
|
689 |
// Deactivate container even though it hasn't changed to close all |
|
690 |
// popups and other windows |
|
691 |
ActivateContainerL( *viewData, aEnterEditState ); |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
692 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
693 |
CloseAllPopupsL(); |
83 | 694 |
} |
695 |
} |
|
696 |
||
697 |
// ----------------------------------------------------------------------------- |
|
698 |
// CXnViewAdapter::EnterEditStateL |
|
699 |
// Sets edit state property |
|
700 |
// ----------------------------------------------------------------------------- |
|
701 |
// |
|
702 |
void CXnViewAdapter::EnterEditStateL( CXnViewData& aView, TBool aEnter ) |
|
703 |
{ |
|
704 |
if ( !iEditState ) |
|
705 |
{ |
|
706 |
iEditState = BuildEditStateTriggerL( iAppUiAdapter.UiEngine() ); |
|
707 |
} |
|
708 |
||
709 |
CXnProperty* prop( iEditState->GetPropertyL( |
|
710 |
XnPropertyNames::action::KValue ) ); |
|
711 |
||
712 |
if ( !prop ) |
|
713 |
{ |
|
714 |
return; |
|
715 |
} |
|
716 |
||
717 |
if ( aEnter ) |
|
718 |
{ |
|
719 |
static_cast< CXnDomPropertyValue* >( |
|
720 |
prop->Property()->PropertyValueList().Item( 0 ) ) |
|
721 |
->SetStringValueL( CXnDomPropertyValue::EString, |
|
722 |
XnPropertyNames::action::trigger::name::editmode::KEnter() ); |
|
723 |
} |
|
724 |
else |
|
725 |
{ |
|
726 |
static_cast< CXnDomPropertyValue* >( |
|
727 |
prop->Property()->PropertyValueList().Item( 0 ) ) |
|
728 |
->SetStringValueL( CXnDomPropertyValue::EString, |
|
729 |
XnPropertyNames::action::trigger::name::editmode::KExit() ); |
|
730 |
} |
|
731 |
||
732 |
if ( aView.Node() && aView.Node()->LayoutNode() ) |
|
733 |
{ |
|
734 |
aView.Node()->LayoutNode()->ReportXuikonEventL( *iEditState ); |
|
735 |
} |
|
736 |
} |
|
737 |
||
738 |
// ----------------------------------------------------------------------------- |
|
739 |
// CXnViewAdapter::DeactivateContainerL |
|
740 |
// Deactivates current container |
|
741 |
// ----------------------------------------------------------------------------- |
|
742 |
// |
|
743 |
void CXnViewAdapter::DeactivateContainerL( TBool aHide ) |
|
744 |
{ |
|
745 |
if ( !iContainer || iFlags.IsSet( EIsDestructionRunning ) ) |
|
746 |
{ |
|
747 |
return; |
|
748 |
} |
|
749 |
||
750 |
CloseAllPopupsL(); |
|
751 |
||
752 |
// Run controls to powersave mode |
|
753 |
ChangeControlsStateL( EFalse ); |
|
754 |
||
755 |
CXnNode* node( iContainer->Node()->LayoutNode() ); |
|
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
756 |
|
83 | 757 |
if ( !iDeactivate ) |
758 |
{ |
|
759 |
iDeactivate = BuildDeactivateTriggerL( iAppUiAdapter.UiEngine() ); |
|
760 |
} |
|
761 |
||
762 |
node->ReportXuikonEventL( *iDeactivate ); |
|
763 |
||
764 |
if ( aHide ) |
|
765 |
{ |
|
766 |
node->Control()->MakeVisible( EFalse ); |
|
767 |
} |
|
768 |
||
769 |
iContainer = NULL; |
|
770 |
} |
|
771 |
||
772 |
// ----------------------------------------------------------------------------- |
|
773 |
// CXnViewAdapter::NotifyForegroundChanged |
|
774 |
// |
|
775 |
// ----------------------------------------------------------------------------- |
|
776 |
// |
|
777 |
void CXnViewAdapter::NotifyForegroundChanged( |
|
778 |
MXnUiStateObserver::TForegroundStatus aStatus ) |
|
779 |
{ |
|
780 |
if ( aStatus == MXnUiStateObserver::EPartialForeground || |
|
781 |
aStatus == MXnUiStateObserver::EBackground ) |
|
782 |
{ |
|
783 |
iFlags.Clear( EIsForeground ); |
|
784 |
||
785 |
CXnEditMode* editMode = iAppUiAdapter.UiEngine().EditMode(); |
|
786 |
if( editMode ) |
|
787 |
{ |
|
788 |
TRAP_IGNORE( editMode->StopDraggingL() ); |
|
789 |
} |
|
790 |
||
791 |
iFocusControl->MakeVisible( EFalse ); |
|
792 |
||
793 |
TRAP_IGNORE( ChangeControlsStateL( EFalse ) ); |
|
794 |
} |
|
795 |
else |
|
796 |
{ |
|
797 |
iFlags.Set( EIsForeground ); |
|
798 |
||
799 |
TRAP_IGNORE( ChangeControlsStateL( ETrue ) ); |
|
800 |
} |
|
801 |
} |
|
802 |
||
803 |
// ----------------------------------------------------------------------------- |
|
804 |
// CXnViewAdapter::NotifyLightStatusChanged |
|
805 |
// |
|
806 |
// ----------------------------------------------------------------------------- |
|
807 |
// |
|
808 |
void CXnViewAdapter::NotifyLightStatusChanged( TBool aLightsOn ) |
|
809 |
{ |
|
810 |
if ( aLightsOn ) |
|
811 |
{ |
|
812 |
iFlags.Set( EIsLightsOn ); |
|
813 |
||
814 |
TRAP_IGNORE( ChangeControlsStateL( ETrue ) ); |
|
815 |
} |
|
816 |
else |
|
817 |
{ |
|
818 |
iFlags.Clear( EIsLightsOn ); |
|
819 |
||
820 |
TRAP_IGNORE( ChangeControlsStateL( EFalse ) ); |
|
821 |
} |
|
822 |
} |
|
823 |
||
824 |
// ----------------------------------------------------------------------------- |
|
825 |
// CXnViewAdapter::NotifyInCallStateChaged |
|
826 |
// |
|
827 |
// ----------------------------------------------------------------------------- |
|
828 |
// |
|
829 |
void CXnViewAdapter::NotifyInCallStateChaged( TBool aInCall ) |
|
830 |
{ |
|
831 |
if ( !iContainer ) |
|
832 |
{ |
|
833 |
return; |
|
834 |
} |
|
835 |
||
836 |
TBool incallNow( iFlags.IsSet( EIsInCall ) ? ETrue : EFalse ); |
|
837 |
||
838 |
if ( incallNow == aInCall ) |
|
839 |
{ |
|
840 |
return; |
|
841 |
} |
|
842 |
||
843 |
if ( aInCall ) |
|
844 |
{ |
|
845 |
iFlags.Set( EIsInCall ); |
|
846 |
} |
|
847 |
else |
|
848 |
{ |
|
849 |
iFlags.Clear( EIsInCall ); |
|
850 |
} |
|
851 |
||
852 |
CXnViewData& view( iAppUiAdapter.ViewManager().ActiveViewData() ); |
|
853 |
||
854 |
TRAP_IGNORE( UpdateRskByUiStateL( view ) ); |
|
855 |
} |
|
856 |
||
857 |
// ----------------------------------------------------------------------------- |
|
858 |
// CXnViewAdapter::ChangeControlsStateL |
|
859 |
// |
|
860 |
// ----------------------------------------------------------------------------- |
|
861 |
// |
|
862 |
void CXnViewAdapter::ChangeControlsStateL( TBool aAwake ) |
|
863 |
{ |
|
864 |
if ( !iContainer ) |
|
865 |
{ |
|
866 |
return; |
|
867 |
} |
|
868 |
||
869 |
TBool awakeNow( iFlags.IsSet( EIsControlsAwake ) ? ETrue : EFalse ); |
|
870 |
||
871 |
if ( aAwake == awakeNow ) |
|
872 |
{ |
|
873 |
// No change in the state |
|
874 |
return; |
|
875 |
} |
|
876 |
||
877 |
TBool changeState( EFalse ); |
|
878 |
||
879 |
if ( aAwake ) |
|
880 |
{ |
|
881 |
if ( iFlags.IsSet( EIsForeground ) && iFlags.IsSet( EIsLightsOn ) ) |
|
882 |
{ |
|
883 |
iFlags.Set( EIsControlsAwake ); |
|
884 |
changeState = ETrue; |
|
885 |
} |
|
886 |
} |
|
887 |
else |
|
888 |
{ |
|
889 |
iFlags.Clear( EIsControlsAwake ); |
|
890 |
changeState = ETrue; |
|
891 |
} |
|
892 |
||
893 |
if( changeState ) |
|
894 |
{ |
|
895 |
RPointerArray< CXnControlAdapter > controls; |
|
896 |
CleanupClosePushL( controls ); |
|
897 |
||
898 |
iContainer->ControlsL( controls ); |
|
899 |
||
900 |
for ( TInt i = 0; i < controls.Count(); i++ ) |
|
901 |
{ |
|
902 |
if ( aAwake ) |
|
903 |
{ |
|
904 |
controls[i]->ExitPowerSaveModeL(); |
|
905 |
} |
|
906 |
else |
|
907 |
{ |
|
908 |
controls[i]->EnterPowerSaveModeL(); |
|
909 |
if ( controls[i]->LongTapDetector() && |
|
910 |
controls[i]->LongTapDetector()->IsActive() ) |
|
911 |
{ |
|
912 |
controls[i]->LongTapDetector()->Cancel(); |
|
913 |
} |
|
914 |
} |
|
915 |
} |
|
916 |
||
917 |
CleanupStack::PopAndDestroy( &controls ); |
|
918 |
} |
|
919 |
} |
|
920 |
||
921 |
// ----------------------------------------------------------------------------- |
|
922 |
// CXnViewAdapter::UpdateRskByUiStateL() |
|
923 |
// |
|
924 |
// ----------------------------------------------------------------------------- |
|
925 |
// |
|
926 |
void CXnViewAdapter::UpdateRskByUiStateL( const CXnViewData& aViewData ) |
|
927 |
{ |
|
928 |
CXnNode* menubar( NULL ); |
|
929 |
||
930 |
CXnDomNode* view( aViewData.Node() ); |
|
931 |
||
932 |
if ( view && view->LayoutNode() ) |
|
933 |
{ |
|
934 |
RPointerArray< CXnNode >& children( view->LayoutNode()->Children() ); |
|
935 |
||
936 |
for ( TInt count = children.Count() - 1; count >= 0 ; --count ) |
|
937 |
{ |
|
938 |
CXnNode* node( children[count] ); |
|
939 |
||
940 |
// Check that the given type of a control is parent |
|
941 |
// (or ancestor) of this control |
|
942 |
const TDesC8& type( node->Type()->Type() ); |
|
943 |
||
944 |
if ( type == KMenuBar ) |
|
945 |
{ |
|
946 |
menubar = node; |
|
947 |
break; |
|
948 |
} |
|
949 |
} |
|
950 |
} |
|
951 |
||
952 |
if( menubar ) |
|
953 |
{ |
|
954 |
const TDesC8* state( NULL ); |
|
955 |
||
956 |
if( iAppUiAdapter.UiEngine().IsEditMode() ) |
|
957 |
{ |
|
958 |
state = &XnPropertyNames::softkey::mode::KModeEdit; |
|
959 |
} |
|
960 |
else if( iFlags.IsSet( EIsInCall ) ) |
|
961 |
{ |
|
962 |
state = &XnPropertyNames::softkey::mode::KModeCallActive; |
|
963 |
} |
|
964 |
else |
|
965 |
{ |
|
966 |
state = &XnPropertyNames::softkey::mode::KModeCallInactive; |
|
967 |
} |
|
968 |
||
969 |
XnMenuInterface::MXnMenuInterface* menuIf( NULL ); |
|
970 |
XnComponentInterface::MakeInterfaceL( menuIf, menubar->AppIfL() ); |
|
971 |
||
972 |
RPointerArray<CXnNode>& childrens( menubar->Children() ); |
|
973 |
||
974 |
for( TInt i=0; i < childrens.Count(); i++ ) |
|
975 |
{ |
|
976 |
CXnNode* node = childrens[i]; |
|
977 |
||
978 |
if( node && node->Type()->Type() == XnPropertyNames::softkey::KNodeName ) |
|
979 |
{ |
|
980 |
CXnProperty* mode = node->GetPropertyL( XnPropertyNames::softkey::KModeAttribute ); |
|
981 |
CXnProperty* type = node->GetPropertyL( XnPropertyNames::softkey::KTypeAttribute ); |
|
982 |
||
983 |
if( ( mode && *state == mode->StringValue() ) && |
|
984 |
( type && type->StringValue().Compare( XnPropertyNames::softkey::type::KRight ) == 0 ) ) |
|
985 |
{ |
|
986 |
menuIf->SetSoftKeyL( &node->PluginIfL() , XnMenuInterface::MXnMenuInterface::ERight ); |
|
987 |
node->SetDirtyL( XnDirtyLevel::ERender ); |
|
988 |
||
989 |
TRAP_IGNORE( iAppUiAdapter.UiEngine().RefreshMenuL() ); |
|
990 |
} |
|
991 |
} |
|
992 |
} |
|
993 |
} |
|
994 |
} |
|
995 |
||
996 |
// ----------------------------------------------------------------------------- |
|
997 |
// CXnViewAdapter::CloseAllPopupsL() |
|
998 |
// |
|
999 |
// ----------------------------------------------------------------------------- |
|
1000 |
// |
|
1001 |
void CXnViewAdapter::CloseAllPopupsL() |
|
1002 |
{ |
|
1003 |
if ( !iContainer ) |
|
1004 |
{ |
|
1005 |
return; |
|
1006 |
} |
|
1007 |
||
1008 |
RPointerArray< CXnNode > popups; |
|
1009 |
CleanupClosePushL( popups ); |
|
1010 |
||
1011 |
iContainer->PopupNodesL( popups ); |
|
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1012 |
|
83 | 1013 |
for ( TInt i = 0; i < popups.Count(); i++ ) |
1014 |
{ |
|
1015 |
CXnProperty* display = CXnProperty::NewL( |
|
1016 |
XnPropertyNames::style::common::KDisplay, |
|
1017 |
XnPropertyNames::style::common::display::KNone, |
|
1018 |
CXnDomPropertyValue::EString, |
|
1019 |
*iAppUiAdapter.UiEngine().ODT()->DomDocument().StringPool() ); |
|
1020 |
||
1021 |
CleanupStack::PushL( display ); |
|
1022 |
popups[i]->SetPropertyL(display); |
|
1023 |
CleanupStack::Pop( display ); |
|
1024 |
} |
|
1025 |
||
1026 |
CleanupStack::PopAndDestroy( &popups ); |
|
88
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
1027 |
|
3321d3e205b6
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
83
diff
changeset
|
1028 |
iEventDispatcher->SetTextEditorActive( NULL, EFalse ); |
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1029 |
|
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1030 |
CXnNode* popup( iAppUiAdapter.UiEngine().StylusPopupNode() ); |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1031 |
if ( popup ) |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1032 |
{ |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1033 |
CXnPopupControlAdapter* control = |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1034 |
static_cast< CXnPopupControlAdapter* >( |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1035 |
popup->Control() ); |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1036 |
|
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1037 |
if ( control ) |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1038 |
{ |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1039 |
control->HideMenuL(); |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1040 |
} |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1041 |
} |
83 | 1042 |
} |
1043 |
||
93
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1044 |
TBool CXnViewAdapter::IsForegroundAdapter() const |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1045 |
{ |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1046 |
return ( iContainer != NULL ); |
b01126ce0bec
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
88
diff
changeset
|
1047 |
} |
83 | 1048 |
|
1049 |
// End of file |