equal
deleted
inserted
replaced
46 #include "xnviewadapter.h" |
46 #include "xnviewadapter.h" |
47 #include "xnmenu.h" |
47 #include "xnmenu.h" |
48 #include "xneditmode.h" |
48 #include "xneditmode.h" |
49 #include "xnrootdata.h" |
49 #include "xnrootdata.h" |
50 |
50 |
51 #include "xnpopupcontroladapter.h" |
|
52 |
|
53 #include "debug.h" |
51 #include "debug.h" |
54 |
52 |
55 // Constants |
53 // Constants |
56 const TUid KXmlViewUid = { 1 }; |
54 const TUid KXmlViewUid = { 1 }; |
57 |
55 |
557 // CXnViewAdapter::ActivateContainerL |
555 // CXnViewAdapter::ActivateContainerL |
558 // Activates container |
556 // Activates container |
559 // ----------------------------------------------------------------------------- |
557 // ----------------------------------------------------------------------------- |
560 // |
558 // |
561 void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, |
559 void CXnViewAdapter::ActivateContainerL( CXnViewData& aContainer, |
562 TBool aEnterEditState, TUid aEffect, TBool aUpdateBg ) |
560 TBool aEnterEditState, TUid aEffect ) |
563 { |
561 { |
564 // Returns if the container remains the same and activation is not forced |
562 // Returns if the container remains the same and activation is not forced |
565 // Otherwise the old container is deactivated and the new is activated |
563 // Otherwise the old container is deactivated and the new is activated |
566 if ( iFlags.IsSet( EIsDestructionRunning ) || iContainer == &aContainer ) |
564 if ( iFlags.IsSet( EIsDestructionRunning ) || iContainer == &aContainer ) |
567 { |
565 { |
574 // postpone container activation |
572 // postpone container activation |
575 return; |
573 return; |
576 } |
574 } |
577 |
575 |
578 const CXnViewData& active( iAppUiAdapter.ViewManager().ActiveViewData() ); |
576 const CXnViewData& active( iAppUiAdapter.ViewManager().ActiveViewData() ); |
579 |
577 |
580 TBool started = EFalse; |
|
581 CXnEffectManager* mgr( iAppUiAdapter.EffectManager() ); |
578 CXnEffectManager* mgr( iAppUiAdapter.EffectManager() ); |
|
579 |
582 CleanupStack::PushL( TCleanupItem( CleanupEffect, mgr ) ); |
580 CleanupStack::PushL( TCleanupItem( CleanupEffect, mgr ) ); |
583 |
581 |
584 if( aEffect != TUid::Null() ) |
582 TBool started( |
585 { |
583 mgr->BeginActivateViewEffect( active, aContainer, aEffect ) ); |
586 started = mgr->BeginActivateViewEffect( active, aContainer, aEffect ); |
584 |
587 } |
585 DeactivateContainerL( EFalse ); |
588 |
|
589 DeactivateContainerL(); |
|
590 |
586 |
591 // Update |
587 // Update |
592 iContainer = &aContainer; |
588 iContainer = &aContainer; |
593 |
589 |
594 // Disable layout and redraw until container activation is done |
590 // Disable layout and redraw until container activation is done |
636 |
632 |
637 CXnControlAdapter* adapter( node->Control() ); |
633 CXnControlAdapter* adapter( node->Control() ); |
638 adapter->MakeVisible( ETrue ); |
634 adapter->MakeVisible( ETrue ); |
639 |
635 |
640 iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer ); |
636 iAppUiAdapter.ViewManager().NotifyContainerChangedL( aContainer ); |
641 |
637 |
642 if( aUpdateBg ) |
638 iBgManager->ChangeWallpaper( active, aContainer, !started ); |
643 { |
|
644 iBgManager->ChangeWallpaper( active, aContainer, !started ); |
|
645 } |
|
646 |
639 |
647 iAppUiAdapter.UiEngine().RenderUIL(); |
640 iAppUiAdapter.UiEngine().RenderUIL(); |
648 |
641 |
649 CleanupStack::PopAndDestroy(); // DisableRenderUiLC |
642 CleanupStack::PopAndDestroy(); // DisableRenderUiLC |
650 |
643 |
651 if( aEffect != TUid::Null() ) |
644 mgr->EndActivateViewEffect( active, aContainer, aEffect ); |
652 { |
|
653 mgr->EndActivateViewEffect( active, aContainer, aEffect ); |
|
654 } |
|
655 |
645 |
656 CleanupStack::PopAndDestroy(); // cleanupitem |
646 CleanupStack::PopAndDestroy(); // cleanupitem |
657 |
647 |
658 iAppUiAdapter.ViewManager().UpdatePageManagementInformationL(); |
648 iAppUiAdapter.ViewManager().UpdatePageManagementInformationL(); |
659 |
649 |
687 { |
677 { |
688 EnterEditStateL( *viewData, aEnterEditState ); |
678 EnterEditStateL( *viewData, aEnterEditState ); |
689 // Deactivate container even though it hasn't changed to close all |
679 // Deactivate container even though it hasn't changed to close all |
690 // popups and other windows |
680 // popups and other windows |
691 ActivateContainerL( *viewData, aEnterEditState ); |
681 ActivateContainerL( *viewData, aEnterEditState ); |
692 |
|
693 CloseAllPopupsL(); |
|
694 } |
682 } |
695 } |
683 } |
696 |
684 |
697 // ----------------------------------------------------------------------------- |
685 // ----------------------------------------------------------------------------- |
698 // CXnViewAdapter::EnterEditStateL |
686 // CXnViewAdapter::EnterEditStateL |
751 |
739 |
752 // Run controls to powersave mode |
740 // Run controls to powersave mode |
753 ChangeControlsStateL( EFalse ); |
741 ChangeControlsStateL( EFalse ); |
754 |
742 |
755 CXnNode* node( iContainer->Node()->LayoutNode() ); |
743 CXnNode* node( iContainer->Node()->LayoutNode() ); |
756 |
744 |
|
745 CXnDomStringPool* sp( node->DomNode()->StringPool() ); |
|
746 |
|
747 CXnProperty* prop = CXnProperty::NewL( |
|
748 XnPropertyNames::style::common::KDisplay, |
|
749 XnPropertyNames::style::common::display::KNone, |
|
750 CXnDomPropertyValue::EString, *sp ); |
|
751 CleanupStack::PushL( prop ); |
|
752 |
|
753 node->SetPropertyWithoutNotificationL( prop ); |
|
754 CleanupStack::Pop( prop ); |
|
755 |
757 if ( !iDeactivate ) |
756 if ( !iDeactivate ) |
758 { |
757 { |
759 iDeactivate = BuildDeactivateTriggerL( iAppUiAdapter.UiEngine() ); |
758 iDeactivate = BuildDeactivateTriggerL( iAppUiAdapter.UiEngine() ); |
760 } |
759 } |
761 |
760 |
1007 |
1006 |
1008 RPointerArray< CXnNode > popups; |
1007 RPointerArray< CXnNode > popups; |
1009 CleanupClosePushL( popups ); |
1008 CleanupClosePushL( popups ); |
1010 |
1009 |
1011 iContainer->PopupNodesL( popups ); |
1010 iContainer->PopupNodesL( popups ); |
1012 |
1011 |
1013 for ( TInt i = 0; i < popups.Count(); i++ ) |
1012 for ( TInt i = 0; i < popups.Count(); i++ ) |
1014 { |
1013 { |
1015 CXnProperty* display = CXnProperty::NewL( |
1014 CXnProperty* display = CXnProperty::NewL( |
1016 XnPropertyNames::style::common::KDisplay, |
1015 XnPropertyNames::style::common::KDisplay, |
1017 XnPropertyNames::style::common::display::KNone, |
1016 XnPropertyNames::style::common::display::KNone, |
1022 popups[i]->SetPropertyL(display); |
1021 popups[i]->SetPropertyL(display); |
1023 CleanupStack::Pop( display ); |
1022 CleanupStack::Pop( display ); |
1024 } |
1023 } |
1025 |
1024 |
1026 CleanupStack::PopAndDestroy( &popups ); |
1025 CleanupStack::PopAndDestroy( &popups ); |
1027 |
1026 } |
1028 iEventDispatcher->SetTextEditorActive( NULL, EFalse ); |
1027 |
1029 |
|
1030 CXnNode* popup( iAppUiAdapter.UiEngine().StylusPopupNode() ); |
|
1031 if ( popup ) |
|
1032 { |
|
1033 CXnPopupControlAdapter* control = |
|
1034 static_cast< CXnPopupControlAdapter* >( |
|
1035 popup->Control() ); |
|
1036 |
|
1037 if ( control ) |
|
1038 { |
|
1039 control->HideMenuL(); |
|
1040 } |
|
1041 } |
|
1042 } |
|
1043 |
|
1044 TBool CXnViewAdapter::IsForegroundAdapter() const |
|
1045 { |
|
1046 return ( iContainer != NULL ); |
|
1047 } |
|
1048 |
1028 |
1049 // End of file |
1029 // End of file |