fep/aknfep/src/AknFepPluginMenuManager.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2002-2004 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:           
       
    15 *       Provides the AknFepPluginMenuManager methods.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 #include <coemain.h>
       
    30 #include <coeaui.h>
       
    31 
       
    32 #include "AknFepPluginMenuManager.h" // MAknFepManagerInterface
       
    33 #include "AknFepManager.h" 
       
    34 
       
    35 
       
    36 // -----------------------------------------------------------------------------
       
    37 // CAknFepPluginMenuManager::NewL
       
    38 // factory function
       
    39 // (other items were commented in a header).
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 CAknFepPluginMenuManager* CAknFepPluginMenuManager::NewL(CAknFepManager* aManager)
       
    43     {
       
    44     return new(ELeave) CAknFepPluginMenuManager(aManager);
       
    45     }
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CAknFepPluginMenuManager::~CAknFepPluginMenuManager
       
    49 // Destructor
       
    50 // (other items were commented in a header).
       
    51 // -----------------------------------------------------------------------------
       
    52 //
       
    53 CAknFepPluginMenuManager::~CAknFepPluginMenuManager()
       
    54     {
       
    55     if( iOptionMenuBar )
       
    56         {
       
    57         iOptionMenuBar->RemoveFromStack();
       
    58         delete iOptionMenuBar;
       
    59         }
       
    60     }
       
    61 
       
    62 // -----------------------------------------------------------------------------
       
    63 // CAknFepPluginMenuManager::aResourceId
       
    64 // Show speicfied menu pane
       
    65 // (other items were commented in a header).
       
    66 // -----------------------------------------------------------------------------
       
    67 //
       
    68 void CAknFepPluginMenuManager::ShowL(TInt aResourceId)
       
    69     {
       
    70     if( !iOptionMenuBar )
       
    71         {
       
    72 		iOptionMenuBar = iFepManager->UiInterface()->NewMenuBarL(this, 0, aResourceId);
       
    73         }
       
    74     else
       
    75         {
       
    76         iOptionMenuBar->SetMenuTitleResourceId(aResourceId);
       
    77         }
       
    78 
       
    79     if( !iOptionMenuBar->IsDisplayed() )
       
    80         {
       
    81         iOptionMenuBar->AddToStackL(ECoeStackPriorityDialog + 1,
       
    82                                     ECoeStackFlagStandard);
       
    83         iOptionMenuBar->SetMenuType(CAknFepUiInterfaceMenuBar::EMenuOptionsNoTaskSwapper);
       
    84         iOptionMenuBar->TryDisplayMenuBarWithoutFepMenusL();
       
    85         }
       
    86     }
       
    87 
       
    88 // -----------------------------------------------------------------------------
       
    89 // CAknFepPluginMenuManager::IsShowing
       
    90 // Get menu show status
       
    91 // (other items were commented in a header).
       
    92 // -----------------------------------------------------------------------------
       
    93 //
       
    94 TBool CAknFepPluginMenuManager::IsShowing()
       
    95     {
       
    96     if( iOptionMenuBar )
       
    97         {
       
    98         return iOptionMenuBar->IsDisplayed();
       
    99         }
       
   100     return EFalse;
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CAknFepPluginMenuManager::Hide
       
   105 // Hide current showed menu
       
   106 // (other items were commented in a header).
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 void CAknFepPluginMenuManager::Hide()
       
   110     {
       
   111     if( IsShowing() )
       
   112         {
       
   113         iOptionMenuBar->StopDisplayingMenuBar();
       
   114         }
       
   115     }
       
   116 
       
   117 // -----------------------------------------------------------------------------
       
   118 // CAknFepPluginMenuManager::MenuPaneId
       
   119 // Get current menu resource id
       
   120 // (other items were commented in a header).
       
   121 // -----------------------------------------------------------------------------
       
   122 //
       
   123 TInt CAknFepPluginMenuManager::MenuPaneId()
       
   124     {
       
   125     if( iOptionMenuBar )
       
   126         {
       
   127         return iOptionMenuBar->FirstMenuPaneResourceId();
       
   128         }
       
   129     return 0;
       
   130     }
       
   131 
       
   132 // -----------------------------------------------------------------------------
       
   133 // CAknFepPluginMenuManager::SetEmphasis
       
   134 // called when menu get or lose focus
       
   135 // (other items were commented in a header).
       
   136 // -----------------------------------------------------------------------------
       
   137 //
       
   138 void CAknFepPluginMenuManager::SetEmphasis(CBase* aMenuControl, TBool aEmphasis)
       
   139     {
       
   140     if( !aEmphasis && aMenuControl == iOptionMenuBar)
       
   141         {
       
   142         iOptionMenuBar->SetFocus(EFalse);
       
   143 		iOptionMenuBar->RemoveFromStack();
       
   144         }
       
   145     }
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CAknFepPluginMenuManager::ProcessCommandL
       
   149 // Process command user selects
       
   150 // (other items were commented in a header).
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 void CAknFepPluginMenuManager::ProcessCommandL(TInt aCommandId)
       
   154     {
       
   155     if( aCommandId == EEikCmdCanceled)
       
   156         {
       
   157         //The command is not sent to FEP
       
   158         Hide();
       
   159         }
       
   160     }
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CAknFepPluginMenuManager::MenuPaneId
       
   164 // C++ default constructor
       
   165 // (other items were commented in a header).
       
   166 // -----------------------------------------------------------------------------
       
   167 //
       
   168 CAknFepPluginMenuManager::CAknFepPluginMenuManager(CAknFepManager* aFepManager)
       
   169 :iFepManager(aFepManager)
       
   170     {
       
   171     }
       
   172 
       
   173 //End Of File