phonebookui/Phonebook2/ccapplication/ccapp/inc/ccaappappui.h
changeset 0 e686773b3f54
child 39 a6539d1e8e43
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     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      * @since S60 v5.0
       
    63      * @param aParameter contains contact information. 
       
    64      *        Ownership is transferred.
       
    65      */
       
    66     void InitializePlugin( CCCAParameter& aParameter );
       
    67 
       
    68     /**
       
    69      * Returns a reference to CCApp parameter
       
    70      *
       
    71      * @since S60 v5.0
       
    72      * @return CCCAParameter reference
       
    73      */        
       
    74     CCCAParameter& Parameter();
       
    75 
       
    76     /**
       
    77      * Returns a reference to EikonEnv
       
    78      *
       
    79      * @since S60 v5.0
       
    80      * @return CEikonEnv reference
       
    81      */        
       
    82     CEikonEnv& EikonEnv();
       
    83 
       
    84     /**
       
    85      * Returns an array of key ids reserved by the AppUi
       
    86      *
       
    87      * @since S60 v5.0
       
    88      * @return key id array
       
    89      */      
       
    90     RArray<TInt>& ReservedKeys();
       
    91 
       
    92     /**
       
    93      * Handles cases when plugin leaves in critical point.
       
    94      * See more details in CCCAppView-classes similar method.
       
    95      * (Set as virtual because this is called from the CCCAppViewPluginAknView (ccapputil.dll))
       
    96      *
       
    97      * @since S60 v5.0
       
    98      */      
       
    99     virtual void RecoverFromBadPluginL();
       
   100     
       
   101 // from base class CCoeAppUi
       
   102 
       
   103     /**
       
   104      * From CCoeAppUi
       
   105      * (see details from header)
       
   106      *
       
   107      * @since S60 v5.0
       
   108      */
       
   109 	TKeyResponse HandleKeyEventL(
       
   110 	    const TKeyEvent& aKeyEvent,
       
   111 	    TEventCode aType );
       
   112 	    
       
   113 	void HandleWsEventL( const TWsEvent &aEvent, CCoeControl *aDestination );
       
   114 
       
   115 private:
       
   116 
       
   117 // from base class CEikAppUi
       
   118 
       
   119     /**
       
   120      * From CEikAppUi
       
   121      * (see details from header)
       
   122      *
       
   123      * @since S60 v5.0
       
   124      */
       
   125     void HandleCommandL( TInt aCommand );
       
   126     
       
   127     /**
       
   128      * From CEikAppUi
       
   129      * (see details from header)
       
   130      *
       
   131      * @since S60 v5.0
       
   132      */
       
   133     void PrepareToExit();
       
   134 
       
   135 
       
   136 // from base class CAknAppUi    
       
   137     
       
   138     /**
       
   139      * From CAknAppUi
       
   140      * (see details from header)
       
   141      *
       
   142      * @since S60 v5.0
       
   143      */
       
   144     TErrorHandlerResponse HandleError(
       
   145         TInt aError, 
       
   146         const SExtendedError& aExtErr,  
       
   147         TDes& aErrorText, 
       
   148         TDes& aContextText );
       
   149     
       
   150 private:
       
   151 
       
   152     /**
       
   153      * Loads the settings from CenRep.
       
   154      * In case of error some default values are used.
       
   155      *
       
   156      * @since S60 v5.0
       
   157      */
       
   158     void LoadSettingsL();
       
   159 
       
   160 private:
       
   161 
       
   162     void ConstructL();
       
   163 	
       
   164 public:
       
   165     /**
       
   166      * Sets the title of the View Plugin
       
   167      * @param aTitle - the title to be set for the Plugin View     
       
   168      * @since S60 v5.0
       
   169      * 
       
   170      */
       
   171     virtual void SetTitleL( const TDesC& aTitle );
       
   172 
       
   173 private: // data
       
   174 
       
   175     /**
       
   176      * Pointer to tab view.
       
   177      * Own.
       
   178      */
       
   179     CCCAppView* iCCAppView;
       
   180     
       
   181     /**
       
   182      * Pointer to CCA parameter.
       
   183      * Own.
       
   184      */    
       
   185     CCCAParameter* iCCAParameter;
       
   186     
       
   187     /**
       
   188      * Keys for view navigation
       
   189      */
       
   190      TInt       iNextViewKey;
       
   191      TInt       iPrevViewKey;
       
   192      
       
   193     /**
       
   194      * Flag for settings loading
       
   195      */
       
   196      TBool      iSettingsLoaded;
       
   197 
       
   198      /**
       
   199       * For loading the settings. 
       
   200       * Own.
       
   201       */     
       
   202      CRepository* iRepository;
       
   203 
       
   204      /**
       
   205       * Ids of reserved keys
       
   206       */     
       
   207       RArray<TInt> iReservedKeys;
       
   208     };
       
   209 
       
   210 #endif // __CCAAPP_APPUI_H__
       
   211 
       
   212 //End Of File