41 #include <calencommands.hrh> |
41 #include <calencommands.hrh> |
42 #include <calenservices.h> |
42 #include <calenservices.h> |
43 #include <calsession.h> |
43 #include <calsession.h> |
44 #include <calenviewutils.h> |
44 #include <calenviewutils.h> |
45 #include <calcalendarinfo.h> |
45 #include <calcalendarinfo.h> |
|
46 #include <caleninstanceid.h> // TCalenInstanceId |
|
47 |
46 |
48 |
47 #include "calendarui_debug.h" // Debug. |
49 #include "calendarui_debug.h" // Debug. |
48 #include "CalendarVariant.hrh" |
50 #include "CalendarVariant.hrh" |
49 #include "calennativeview.h" |
51 #include "calennativeview.h" |
50 #include "calencontainer.h" |
52 #include "calencontainer.h" |
506 { |
516 { |
507 aMenuBar->StopDisplayingMenuBar(); |
517 aMenuBar->StopDisplayingMenuBar(); |
508 } |
518 } |
509 |
519 |
510 TRACE_EXIT_POINT; |
520 TRACE_EXIT_POINT; |
|
521 } |
|
522 |
|
523 // ---------------------------------------------------------------------------- |
|
524 // CCalenNativeView::CopytoCalendarsL |
|
525 // From CAknView |
|
526 // Return the UID of the day view |
|
527 // (other items were commented in a header) |
|
528 // ---------------------------------------------------------------------------- |
|
529 // |
|
530 void CCalenNativeView::CopyToCalendarsL() |
|
531 { |
|
532 TRACE_ENTRY_POINT; |
|
533 |
|
534 iAsyncCallback->CallBack(); |
|
535 |
|
536 TRACE_EXIT_POINT; |
|
537 } |
|
538 |
|
539 // ---------------------------------------------------------------------------- |
|
540 // CCalenNativeView::AsyncCopyToCalendarsL |
|
541 // From CAknView |
|
542 // Return the UID of the day view |
|
543 // (other items were commented in a header) |
|
544 // ---------------------------------------------------------------------------- |
|
545 // |
|
546 TInt CCalenNativeView::AsyncCopyToCalendarsL( TAny* aThisPtr ) |
|
547 { |
|
548 TRACE_ENTRY_POINT; |
|
549 |
|
550 static_cast<CCalenNativeView*>(aThisPtr)->CopyEntryToCalendarsL(); |
|
551 |
|
552 TRACE_EXIT_POINT; |
|
553 return 0; |
|
554 |
|
555 } |
|
556 |
|
557 // ---------------------------------------------------------------------------- |
|
558 // CCalenNativeView::CopyEntryToCalendarsL |
|
559 // From CAknView |
|
560 // Return the UID of the day view |
|
561 // (other items were commented in a header) |
|
562 // ---------------------------------------------------------------------------- |
|
563 // |
|
564 void CCalenNativeView::CopyEntryToCalendarsL() |
|
565 { |
|
566 TRACE_ENTRY_POINT; |
|
567 |
|
568 // Create settings own titlepane and navipane, and swap with existing ones |
|
569 CEikStatusPane* sp = CEikonEnv::Static()->AppUiFactory()->StatusPane(); |
|
570 |
|
571 // Hide the toolbar before we display settings menu |
|
572 MCalenToolbar* toolbar = iServices.ToolbarOrNull(); |
|
573 if(toolbar) |
|
574 { |
|
575 toolbar->SetToolbarVisibilityL(EFalse); |
|
576 } |
|
577 iSPUtils->UnderLineTitleText( EFalse ); |
|
578 |
|
579 // Titlepane |
|
580 CAknTitlePane* newtp = new( ELeave ) CAknTitlePane(); |
|
581 CleanupStack::PushL( newtp ); |
|
582 CCoeControl* oldtp = sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), newtp ); |
|
583 CleanupStack::Pop( newtp ); // ownership is passed to statuspane |
|
584 TRect oldRect( 0, 0, 0, 0 ); |
|
585 if( oldtp ) |
|
586 { |
|
587 CleanupStack::PushL( oldtp ); |
|
588 oldRect = oldtp->Rect(); |
|
589 CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidTitle )); |
|
590 newtp->SetContainerWindowL( *ctrl ); |
|
591 newtp->ConstructL(); |
|
592 newtp->SetRect(oldRect); |
|
593 newtp->ActivateL(); |
|
594 } |
|
595 |
|
596 // NaviPane |
|
597 CAknNavigationControlContainer* newnp = new( ELeave )CAknNavigationControlContainer(); |
|
598 CleanupStack::PushL( newnp ); |
|
599 CCoeControl* oldnp = sp->SwapControlL( TUid::Uid( EEikStatusPaneUidNavi ), newnp ); |
|
600 CleanupStack::Pop( newnp ); // ownership is passed to statuspane |
|
601 if( oldnp ) |
|
602 { |
|
603 CleanupStack::PushL( oldnp ); |
|
604 oldRect = oldnp->Rect(); |
|
605 CCoeControl* ctrl = sp->ContainerControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
606 newnp->SetContainerWindowL( *ctrl ); |
|
607 newnp->ConstructL(); |
|
608 newnp->SetRect( oldRect ); |
|
609 newnp->PushDefaultL(); |
|
610 newnp->ActivateL(); |
|
611 } |
|
612 |
|
613 MCalenContext& context = iServices.Context(); |
|
614 TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid; |
|
615 |
|
616 CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId); |
|
617 CleanupStack::PushL(entry); |
|
618 |
|
619 RPointerArray<CCalEntry> calentryArray; |
|
620 calentryArray.Append( entry ); |
|
621 |
|
622 // Launch the Calendar List Dialiog. |
|
623 CMultiCalUiDialog* calenDbListDialog = CMultiCalUiDialog::NewLC(calentryArray, EFalse); |
|
624 TInt err = KErrNone; |
|
625 // Execute. |
|
626 TRAP( err,calenDbListDialog->LaunchL() ); |
|
627 CleanupStack::PopAndDestroy( calenDbListDialog ); |
|
628 |
|
629 iSPUtils->UnderLineTitleText( EFalse ); |
|
630 // Unhide the toolbar when settings is closed |
|
631 if(toolbar) |
|
632 { |
|
633 toolbar->SetToolbarVisibilityL(ETrue); |
|
634 } |
|
635 |
|
636 CleanupStack::Pop(entry); |
|
637 calentryArray.ResetAndDestroy(); |
|
638 |
|
639 // When setting is closed, swap back old titlepane and navipane |
|
640 if( oldnp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidNavi), oldnp ) ) |
|
641 { |
|
642 CleanupStack::Pop( oldnp ); |
|
643 delete newnp; |
|
644 oldnp->ActivateL(); |
|
645 } |
|
646 |
|
647 if( oldtp && sp->SwapControlL( TUid::Uid(EEikStatusPaneUidTitle), oldtp ) ) |
|
648 { |
|
649 CleanupStack::Pop( oldtp ); |
|
650 delete newtp; |
|
651 oldtp->ActivateL(); |
|
652 } |
|
653 |
|
654 BeginRepopulationL(); |
|
655 |
|
656 TRACE_EXIT_POINT; |
|
657 |
511 } |
658 } |
512 |
659 |
513 // ---------------------------------------------------------------------------- |
660 // ---------------------------------------------------------------------------- |
514 // C++ constructor can NOT contain any code, that |
661 // C++ constructor can NOT contain any code, that |
515 // might leave. |
662 // might leave. |