phonebookui/Phonebook2/Application/inc/CPbk2AppUi.h
changeset 0 e686773b3f54
child 13 18296dac9a57
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2007 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:  Phonebook 2 application UI.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2APPUI_H
       
    20 #define CPBK2APPUI_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <CPbk2AppUiBase.h>
       
    24 #include <coemain.h>
       
    25 #include <MPbk2AppUiExtension.h>
       
    26 #include <MPbk2KeyEventHandler.h>
       
    27 #include <RPbk2LocalizedResourceFile.h>
       
    28 
       
    29 //  FORWARD DECLARATIONS
       
    30 class CPbk2Document;
       
    31 class CPbk2Application;
       
    32 class MPbk2AppUiExtension;
       
    33 class CPbk2ViewExplorer;
       
    34 class CPbk2StartupMonitor;
       
    35 class CPbk2ViewState;
       
    36 class CPbk2StoreManager;
       
    37 class CPbk2TabGroupContainer;
       
    38 class MPbk2ApplicationServices;
       
    39 class MPbk2ApplicationServices2;
       
    40 
       
    41 //  CLASS DECLARATION
       
    42 
       
    43 /**
       
    44  * Phonebook2 application UI.
       
    45  * An object of this class is created by the Symbian OS
       
    46  * framework by a call to CPbk2Document::CreateAppUiL().
       
    47  * The application UI object creates and owns the application's
       
    48  * views and handles system commands selected from the menu.
       
    49  */
       
    50 class CPbk2AppUi : public CPbk2AppUiBase<CAknViewAppUi>,
       
    51                    public MPbk2KeyEventHandler,
       
    52                    private MCoeForegroundObserver
       
    53     {
       
    54     public:  // Constructors and destructor
       
    55 
       
    56         /**
       
    57          * Constructor.
       
    58          */
       
    59         CPbk2AppUi();
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         ~CPbk2AppUi();
       
    65 
       
    66     public: // Interface
       
    67 
       
    68         /**
       
    69          * Returns the Phonebook 2 document object.
       
    70          *
       
    71          * @return  Phonebook document.
       
    72          */
       
    73         CPbk2Document* PhonebookDocument() const;
       
    74 
       
    75         /**
       
    76          * Returns the concrete store manager.
       
    77          *
       
    78          * @return  Store manager.
       
    79          */
       
    80         CPbk2StoreManager& StoreManager() const;
       
    81 
       
    82         /**
       
    83          * Returns the Phonebook 2 application object.
       
    84          *
       
    85          * @return  Phonebook application.
       
    86          */
       
    87         CPbk2Application* Pbk2Application() const;
       
    88 
       
    89         /**
       
    90          * Exits Phonebook 2 in a correct way.
       
    91          */
       
    92         void ExitL();
       
    93 
       
    94         /**
       
    95          * Forces exit.
       
    96          */
       
    97         void Exit();
       
    98 
       
    99         /**
       
   100          * Activates Phonebook view.
       
   101          *
       
   102          * @param aViewId       Id of the view to activate.
       
   103          * @param aViewState    View activation parameters.
       
   104          */
       
   105         void ActivatePhonebookViewL(
       
   106                 TUid aViewId,
       
   107                 const CPbk2ViewState* aViewState );
       
   108 
       
   109     public: // From CPbk2AppUiBase
       
   110         CPbk2AppViewBase* ActiveView() const;
       
   111         MPbk2ViewExplorer* Pbk2ViewExplorer() const;
       
   112         MPbk2StartupMonitor* Pbk2StartupMonitor() const;
       
   113         CPbk2TabGroupContainer* TabGroups() const;
       
   114         MPbk2KeyEventHandler& KeyEventHandler();
       
   115         MPbk2ApplicationServices& ApplicationServices() const;
       
   116         void HandleCommandL(
       
   117                 TInt aCommand );
       
   118         void ExitApplication();
       
   119 
       
   120     private: // From MCoeForegroundObserver
       
   121         void HandleGainingForeground();
       
   122         void HandleLosingForeground();
       
   123 
       
   124     private: // From CAknViewAppUi
       
   125         void DynInitMenuPaneL(
       
   126                 TInt aResourceId,
       
   127                 CEikMenuPane* aMenuPane );
       
   128         TKeyResponse HandleKeyEventL(
       
   129                 const TKeyEvent& aKeyEvent,
       
   130                 TEventCode aType );
       
   131         void HandleResourceChangeL(
       
   132                 TInt aType );
       
   133         void HandleForegroundEventL(
       
   134                 TBool aForeground );
       
   135 
       
   136     private: // From MPbk2KeyEventHandler
       
   137         TBool Pbk2ProcessKeyEventL(
       
   138                 const TKeyEvent& aKeyEvent,
       
   139                 TEventCode aType );
       
   140 
       
   141     private: // Implementation
       
   142         void ConstructL();
       
   143         void CmdExit();
       
   144         TBool LocalVariationFeatureEnabled(
       
   145                 TInt aFeatureFlag );
       
   146         void LeavePbkInMemExitL();
       
   147 
       
   148     private: // Data
       
   149         /// Own: Phonebook 2 UI controls dll resource file
       
   150         RPbk2LocalizedResourceFile iUiControlsResourceFile;
       
   151         /// Own: Phonebook 2 commands dll resource file
       
   152         RPbk2LocalizedResourceFile iCommandsResourceFile;
       
   153         /// Own: Phonebook 2 common UI dll resource file
       
   154         RPbk2LocalizedResourceFile iCommonUiResourceFile;
       
   155         /// Own: View explorer
       
   156         CPbk2ViewExplorer* iViewExplorer;
       
   157         /// Own: Tab group
       
   158         CPbk2TabGroupContainer* iTabGroups;
       
   159         /// Own: AppUI extension
       
   160         MPbk2AppUiExtension* iAppUiExtension;
       
   161         /// Own: Start-up monitor
       
   162         CPbk2StartupMonitor* iStartupMonitor;
       
   163         /// Own: Indicates is this app in foreground
       
   164         TBool iIsRunningForeground;
       
   165         /// Ref: Application services
       
   166         MPbk2ApplicationServices* iAppServices;
       
   167         /// Ref: Application services extension
       
   168         MPbk2ApplicationServices2* iAppServicesExtension;
       
   169     };
       
   170 
       
   171 #endif  // CPBK2APPUI_H
       
   172 
       
   173 // End of File