36 #include "hscontentcontrolfactory.h" |
36 #include "hscontentcontrolfactory.h" |
37 #include "xneditor.h" |
37 #include "xneditor.h" |
38 #include "xnwallpaperview.h" |
38 #include "xnwallpaperview.h" |
39 #include "xneffectmanager.h" |
39 #include "xneffectmanager.h" |
40 #include "xnwaitdialog.h" |
40 #include "xnwaitdialog.h" |
|
41 #include "xnitemactivator.h" |
41 |
42 |
42 #include "xnappuiadapterimpl.h" |
43 #include "xnappuiadapterimpl.h" |
43 |
44 |
44 #include "debug.h" |
45 #include "debug.h" |
45 |
46 |
121 |
122 |
122 // wallpaper view is owned by CAknViewAppUi |
123 // wallpaper view is owned by CAknViewAppUi |
123 iAdapter.AddViewL( wallpaper ); |
124 iAdapter.AddViewL( wallpaper ); |
124 CleanupStack::Pop( wallpaper ); |
125 CleanupStack::Pop( wallpaper ); |
125 |
126 |
126 iEffectManager = CXnEffectManager::NewL(); |
127 iEffectManager = CXnEffectManager::NewL( iAdapter ); |
127 |
128 |
128 iBackupRestoreObserver = CXnPropertySubscriber::NewL( |
129 iBackupRestoreObserver = CXnPropertySubscriber::NewL( |
129 KUidSystemCategory, conn::KUidBackupRestoreKey, *this ); |
130 KUidSystemCategory, conn::KUidBackupRestoreKey, *this ); |
130 |
131 |
|
132 iActivator = CXnItemActivator::NewL( iAdapter ); |
|
133 |
131 __TIME_ENDMARK( "CXnAppUiAdapterImpl::ConstructL, done", time ); |
134 __TIME_ENDMARK( "CXnAppUiAdapterImpl::ConstructL, done", time ); |
132 } |
135 } |
133 |
136 |
134 // ----------------------------------------------------------------------------- |
137 // ----------------------------------------------------------------------------- |
135 // CXnAppUiAdapterImpl::ReloadUiL |
138 // CXnAppUiAdapterImpl::ReloadUiL |
139 void CXnAppUiAdapterImpl::ReloadUiL() |
142 void CXnAppUiAdapterImpl::ReloadUiL() |
140 { |
143 { |
141 __PRINTS( "*** CXnAppUiAdapterImpl::ReloadUiL" ); |
144 __PRINTS( "*** CXnAppUiAdapterImpl::ReloadUiL" ); |
142 __TIME_MARK( time ); |
145 __TIME_MARK( time ); |
143 |
146 |
|
147 delete iActivator; |
|
148 iActivator = NULL; |
|
149 |
144 iViewAdapter->ReloadUiL(); |
150 iViewAdapter->ReloadUiL(); |
145 |
151 |
146 iViewManager->ReloadUiL(); |
152 iViewManager->ReloadUiL(); |
147 |
153 |
|
154 iActivator = CXnItemActivator::NewL( iAdapter ); |
|
155 |
148 __TIME_ENDMARK( "CXnAppUiAdapterImpl::ReloadUiL, done", time ); |
156 __TIME_ENDMARK( "CXnAppUiAdapterImpl::ReloadUiL, done", time ); |
149 } |
157 } |
150 |
158 |
151 // ----------------------------------------------------------------------------- |
159 // ----------------------------------------------------------------------------- |
152 // Destructor |
160 // Destructor |
153 // |
161 // |
154 // ----------------------------------------------------------------------------- |
162 // ----------------------------------------------------------------------------- |
155 // |
163 // |
156 CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl() |
164 CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl() |
157 { |
165 { |
158 if ( iXnWaitDialog ) |
166 if ( iBURWaitDialog ) |
159 { |
167 { |
160 TRAP_IGNORE( iXnWaitDialog->ProcessFinishedL(); ); |
168 TRAP_IGNORE( iBURWaitDialog->ProcessFinishedL(); ); |
161 } |
169 } |
|
170 |
|
171 delete iActivator; |
162 |
172 |
163 delete iBackupRestoreObserver; |
173 delete iBackupRestoreObserver; |
164 |
174 |
165 delete iUiEngine; |
175 delete iUiEngine; |
166 |
176 |
259 { |
269 { |
260 return iCcProviderClient; |
270 return iCcProviderClient; |
261 } |
271 } |
262 |
272 |
263 // ----------------------------------------------------------------------------- |
273 // ----------------------------------------------------------------------------- |
|
274 // CXnAppUiAdapterImpl::ItemActivator |
|
275 // Gets Item activator |
|
276 // ----------------------------------------------------------------------------- |
|
277 // |
|
278 CXnItemActivator& CXnAppUiAdapterImpl::ItemActivator() const |
|
279 { |
|
280 return *iActivator; |
|
281 } |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
264 // CXnAppUiAdapterImpl::HandleResourceChangeL |
284 // CXnAppUiAdapterImpl::HandleResourceChangeL |
265 // Handles resource changes |
285 // Handles resource changes |
266 // ----------------------------------------------------------------------------- |
286 // ----------------------------------------------------------------------------- |
267 // |
287 // |
268 void CXnAppUiAdapterImpl::HandleResourceChangeL( TInt aType ) |
288 void CXnAppUiAdapterImpl::HandleResourceChangeL( TInt aType ) |
275 // Displays wait dialog during backup/restore. |
295 // Displays wait dialog during backup/restore. |
276 // ----------------------------------------------------------------------------- |
296 // ----------------------------------------------------------------------------- |
277 // |
297 // |
278 void CXnAppUiAdapterImpl::DisplayWaitDialogL() |
298 void CXnAppUiAdapterImpl::DisplayWaitDialogL() |
279 { |
299 { |
280 if ( !iXnWaitDialog ) |
300 if ( !iBURWaitDialog ) |
281 { |
301 { |
282 iXnWaitDialog = new( ELeave ) CXnWaitDialog( |
302 iBURWaitDialog = new( ELeave ) CXnWaitDialog( |
283 reinterpret_cast<CEikDialog**>( &iXnWaitDialog ), ETrue ); |
303 reinterpret_cast<CEikDialog**>( &iBURWaitDialog ), ETrue ); |
284 iXnWaitDialog->SetCallback( this ); |
304 iBURWaitDialog->SetCallback( this ); |
285 iXnWaitDialog->ExecuteLD( R_BACKUP_RESTORE_WAIT_DIALOG ); |
305 iBURWaitDialog->ExecuteLD( R_BACKUP_RESTORE_WAIT_DIALOG ); |
286 } |
306 } |
287 } |
307 } |
288 |
308 |
289 // ----------------------------------------------------------------------------- |
309 // ----------------------------------------------------------------------------- |
290 // CXnAppUiAdapterImpl::BackupRestoreEvent |
310 // CXnAppUiAdapterImpl::BackupRestoreEvent |
291 // Property changed notification callback |
311 // Property changed notification callback |
292 // ----------------------------------------------------------------------------- |
312 // ----------------------------------------------------------------------------- |
293 // |
313 // |
294 void CXnAppUiAdapterImpl::PropertyChangedL( const TUint32 aKey, const TInt aValue ) |
314 void CXnAppUiAdapterImpl::PropertyChangedL( const TUint32 aKey, |
|
315 const TInt aValue ) |
295 { |
316 { |
296 const TUint mask( conn::KBURPartTypeMask ^ conn::EBURNormal ); |
317 const TUint mask( conn::KBURPartTypeMask ^ conn::EBURNormal ); |
297 if ( aKey == conn::KUidBackupRestoreKey ) |
318 if ( aKey == conn::KUidBackupRestoreKey ) |
298 { |
319 { |
299 if ( aValue & mask ) |
320 if ( aValue & mask ) |
300 { |
321 { |
301 // Any type of backup or restore operation started |
322 // Any type of backup or restore operation started |
302 DisplayWaitDialogL(); |
323 DisplayWaitDialogL(); |
303 } |
324 } |
304 else if ( iXnWaitDialog ) |
325 else if ( iBURWaitDialog ) |
305 { |
326 { |
306 // Any type of backup or restore operation ended |
327 // Any type of backup or restore operation ended |
307 iXnWaitDialog->ProcessFinishedL(); |
328 iBURWaitDialog->ProcessFinishedL(); |
308 // ProcessFinishedL() will NULL iXnWaitDialog |
329 // ProcessFinishedL() will NULL iBURWaitDialog |
309 } |
330 } |
310 } |
331 } |
311 } |
332 } |
312 |
333 |
313 // ---------------------------------------------------------------------------- |
334 // ---------------------------------------------------------------------------- |