phonebookui/Phonebook2/ccapplication/ccapp/inc/ccaappappui.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 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:  Defines CCCAAppAppUi, class that prepares the 
       
    15 *                application View(s) and handles the UI commands 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __CCAAPP_APPUI_H__
       
    21 #define __CCAAPP_APPUI_H__
       
    22 
       
    23 #ifdef __CCAPPUNITTESTMODE
       
    24     #include "ccappheaders.h"
       
    25 #else
       
    26     #include <aknViewAppUi.h>    
       
    27 #endif// __CCAPPUNITTESTMODE 
       
    28     
       
    29 // FORWARD DECLARATIONS
       
    30 class CCCAppView;
       
    31 class CCCAParameter;
       
    32 class CRepository;
       
    33 
       
    34 /**
       
    35  *  Defines CCCAAppAppUi, class that prepares the application 
       
    36  *  view and handles the UI commands 
       
    37  *
       
    38  *  @lib ccaapp.exe
       
    39  *  @since S60 v5.0
       
    40  */  
       
    41 class CCCAAppAppUi : public CAknViewAppUi
       
    42     {
       
    43 #ifdef __CCAPPUNITTESTMODE
       
    44     friend class ut_CCCAAppAppUi;
       
    45 #endif// __CCAPPUNITTESTMODE    
       
    46 
       
    47 public:
       
    48 
       
    49     CCCAAppAppUi();
       
    50     
       
    51    /**
       
    52     * Destructor.
       
    53     */
       
    54     ~CCCAAppAppUi();
       
    55 
       
    56 public:
       
    57 
       
    58     /**
       
    59      * Initializes view plugin for usage. Calls 1st 
       
    60      * PreparePluginViewL and then ActivatePluginViewL.
       
    61      */
       
    62     void InitializePluginL();
       
    63     
       
    64     /**
       
    65      * Sets the CCApp parameter
       
    66      * @param aParameter contains contact information. 
       
    67      *        Ownership is transferred.
       
    68      */        
       
    69     void SetParameter( CCCAParameter& aParameter );
       
    70 
       
    71     /**
       
    72      * Returns a reference to CCApp parameter
       
    73      *
       
    74      * @since S60 v5.0
       
    75      * @return CCCAParameter reference
       
    76      */        
       
    77     CCCAParameter& Parameter();
       
    78 
       
    79     /**
       
    80      * Returns a reference to EikonEnv
       
    81      *
       
    82      * @since S60 v5.0
       
    83      * @return CEikonEnv reference
       
    84      */        
       
    85     CEikonEnv& EikonEnv();
       
    86 
       
    87     /**
       
    88      * Returns an array of key ids reserved by the AppUi
       
    89      *
       
    90      * @since S60 v5.0
       
    91      * @return key id array
       
    92      */      
       
    93     RArray<TInt>& ReservedKeys();
       
    94 
       
    95     /**
       
    96      * Handles cases when plugin leaves in critical point.
       
    97      * See more details in CCCAppView-classes similar method.
       
    98      * (Set as virtual because this is called from the CCCAppViewPluginAknView (ccapputil.dll))
       
    99      *
       
   100      * @since S60 v5.0
       
   101      */      
       
   102     virtual void RecoverFromBadPluginL();
       
   103     
       
   104 // from base class CCoeAppUi
       
   105 
       
   106     /**
       
   107      * From CCoeAppUi
       
   108      * (see details from header)
       
   109      *
       
   110      * @since S60 v5.0
       
   111      */
       
   112 	TKeyResponse HandleKeyEventL(
       
   113 	    const TKeyEvent& aKeyEvent,
       
   114 	    TEventCode aType );
       
   115 	    
       
   116 	void HandleWsEventL( const TWsEvent &aEvent, CCoeControl *aDestination );
       
   117 
       
   118 private:
       
   119 
       
   120 // from base class CEikAppUi
       
   121 
       
   122     /**
       
   123      * From CEikAppUi
       
   124      * (see details from header)
       
   125      *
       
   126      * @since S60 v5.0
       
   127      */
       
   128     void HandleCommandL( TInt aCommand );
       
   129     
       
   130     /**
       
   131      * From CEikAppUi
       
   132      * (see details from header)
       
   133      *
       
   134      * @since S60 v5.0
       
   135      */
       
   136     void PrepareToExit();
       
   137 
       
   138 
       
   139 // from base class CAknAppUi    
       
   140     
       
   141     /**
       
   142      * From CAknAppUi
       
   143      * (see details from header)
       
   144      *
       
   145      * @since S60 v5.0
       
   146      */
       
   147     TErrorHandlerResponse HandleError(
       
   148         TInt aError, 
       
   149         const SExtendedError& aExtErr,  
       
   150         TDes& aErrorText, 
       
   151         TDes& aContextText );
       
   152     
       
   153 private:
       
   154 
       
   155     /**
       
   156      * Loads the settings from CenRep.
       
   157      * In case of error some default values are used.
       
   158      *
       
   159      * @since S60 v5.0
       
   160      */
       
   161     void LoadSettingsL();
       
   162 
       
   163 private:
       
   164 
       
   165     void ConstructL();
       
   166 	
       
   167 public:
       
   168     /**
       
   169      * Sets the title of the View Plugin
       
   170      * @param aTitle - the title to be set for the Plugin View     
       
   171      * @since S60 v5.0
       
   172      * 
       
   173      */
       
   174     virtual void SetTitleL( const TDesC& aTitle );
       
   175 
       
   176 private: // data
       
   177 
       
   178     /**
       
   179      * Pointer to tab view.
       
   180      * Own.
       
   181      */
       
   182     CCCAppView* iCCAppView;
       
   183     
       
   184     /**
       
   185      * Pointer to CCA parameter.
       
   186      * Own.
       
   187      */    
       
   188     CCCAParameter* iCCAParameter;
       
   189     
       
   190     /**
       
   191      * Keys for view navigation
       
   192      */
       
   193      TInt       iNextViewKey;
       
   194      TInt       iPrevViewKey;
       
   195      
       
   196     /**
       
   197      * Flag for settings loading
       
   198      */
       
   199      TBool      iSettingsLoaded;
       
   200 
       
   201      /**
       
   202       * For loading the settings. 
       
   203       * Own.
       
   204       */     
       
   205      CRepository* iRepository;
       
   206 
       
   207      /**
       
   208       * Ids of reserved keys
       
   209       */     
       
   210       RArray<TInt> iReservedKeys;
       
   211     };
       
   212 
       
   213 #endif // __CCAAPP_APPUI_H__
       
   214 
       
   215 //End Of File