phonebookui/Phonebook2/Application/inc/CPbk2AppUi.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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          * Activates Phonebook view.
       
    96          *
       
    97          * @param aViewId       Id of the view to activate.
       
    98          * @param aViewState    View activation parameters.
       
    99          */
       
   100         void ActivatePhonebookViewL(
       
   101                 TUid aViewId,
       
   102                 const CPbk2ViewState* aViewState );
       
   103 
       
   104     public: // From CPbk2AppUiBase
       
   105         CPbk2AppViewBase* ActiveView() const;
       
   106         MPbk2ViewExplorer* Pbk2ViewExplorer() const;
       
   107         MPbk2StartupMonitor* Pbk2StartupMonitor() const;
       
   108         CPbk2TabGroupContainer* TabGroups() const;
       
   109         MPbk2KeyEventHandler& KeyEventHandler();
       
   110         MPbk2ApplicationServices& ApplicationServices() const;
       
   111         void HandleCommandL(
       
   112                 TInt aCommand );
       
   113         void ExitApplication();
       
   114 
       
   115     private: // From MCoeForegroundObserver
       
   116         void HandleGainingForeground();
       
   117         void HandleLosingForeground();
       
   118 
       
   119     private: // From CAknViewAppUi
       
   120         void DynInitMenuPaneL(
       
   121                 TInt aResourceId,
       
   122                 CEikMenuPane* aMenuPane );
       
   123         TKeyResponse HandleKeyEventL(
       
   124                 const TKeyEvent& aKeyEvent,
       
   125                 TEventCode aType );
       
   126         void HandleResourceChangeL(
       
   127                 TInt aType );
       
   128         void HandleForegroundEventL(
       
   129                 TBool aForeground );
       
   130 
       
   131     private: // From MPbk2KeyEventHandler
       
   132         TBool Pbk2ProcessKeyEventL(
       
   133                 const TKeyEvent& aKeyEvent,
       
   134                 TEventCode aType );
       
   135 
       
   136     private: // Implementation
       
   137         void ConstructL();
       
   138         void CmdExit();
       
   139         TBool LocalVariationFeatureEnabled(
       
   140                 TInt aFeatureFlag );
       
   141         void LeavePbkInMemExitL();
       
   142 
       
   143     private: // Data
       
   144         /// Own: Phonebook 2 UI controls dll resource file
       
   145         RPbk2LocalizedResourceFile iUiControlsResourceFile;
       
   146         /// Own: Phonebook 2 commands dll resource file
       
   147         RPbk2LocalizedResourceFile iCommandsResourceFile;
       
   148         /// Own: Phonebook 2 common UI dll resource file
       
   149         RPbk2LocalizedResourceFile iCommonUiResourceFile;
       
   150         /// Own: View explorer
       
   151         CPbk2ViewExplorer* iViewExplorer;
       
   152         /// Own: Tab group
       
   153         CPbk2TabGroupContainer* iTabGroups;
       
   154         /// Own: AppUI extension
       
   155         MPbk2AppUiExtension* iAppUiExtension;
       
   156         /// Own: Start-up monitor
       
   157         CPbk2StartupMonitor* iStartupMonitor;
       
   158         /// Own: Indicates is this app in foreground
       
   159         TBool iIsRunningForeground;
       
   160         /// Ref: Application services
       
   161         MPbk2ApplicationServices* iAppServices;
       
   162         /// Ref: Application services extension
       
   163         MPbk2ApplicationServices2* iAppServicesExtension;
       
   164     };
       
   165 
       
   166 #endif  // CPBK2APPUI_H
       
   167 
       
   168 // End of File