clock2/clockui/uilayer/inc/clockappui.h
changeset 0 f979ecb2b13e
child 30 d68a4b5d5885
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2008 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:   This is the header file for the CClockAppUi class.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __CLOCK_APPUI_H__
       
    19 #define __CLOCK_APPUI_H__
       
    20 
       
    21 // System includes
       
    22 #include <aknViewAppUi.h>
       
    23 #include <AknTabObserver.h>
       
    24 #include <iaupdateobserver.h>     
       
    25 #include <iaupdate.h>
       
    26 #include <iaupdateparameters.h>
       
    27 #include <iaupdateresult.h>
       
    28 
       
    29 // User includes
       
    30 #include "clkcommon.h"
       
    31 
       
    32 // Forward declarations
       
    33 class CEnvironmentChangeNotifier;
       
    34 class CAknNavigationControlContainer;
       
    35 class CAknTabGroup;
       
    36 class CAknNavigationDecorator;
       
    37 class CIAUpdate;
       
    38 class CIAUpdateParameters;
       
    39 
       
    40 // Class declaration
       
    41 /**
       
    42 * @class CClockAppUi
       
    43 * @brief The CAknViewAppUi inheriting class.
       
    44 * @exe clock.exe
       
    45 */
       
    46 class CClockAppUi : public CAknViewAppUi,
       
    47                     public MAknTabObserver,
       
    48                     public MIAUpdateObserver
       
    49 	{
       
    50 	public:            // Constructor and destructor
       
    51 
       
    52 		/**
       
    53 		* @brief C++ default constructor
       
    54 		*/
       
    55 	    CClockAppUi();
       
    56 		
       
    57         /**
       
    58         * @brief Destructor.
       
    59         */
       
    60         ~CClockAppUi();
       
    61         
       
    62 	public:            // From base classes
       
    63 	
       
    64 		/**
       
    65 		* @brief From CAknViewAppUi. Handles menu commands.
       
    66 		* @param aCommandId The id of the command to be handled.
       
    67 		*/
       
    68 		void HandleCommandL( TInt aCommandId );
       
    69 		
       
    70 		/**
       
    71         * @brief From MAknTabObserver. Called when tab is changed.
       
    72         * @param aIndex The index of the Active tab.
       
    73         * @see MAknTabObserver
       
    74         */
       
    75 		void TabChangedL( TInt aIndex );
       
    76 		
       
    77 		/**
       
    78 		* @brief From CCoeAppUi. Called when a key is pressed.
       
    79 		* @param aKeyEvent Encapsulates the key event.
       
    80 		* @param aType The type of the event.
       
    81 		* @return TKeyResponse Return if the event was handled or not.
       
    82 		* @see CCoeAppUi
       
    83 		*/
       
    84 		TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    85 		
       
    86 		/**
       
    87 		* @brief From CAknAppUi. Called for all window server events.
       
    88 		* @param aForeground ETrue if the app is being brought to the foreground. EFalse otherwise.
       
    89 		*/
       
    90 		void HandleForegroundEventL( TBool aForeground );
       
    91 			
       
    92 		/**
       
    93 		* @brief From MIAUpdateObserver.
       
    94 		* @param aErrorCode The error code of the observed update operation.
       
    95 		*                  KErrNone for successful completion,otherwise a system wide error code.
       
    96 		* @param aAvailableUpdates Number of the updates that were found available.
       
    97 		*/
       
    98 		void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
    99 		
       
   100 		/**
       
   101 		* @brief From MIAUpdateObserver.
       
   102 		* @param aErrorCode The error code of the completed update operation.
       
   103 		*                   KErrNone for successful completion, 
       
   104 		*                   otherwise a system wide error code.
       
   105 		* @param aResultDetails Details about the completed update operation.
       
   106 		*                       Ownership is transferred.
       
   107 		*/
       
   108 		void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   109 		
       
   110 		/**
       
   111 		* @brief From MIAUpdateObserver.
       
   112 		* @param aErrorCode The error code of the observed query operation.
       
   113 		*                   KErrNone for successful completion, 
       
   114 		*                   otherwise a system wide error code.
       
   115 		* @param aUpdateNow ETrue informs that an update operation should be started.
       
   116 		*                   EFalse informs that there is no need to start an update
       
   117 		*                   operation.
       
   118         */
       
   119 		void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow );
       
   120 		
       
   121 	public:            // New functions
       
   122 	    
       
   123 	    /**
       
   124 	    * @brief Handles the environment changes.
       
   125 	    * @param aEnvChanged Of type TClockEnvChanged.
       
   126 	    */
       
   127 	    void HandleEnvChangeL( TClockEnvChanged aEnvChanged );
       
   128 	    
       
   129 	    /**
       
   130         * @brief Sets the main view title pane text.
       
   131         * @param aResourceId Resource from which the title pane text is read.
       
   132         */
       
   133 	    void SetTitlePaneTextL( TInt aResourceId );
       
   134 
       
   135 	    
       
   136 	    /**
       
   137         * @brief Sets or Resets the appHidden flag.
       
   138         * @param aAppHidden ETrue to hide, else EFalse.
       
   139         */
       
   140         void SetAppHidden( TBool aAppHidden );
       
   141         
       
   142         /**
       
   143         * @brief Returns the value of iAppHidden
       
   144         * @return TBool ETrue if the app was Exit hidden.
       
   145         */
       
   146         TBool IsAppExitHidden();
       
   147         
       
   148         /**
       
   149         * @brief Hides or Un-hides the navigation pane.
       
   150         * @param aVisible ETrue, pane will be visible. EFalse will be hidden.
       
   151         * @param aViewId The ID used to activate the corresponding tab.
       
   152         */
       
   153         void MakeNavigationPaneVisible( TBool aVisible, TInt aViewId );
       
   154         
       
   155         /**
       
   156         * @brief Handles IAD related updates.
       
   157         */
       
   158         void HandleIADUpdateL();
       
   159 		
       
   160 	private:           // New functions
       
   161 	
       
   162 		/**
       
   163 		* @brief Symbian OS constructor. Performs the second phase of construction. May leave.
       
   164 		*/
       
   165 		void ConstructL();
       
   166 		
       
   167 		/**
       
   168 		* @brief Callback function for environment change notifications.
       
   169 		* @param aPtr The TAny* to 'this'.
       
   170 		* @return TInt Symbian OS error code.
       
   171 		*/
       
   172 		static TInt NotifierCallbackL( TAny* aPtr );
       
   173 		
       
   174 		/**
       
   175         * @brief Opens the date and time settings view
       
   176         */
       
   177 		void OpenSettingsViewL();
       
   178 		
       
   179 		/**
       
   180         * @brief Resets the state of the application to what it was initially.
       
   181         */
       
   182         void ResetToInitialStateL();
       
   183         
       
   184         /**
       
   185         * @brief Sets the navigation pane with tabs.
       
   186         */
       
   187         void SetupNavigationPaneL();
       
   188         
       
   189 	private:           // Data
       
   190 	    
       
   191 	    /**
       
   192 	    * @var iEnvChangeNotifier
       
   193 	    * @brief An object of CEnvironmentChangeNotifier. Used to get notifications for changes in
       
   194 	    *        environment.
       
   195 	    */
       
   196 	    CEnvironmentChangeNotifier*         iEnvChangeNotifier;
       
   197 	    
       
   198 	    /**
       
   199         * @var iAppHidden 
       
   200         * @brief ETrue if app is hidden in the background.
       
   201         */
       
   202         TBool                               iAppHidden;
       
   203         
       
   204         /**
       
   205         * @var iNaviPane
       
   206         * @brief The navigation pane decorator.
       
   207         */
       
   208         CAknNavigationControlContainer*     iNaviPane;
       
   209         
       
   210         /**
       
   211         * @var iTabGroup
       
   212         * @brief The tab group.
       
   213         */
       
   214         CAknTabGroup*						iTabGroup;
       
   215         
       
   216         /**
       
   217         * @var iNavigationDecorator
       
   218         * @brief The navigation decorator.
       
   219         */
       
   220         CAknNavigationDecorator*			iNavigationDecorator;
       
   221 
       
   222         /**
       
   223         * @var iIADUpdateFlag
       
   224         * @brief the flag is true for the first time and it is made false after IAD updates
       
   225         *        And it is made true again while exiting.
       
   226         */
       
   227         TBool                               iIADUpdateFlag;
       
   228         
       
   229         /**
       
   230         * @var iUpdate
       
   231         * @brief Object of CIAUpdate class.
       
   232         */
       
   233         CIAUpdate*                          iUpdate;
       
   234         
       
   235         /**
       
   236         * @var iParameters
       
   237         * @brief Object of CIAUpdateParameters class.
       
   238         */
       
   239         CIAUpdateParameters*                iParameters;
       
   240 	};
       
   241 
       
   242 #endif 		// __CLOCK_APPUI_H__
       
   243 
       
   244 // End of file