vtuis/videotelui/src/features/menu/cvtuimenus.cpp
branchRCL_3
changeset 24 f15ac8e65a02
parent 23 890b5dd735f8
child 25 779871d1e4f4
equal deleted inserted replaced
23:890b5dd735f8 24:f15ac8e65a02
     1 /*
       
     2 * Copyright (c) 2006 - 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Mennu Ui feature class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <cvtlogger.h>
       
    20 
       
    21 #include "cvtuimenus.h"
       
    22 #include "cvtuimenucontext.h"
       
    23 #include "cvtuimenuitemdimmeraction.h"
       
    24 #include "cvtuifeaturemanager.h"
       
    25 #include "cvtuicommandmanager.h"
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // CVtUiMenus::NewL
       
    29 // ---------------------------------------------------------------------------
       
    30 //
       
    31 CVtUiMenus* CVtUiMenus::NewL( CVtUiFeatureManager& aFeatureManager )
       
    32     {
       
    33     __VTPRINTENTER( "Menus.NewL" )
       
    34     CVtUiMenus* self = new ( ELeave ) CVtUiMenus( aFeatureManager );
       
    35     CleanupStack::PushL( self );
       
    36     self->ConstructL();
       
    37     CleanupStack::Pop(); // self
       
    38     __VTPRINTEXIT( "Menus.NewL" )
       
    39     return self;
       
    40     }
       
    41 
       
    42 // ---------------------------------------------------------------------------
       
    43 // CVtUiMenus::~CVtUiMenus
       
    44 // ---------------------------------------------------------------------------
       
    45 //
       
    46 CVtUiMenus::~CVtUiMenus()
       
    47     {
       
    48     __VTPRINTENTER( "Menus.~" )    
       
    49     delete iMenuCommandContext;
       
    50     delete iMenuDimmerAction;
       
    51     __VTPRINTEXIT( "Menus.~" )
       
    52     }
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // CVtUiMenus::SetMenuPane
       
    56 // ---------------------------------------------------------------------------
       
    57 //
       
    58 void CVtUiMenus::SetMenuPane( CEikMenuPane* aMenuPane )
       
    59     {
       
    60     __VTPRINTENTER( "Menus.SetMenuPane" )
       
    61     iMenuDimmerAction->SetMenuPane( aMenuPane );
       
    62     __VTPRINTEXIT( "Menus.SetMenuPane" )
       
    63     }
       
    64 
       
    65 // ---------------------------------------------------------------------------
       
    66 // CVtUiMenus::StartL
       
    67 // ---------------------------------------------------------------------------
       
    68 //
       
    69 void CVtUiMenus::StartL()
       
    70     {
       
    71     __VTPRINTENTER( "Menus.StartL" )
       
    72     __VTPRINTEXIT( "Menus.StartL" )
       
    73     }
       
    74 
       
    75 // ---------------------------------------------------------------------------
       
    76 // CVtUiMenus::Stop
       
    77 // ---------------------------------------------------------------------------
       
    78 //
       
    79 void CVtUiMenus::Stop()
       
    80     {
       
    81     __VTPRINTENTER( "Menus.Stop" )
       
    82     __VTPRINTEXIT( "Menus.Stop" )
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CVtUiMenus::InitFeatureL
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 void CVtUiMenus::InitFeatureL()
       
    90     {
       
    91     __VTPRINTENTER( "Menus.InitFeatureL" )
       
    92     __VTPRINTEXIT( "Menus.InitFeatureL" )
       
    93     }
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // CVtUiMenus::RefreshL
       
    97 // ---------------------------------------------------------------------------
       
    98 //
       
    99 void CVtUiMenus::RefreshL()
       
   100     {
       
   101     __VTPRINTENTER( "Menus.RefreshL" )
       
   102     iFeatureManager.CommandManager().ValidateMenuItemsL( *iMenuDimmerAction );
       
   103     __VTPRINTEXIT( "Menus.RefreshL" )
       
   104     }
       
   105 
       
   106 // ---------------------------------------------------------------------------
       
   107 // CVtUiMenus::AddCommandModifier
       
   108 // ---------------------------------------------------------------------------
       
   109 //
       
   110 TInt CVtUiMenus::AddCommandModifier( CVtUiCommandModifyBase& )
       
   111     {
       
   112     __VTPRINTENTER( "Menus.AddCommandModifier" )
       
   113     __VTPRINTEXIT( "Menus.AddCommandModifier" )
       
   114     return KErrNone;
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // CVtUiMenus::RemoveCommandModifier
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CVtUiMenus::RemoveCommandModifier( CVtUiCommandModifyBase& )
       
   122     {
       
   123     __VTPRINTENTER( "Menus.RemoveCommandModifier" )
       
   124     __VTPRINTEXIT( "Menus.RemoveCommandModifier" )
       
   125     }
       
   126 
       
   127 // ---------------------------------------------------------------------------
       
   128 // CVtUiMenus::CVtUiMenus
       
   129 // ---------------------------------------------------------------------------
       
   130 //
       
   131 CVtUiMenus::CVtUiMenus( CVtUiFeatureManager& aFeatureManager )
       
   132     : CVtUiFeatureBase( EVtUiFeatureIdMenu, aFeatureManager )
       
   133     {
       
   134     __VTPRINTENTER( "Menus.ctor" )
       
   135     __VTPRINTEXIT( "Menus.ctor" )
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // CVtUiMenus::ConstructL
       
   140 // ---------------------------------------------------------------------------
       
   141 //
       
   142 void CVtUiMenus::ConstructL()
       
   143     {
       
   144     __VTPRINTENTER( "Menus.ConstructL" )
       
   145     iMenuCommandContext =
       
   146         CVtUiMenuContext::NewL( iFeatureManager.CommandManager() );
       
   147     iMenuDimmerAction = CVtUiMenuItemDimmerAction::NewL();
       
   148     
       
   149     // No need to add this to command manager as command UI. Menu is explicitly
       
   150     // updated by CVtUiAppUi::DynInitMenuPaneL and in all other situations
       
   151     // update is not needed because menu is not open. 
       
   152     // NOTE: If a command modifier is implemented for menu then it needs
       
   153     // to be added to command UI.
       
   154     __VTPRINTEXIT( "Menus.ConstructL" )
       
   155     }
       
   156