uifw/AvKon/src/aknview.cpp
branchRCL_3
changeset 55 aecbbf00d063
parent 38 c52421ed5f07
child 56 d48ab3b357f1
equal deleted inserted replaced
51:fcdfafb36fe7 55:aecbbf00d063
    42 #ifdef RD_SCALABLE_UI_V2
    42 #ifdef RD_SCALABLE_UI_V2
    43 #include <akntouchpane.h>
    43 #include <akntouchpane.h>
    44 #endif // RD_SCALABLE_UI_V2
    44 #endif // RD_SCALABLE_UI_V2
    45 
    45 
    46 #include <AknUtils.h>
    46 #include <AknUtils.h>
    47 #include <layoutmetadata.cdl.h>
       
    48 #include "aknitemactionmenuregister.h"
    47 #include "aknitemactionmenuregister.h"
    49 
    48 
    50 // MODULE DATA STRUCTURES
    49 // MODULE DATA STRUCTURES
    51 enum TAknViewFlags
    50 enum TAknViewFlags
    52 	{
    51 	{
    53 	EAknViewForeground
    52 	EAknViewForeground
    54 	};
    53 	};
    55 
    54 
    56 
    55 
    57 // CLASS DECLARATION
    56 // CLASS DECLARATION
    58 static const TUid KUidGlxApp = { 0x200009ee }; // App uid of photo
       
    59 static const TUid KUidVideoApp = { 0x200159b2 }; // App uid of video
       
    60 
    57 
    61 /**
    58 /**
    62 * Extension class.
    59 * Extension class.
    63 */
    60 */
    64 NONSHARABLE_CLASS(CAknViewExtension) : public CBase
    61 NONSHARABLE_CLASS(CAknViewExtension) : public CBase
    83         void CreateAndSetToolbarL( TInt aResourceId ); 
    80         void CreateAndSetToolbarL( TInt aResourceId ); 
    84         
    81         
    85     public:
    82     public:
    86         TBool iToolbarVisible; 
    83         TBool iToolbarVisible; 
    87         TBool iToolbarFocusing; 
    84         TBool iToolbarFocusing; 
       
    85         TBool iViewActivated;
    88     private: // data
    86     private: // data
    89         CAknToolbar* iToolbar;
    87         CAknToolbar* iToolbar;
    90         CAknToolbar* iFixedToolbar;
    88         CAknToolbar* iFixedToolbar;
    91         CAknView* iView;
    89         CAknView* iView;
    92     };
    90     };
   227 
   225 
   228     if ( oldFixedToolbar && oldFixedToolbar != newFixedToolbar )
   226     if ( oldFixedToolbar && oldFixedToolbar != newFixedToolbar )
   229         {
   227         {
   230         
   228         
   231         if ( newFixedToolbar && newFixedToolbar->ToolbarFlags() & KAknToolbarDefault )
   229         if ( newFixedToolbar && newFixedToolbar->ToolbarFlags() & KAknToolbarDefault )
   232             {
   230         	{
   233             return;
   231         	oldFixedToolbar->HandleResourceChange( KAknToolbarSetHiddenAndDrawBackground );
   234             }
   232         	return;
   235 
   233         	}
       
   234         
   236         oldFixedToolbar->HandleResourceChange( KAknToolbarSetHidden );         
   235         oldFixedToolbar->HandleResourceChange( KAknToolbarSetHidden );         
   237         }
   236         }
   238 #endif 
   237 #endif 
   239     }
   238     }
   240     
   239     
   427 		delete iMenu;
   426 		delete iMenu;
   428 		}
   427 		}
   429 
   428 
   430 	delete iCba;
   429 	delete iCba;
   431 	delete iExtension;
   430 	delete iExtension;
   432 
       
   433     AknItemActionMenuRegister::RemoveConstructingMenuBarOwner( this );
       
   434 	}
   431 	}
   435 
   432 
   436 // -----------------------------------------------------------------------------
   433 // -----------------------------------------------------------------------------
   437 // CAknView::BaseConstructL
   434 // CAknView::BaseConstructL
   438 // Second-phase base class constructor. Must be called from a derived classes
   435 // Second-phase base class constructor. Must be called from a derived classes
   460         CleanupStack::PopAndDestroy(); // r
   457         CleanupStack::PopAndDestroy(); // r
   461         }
   458         }
   462         
   459         
   463     Extension()->CreateToolbarL( iViewInfo.iToolbar );
   460     Extension()->CreateToolbarL( iViewInfo.iToolbar );
   464 
   461 
   465     AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
   462     if ( iViewInfo.iMenu )
       
   463         {
       
   464         AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
       
   465         }
   466     }
   466     }
   467 
   467 
   468 // -----------------------------------------------------------------------------
   468 // -----------------------------------------------------------------------------
   469 // CAknView::AppUi
   469 // CAknView::AppUi
   470 // Accessor for the app UI as a CAknViewAppUi.
   470 // Accessor for the app UI as a CAknViewAppUi.
   530 // empty.
   530 // empty.
   531 // -----------------------------------------------------------------------------
   531 // -----------------------------------------------------------------------------
   532 //
   532 //
   533 EXPORT_C void CAknView::HandleStatusPaneSizeChange()
   533 EXPORT_C void CAknView::HandleStatusPaneSizeChange()
   534 	{
   534 	{
   535 	 if ( Cba() )
       
   536 	     {
       
   537 	     TRect cbaRect( 0,0,0,0 );
       
   538 	     Cba()->SetBoundingRect( cbaRect );
       
   539 	     }
       
   540 	}
   535 	}
   541 
   536 
   542 // -----------------------------------------------------------------------------
   537 // -----------------------------------------------------------------------------
   543 // CAknView::SetEmphasis
   538 // CAknView::SetEmphasis
   544 // Menu emphasis function.
   539 // Menu emphasis function.
   578 // Called by the application UI when a view is activated.
   573 // Called by the application UI when a view is activated.
   579 // -----------------------------------------------------------------------------
   574 // -----------------------------------------------------------------------------
   580 //
   575 //
   581 EXPORT_C void CAknView::AknViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage )
   576 EXPORT_C void CAknView::AknViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage )
   582 	{
   577 	{
   583     AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( this );
       
   584 	ConstructMenuAndCbaL( ETrue );
   578 	ConstructMenuAndCbaL( ETrue );
   585 
   579     if ( !Extension()->iViewActivated )
   586     
   580         {
       
   581         // Reset menu bar owner when view first activated
       
   582         AknItemActionMenuRegister::SetConstructingMenuBarOwnerL( NULL );
       
   583         Extension()->iViewActivated = ETrue;
       
   584         }
       
   585 	
   587 	Extension()->PrepareToolbar();
   586 	Extension()->PrepareToolbar();
   588 
   587 
   589 	DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
   588 	DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
       
   589 
       
   590 #ifdef RD_SCALABLE_UI_V2
       
   591     if ( iAvkonAppUi->TouchPane() )
       
   592         {
       
   593         iAvkonAppUi->TouchPane()->RefreshL();
       
   594         }
       
   595 #endif // RD_SCALABLE_UI_V2
   590 
   596 
   591 	ProcessForegroundEventL( ETrue );
   597 	ProcessForegroundEventL( ETrue );
   592 	}
   598 	}
   593 
   599 
   594 // -----------------------------------------------------------------------------
   600 // -----------------------------------------------------------------------------
   857 			CleanupStack::Pop(); // menu
   863 			CleanupStack::Pop(); // menu
   858 			iMenu = menu;
   864 			iMenu = menu;
   859 			}
   865 			}
   860 		}
   866 		}
   861 
   867 
   862 	if (iCba)
   868 	if ( iCba )
   863         {
   869 		{
   864         if (aVisible)
   870 		if ( aVisible )
   865             {
   871 			{
   866             //Added for fixing EAMI-856GRV and ESLM-85ZHQH:           
   872 			iCba->DrawableWindow()->SetOrdinalPosition( 0 );
   867             //As video app and photo app spend a long time at deactiveview,during this time only cba shows up,and this is ugly in landscape mode
       
   868             //so the solution is to don't call SetOrdinalPosition in video app and photo app while in landscape mode
       
   869             TUid appid = iAppUi->Application()->AppDllUid();
       
   870             if (!(( appid == KUidVideoApp || appid == KUidGlxApp )
       
   871                     && Layout_Meta_Data::IsLandscapeOrientation()))
       
   872                 {
       
   873                 iCba->DrawableWindow()->SetOrdinalPosition( 0 );
       
   874                 }
       
   875 
       
   876 			iCba->MakeVisible( ETrue );
   873 			iCba->MakeVisible( ETrue );
   877 			iCba->DrawNow(); // This is needed because problems if TRANSPARENCY is set, see MTVN-6HXCN4
   874 			iCba->DrawNow(); // This is needed because problems if TRANSPARENCY is set, see MTVN-6HXCN4
   878 			}
   875 			}
   879 		}
   876 		}
   880 	else
   877 	else