16 */ |
16 */ |
17 |
17 |
18 // System includes |
18 // System includes |
19 #include <aknview.h> |
19 #include <aknview.h> |
20 #include <akntoolbar.h> |
20 #include <akntoolbar.h> |
|
21 #include <avkon.rsg> |
21 |
22 |
22 // User includes |
23 // User includes |
23 #include "xnappuiadapter.h" |
24 #include "xnappuiadapter.h" |
24 #include "xnappuiadapterimpl.h" |
25 #include "xnappuiadapterimpl.h" |
25 #include "xnviewadapter.h" |
26 #include "xnviewadapter.h" |
26 #include "xnuiengineappif.h" |
27 #include "xnuiengineappif.h" |
27 #include "xnfocuscontrol.h" |
28 #include "xnfocuscontrol.h" |
|
29 #include "hscontentcontrolfactory.h" |
|
30 #include "xnviewadapter.h" |
28 |
31 |
29 #include "xuikon_builds_cfg.hrh" |
32 #include "xuikon_builds_cfg.hrh" |
30 |
33 #include "debug.h" |
31 #ifdef _XN_PERFORMANCE_TEST_ |
34 |
32 #include "xntimemon.h" |
35 _LIT8( KActivateDefaultView, "activatedefault" ); |
33 #endif |
|
34 |
36 |
35 // ============================ MEMBER FUNCTIONS =============================== |
37 // ============================ MEMBER FUNCTIONS =============================== |
36 |
38 |
37 // ----------------------------------------------------------------------------- |
39 // ----------------------------------------------------------------------------- |
38 // CXnAppUiAdapter::CXnAppUiAdapter |
40 // CXnAppUiAdapter::CXnAppUiAdapter |
50 // Second-phase constructor |
52 // Second-phase constructor |
51 // ----------------------------------------------------------------------------- |
53 // ----------------------------------------------------------------------------- |
52 // |
54 // |
53 EXPORT_C void CXnAppUiAdapter::ConstructL() |
55 EXPORT_C void CXnAppUiAdapter::ConstructL() |
54 { |
56 { |
55 #ifdef _XN_PERFORMANCE_TEST_ |
57 __TICK( "CXnAppUiAdapter::ConstructL" ); |
56 TInt start( 0 ); |
58 __TIME_MARK( time ); |
57 TInt end( 0 ); |
59 |
58 TInt diff( 0 ); |
60 __PRINTS( "*** CXnAppUiAdapter::ConstructL - BaseConstructL" ); |
59 CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL(): - Calling CAknViewAppUi::BaseConstructL().." ) ); |
61 __TIME_MARK( time2 ); |
60 User::AllocSize( start ); |
62 |
61 #endif //_XN_PERFORMANCE_TEST_ |
63 EnableLocalScreenClearer( EFalse ); |
62 |
64 |
63 CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); |
65 CAknViewAppUi::BaseConstructL( EAknEnableSkin | EAknEnableMSK | EAknSingleClickCompatible ); |
64 |
66 |
65 CAknToolbar* toolbar( CurrentFixedToolbar() ); |
67 CAknToolbar* toolbar( CurrentFixedToolbar() ); |
66 |
68 |
67 if ( toolbar ) |
69 if ( toolbar ) |
68 { |
70 { |
69 toolbar->SetToolbarVisibility( EFalse ); |
71 toolbar->SetToolbarVisibility( EFalse ); |
70 |
72 |
71 toolbar->DisableToolbarL( ETrue ); |
73 toolbar->DisableToolbarL( ETrue ); |
72 } |
74 } |
73 |
75 |
74 #ifdef _XN_PERFORMANCE_TEST_ |
76 __TIME_ENDMARK( "CXnAppUiAdapter::ConstructL - BaseConstructL, done", time2 ); |
75 User::AllocSize( end ); |
|
76 diff = end - start; |
|
77 RDebug::Print( _L( "CAknViewAppUi::BaseConstructL allocation: %d" ), diff ); |
|
78 CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL(): - Calling CXnAppUiAdapterImpl::NewL().." ) ); |
|
79 User::AllocSize( start ); |
|
80 #endif //_XN_PERFORMANCE_TEST_ |
|
81 |
77 |
82 iImpl = CXnAppUiAdapterImpl::NewL( iApplicationUid, *this ); |
78 iImpl = CXnAppUiAdapterImpl::NewL( iApplicationUid, *this ); |
83 iImpl->ConstructL(); |
79 iImpl->ConstructL(); |
84 |
80 |
85 #ifdef _XN_PERFORMANCE_TEST_ |
81 __TIME_ENDMARK( "CXnAppUiAdapter::ConstructL, done", time ); |
86 User::AllocSize( end ); |
|
87 diff = end-start; |
|
88 RDebug::Print( _L( "Xuikon launch allocation: %d" ), diff ); |
|
89 |
|
90 CXnTimeMon::PrintUserMem( _L( "CXnAppUiAdapter::ConstructL() .. all done." ) ); |
|
91 #endif //_XN_PERFORMANCE_TEST_ |
|
92 } |
82 } |
93 |
83 |
94 // ----------------------------------------------------------------------------- |
84 // ----------------------------------------------------------------------------- |
95 // Destructor |
85 // Destructor |
96 // |
86 // |
97 // ----------------------------------------------------------------------------- |
87 // ----------------------------------------------------------------------------- |
98 // |
88 // |
99 EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter() |
89 EXPORT_C CXnAppUiAdapter::~CXnAppUiAdapter() |
100 { |
90 { |
101 iExitingApp = ETrue; |
|
102 delete iUiEngineAppIf; |
91 delete iUiEngineAppIf; |
103 |
92 |
104 delete iImpl; |
93 delete iImpl; |
105 } |
94 } |
106 |
95 |
109 // Handles resource changes |
98 // Handles resource changes |
110 // ----------------------------------------------------------------------------- |
99 // ----------------------------------------------------------------------------- |
111 // |
100 // |
112 EXPORT_C void CXnAppUiAdapter::HandleResourceChangeL( TInt aType ) |
101 EXPORT_C void CXnAppUiAdapter::HandleResourceChangeL( TInt aType ) |
113 { |
102 { |
114 #ifdef _XN_PERFORMANCE_TEST_ |
103 __PRINTS( "*** CXnAppUiAdapter::HandleResourceChangeL" ); |
115 RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - start" ) ); |
104 __TIME_MARK( time ); |
116 #endif //_XN_PERFORMANCE_TEST_ |
|
117 |
105 |
118 CAknViewAppUi::HandleResourceChangeL( aType ); |
106 CAknViewAppUi::HandleResourceChangeL( aType ); |
119 |
107 |
120 if ( iImpl ) |
108 if ( iImpl ) |
121 { |
109 { |
122 iImpl->HandleResourceChangeL( aType ); |
110 iImpl->HandleResourceChangeL( aType ); |
123 } |
111 } |
124 |
112 |
125 #ifdef _XN_PERFORMANCE_TEST_ |
113 __TIME_ENDMARK( "CXnAppUiAdapter::HandleResourceChangeL, done", time ); |
126 RDebug::Print( _L( "CXnAppUiAdapter::HandleResourceChangeL - end" ) ); |
|
127 #endif //_XN_PERFORMANCE_TEST_ |
|
128 } |
114 } |
129 |
115 |
130 // ----------------------------------------------------------------------------- |
116 // ----------------------------------------------------------------------------- |
131 // CXnAppUiAdapter::UiEngine |
117 // CXnAppUiAdapter::UiEngine |
132 // Get UI engine proxy |
118 // Get UI engine proxy |
279 // ----------------------------------------------------------------------------- |
265 // ----------------------------------------------------------------------------- |
280 // |
266 // |
281 EXPORT_C void CXnAppUiAdapter::PrepareToExit() |
267 EXPORT_C void CXnAppUiAdapter::PrepareToExit() |
282 { |
268 { |
283 iExitingApp = ETrue; |
269 iExitingApp = ETrue; |
284 delete iUiEngineAppIf; |
270 |
285 iUiEngineAppIf = NULL; |
271 if ( iImpl ) |
286 delete iImpl; |
272 { |
287 iImpl = NULL; |
273 iImpl->UiStateListener().PrepareToExit(); |
|
274 |
|
275 iImpl->ViewAdapter().PrepareToExit(); |
|
276 |
|
277 iImpl->HsContentControlFactory()->PrepareToExit(); |
|
278 } |
|
279 |
288 CAknViewAppUi::PrepareToExit(); |
280 CAknViewAppUi::PrepareToExit(); |
|
281 } |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
|
284 // CXnAppUiAdapter::UiActivated |
|
285 // |
|
286 // ----------------------------------------------------------------------------- |
|
287 // |
|
288 EXPORT_C void CXnAppUiAdapter::UiActivated() |
|
289 { |
|
290 // Default empty implementation |
|
291 } |
|
292 |
|
293 // ----------------------------------------------------------------------------- |
|
294 // CXnAppUiAdapter::ProcessMessageL |
|
295 // |
|
296 // ----------------------------------------------------------------------------- |
|
297 // |
|
298 EXPORT_C void CXnAppUiAdapter::ProcessMessageL( TUid aUid, |
|
299 const TDesC8& /*aParams*/ ) |
|
300 { |
|
301 if ( aUid.iUid == KUidApaMessageSwitchOpenFileValue ) |
|
302 { |
|
303 // activate default homescreen view. |
|
304 // customcontrol is set so that window group order is not changed |
|
305 SetCustomControl( 1 ); |
|
306 TRAP_IGNORE( ActivateLocalViewL( |
|
307 View().Id(), TUid::Null(), KActivateDefaultView() ) ); |
|
308 SetCustomControl( 0 ); |
|
309 } |
289 } |
310 } |
290 |
311 |
291 // ----------------------------------------------------------------------------- |
312 // ----------------------------------------------------------------------------- |
292 // CXnAppUiAdapter::ReloadUiL |
313 // CXnAppUiAdapter::ReloadUiL |
293 // |
314 // |