31 #include <StringLoader.h> |
31 #include <StringLoader.h> |
32 #include <CalenInterimUtils2.h> |
32 #include <CalenInterimUtils2.h> |
33 #include <calentry.h> |
33 #include <calentry.h> |
34 #include <bautils.h> |
34 #include <bautils.h> |
35 #include <data_caging_path_literals.hrh> |
35 #include <data_caging_path_literals.hrh> |
|
36 #include <aknnavide.h> |
|
37 #include <akntitle.h> |
36 |
38 |
37 // User inlcudes. |
39 // User inlcudes. |
38 #include "calenaiwprovider.h" |
40 #include "calenaiwprovider.h" |
39 #include "multicaluidialog.h" |
41 #include "multicaluidialog.h" |
40 #include "calendarui_debug.h" |
42 #include "calendarui_debug.h" |
423 { |
425 { |
424 errVal = KErrDiskFull ; |
426 errVal = KErrDiskFull ; |
425 User::LeaveIfError( errVal ); |
427 User::LeaveIfError( errVal ); |
426 } |
428 } |
427 // Handle the command here. |
429 // Handle the command here. |
|
430 |
|
431 // Create settings own titlepane and navipane, and swap with existing ones |
|
432 CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
433 |
|
434 // Titlepane |
|
435 CAknTitlePane* newtp = new( ELeave ) CAknTitlePane(); |
|
436 CleanupStack::PushL( newtp ); |
|
437 CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp ); |
|
438 CleanupStack::Pop( newtp ); // ownership is passed to statuspane |
|
439 TRect oldRect( 0, 0, 0, 0 ); |
|
440 if( oldtp ) |
|
441 { |
|
442 CleanupStack::PushL( oldtp ); |
|
443 oldRect = oldtp->Rect(); |
|
444 CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle )); |
|
445 newtp->SetContainerWindowL( *ctrl ); |
|
446 newtp->ConstructL(); |
|
447 newtp->SetRect(oldRect); |
|
448 newtp->ActivateL(); |
|
449 } |
|
450 |
|
451 // NaviPane |
|
452 CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer(); |
|
453 CleanupStack::PushL( newnp ); |
|
454 CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp ); |
|
455 CleanupStack::Pop( newnp ); // ownership is passed to statuspane |
|
456 if( oldnp ) |
|
457 { |
|
458 CleanupStack::PushL( oldnp ); |
|
459 oldRect = oldnp->Rect(); |
|
460 CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
461 newnp->SetContainerWindowL( *ctrl ); |
|
462 newnp->ConstructL(); |
|
463 newnp->SetRect( oldRect ); |
|
464 newnp->PushDefaultL(); |
|
465 newnp->ActivateL(); |
|
466 } |
428 |
467 |
429 CMultiCalUiDialog* multiCalUiDialog = CMultiCalUiDialog::NewLC( iCalEntryArray ); |
468 CMultiCalUiDialog* multiCalUiDialog = CMultiCalUiDialog::NewLC( iCalEntryArray ); |
430 errVal = multiCalUiDialog->LaunchL(); |
469 errVal = multiCalUiDialog->LaunchL(); |
431 CleanupStack::PopAndDestroy( multiCalUiDialog ); |
470 CleanupStack::PopAndDestroy( multiCalUiDialog ); |
|
471 |
|
472 |
|
473 // When setting is closed, swap back old titlepane and navipane |
|
474 if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) ) |
|
475 { |
|
476 CleanupStack::Pop( oldnp ); |
|
477 delete newnp; |
|
478 oldnp->ActivateL(); |
|
479 } |
|
480 |
|
481 if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) ) |
|
482 { |
|
483 CleanupStack::Pop( oldtp ); |
|
484 delete newtp; |
|
485 oldtp->ActivateL(); |
|
486 } |
432 |
487 |
433 return errVal; |
488 return errVal; |
434 |
489 |
435 TRACE_EXIT_POINT |
490 TRACE_EXIT_POINT |
436 } |
491 } |