clock2/clockui/uilayer/inc/clockappui.h
branchRCL_3
changeset 66 bd7edf625bdd
child 67 1539a383d7b6
equal deleted inserted replaced
65:12af337248b1 66:bd7edf625bdd
       
     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 class CTransitionEffectManager;
       
    40 class MTouchFeedback;
       
    41 
       
    42 // Class declaration
       
    43 /**
       
    44 * @class CClockAppUi
       
    45 * @brief The CAknViewAppUi inheriting class.
       
    46 * @exe clock.exe
       
    47 */
       
    48 class CClockAppUi : public CAknViewAppUi,
       
    49                     public MAknTabObserver,
       
    50                     public MIAUpdateObserver
       
    51 	{
       
    52     
       
    53     public: // enums
       
    54     
       
    55         enum TTransitionDirection 
       
    56             {
       
    57             ETransitionUndefined = 0,
       
    58             ETransitionLeft,
       
    59             ETransitionRight
       
    60             };    
       
    61     
       
    62 	public:            // Constructor and destructor
       
    63 
       
    64 		/**
       
    65 		* @brief C++ default constructor
       
    66 		*/
       
    67 	    CClockAppUi();
       
    68 		
       
    69         /**
       
    70         * @brief Destructor.
       
    71         */
       
    72         ~CClockAppUi();
       
    73         
       
    74 	public:            // From base classes
       
    75 	
       
    76 		/**
       
    77 		* @brief From CAknViewAppUi. Handles menu commands.
       
    78 		* @param aCommandId The id of the command to be handled.
       
    79 		*/
       
    80 		void HandleCommandL( TInt aCommandId );
       
    81 		
       
    82 		/**
       
    83         * @brief From MAknTabObserver. Called when tab is changed.
       
    84         * @param aIndex The index of the Active tab.
       
    85         * @see MAknTabObserver
       
    86         */
       
    87 		void TabChangedL( TInt aIndex );
       
    88 		
       
    89 		/**
       
    90 		* @brief From CCoeAppUi. Called when a key is pressed.
       
    91 		* @param aKeyEvent Encapsulates the key event.
       
    92 		* @param aType The type of the event.
       
    93 		* @return TKeyResponse Return if the event was handled or not.
       
    94 		* @see CCoeAppUi
       
    95 		*/
       
    96 		TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    97 		
       
    98 		/**
       
    99 		* @brief From CAknAppUi. Called for all window server events.
       
   100 		* @param aForeground ETrue if the app is being brought to the foreground. EFalse otherwise.
       
   101 		*/
       
   102 		void HandleForegroundEventL( TBool aForeground );
       
   103 			
       
   104 		/**
       
   105 		* @brief From MIAUpdateObserver.
       
   106 		* @param aErrorCode The error code of the observed update operation.
       
   107 		*                  KErrNone for successful completion,otherwise a system wide error code.
       
   108 		* @param aAvailableUpdates Number of the updates that were found available.
       
   109 		*/
       
   110 		void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
   111 		
       
   112 		/**
       
   113 		* @brief From MIAUpdateObserver.
       
   114 		* @param aErrorCode The error code of the completed update operation.
       
   115 		*                   KErrNone for successful completion, 
       
   116 		*                   otherwise a system wide error code.
       
   117 		* @param aResultDetails Details about the completed update operation.
       
   118 		*                       Ownership is transferred.
       
   119 		*/
       
   120 		void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   121 		
       
   122 		/**
       
   123 		* @brief From MIAUpdateObserver.
       
   124 		* @param aErrorCode The error code of the observed query operation.
       
   125 		*                   KErrNone for successful completion, 
       
   126 		*                   otherwise a system wide error code.
       
   127 		* @param aUpdateNow ETrue informs that an update operation should be started.
       
   128 		*                   EFalse informs that there is no need to start an update
       
   129 		*                   operation.
       
   130         */
       
   131 		void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow );
       
   132 		
       
   133 	public:            // New functions
       
   134 	    
       
   135 	    /**
       
   136 	    * @brief Handles the environment changes.
       
   137 	    * @param aEnvChanged Of type TClockEnvChanged.
       
   138 	    */
       
   139 	    void HandleEnvChangeL( TClockEnvChanged aEnvChanged );
       
   140 	    
       
   141 	    /**
       
   142         * @brief Sets the main view title pane text.
       
   143         * @param aResourceId Resource from which the title pane text is read.
       
   144         */
       
   145 	    void SetTitlePaneTextL( TInt aResourceId );
       
   146 
       
   147 	    
       
   148 	    /**
       
   149         * @brief Sets or Resets the appHidden flag.
       
   150         * @param aAppHidden ETrue to hide, else EFalse.
       
   151         */
       
   152         void SetAppHidden( TBool aAppHidden );
       
   153         
       
   154         /**
       
   155         * @brief Returns the value of iAppHidden
       
   156         * @return TBool ETrue if the app was Exit hidden.
       
   157         */
       
   158         TBool IsAppExitHidden();
       
   159         
       
   160         TBool TransitionOngoing() const;
       
   161         
       
   162         void SetTransitionOngoing( TBool aTransitionOngoing );
       
   163         
       
   164         TInt TransitionGroupId() const;
       
   165         
       
   166         void SetTransitionGroupId( TInt aId ); 
       
   167         
       
   168         TTransitionDirection TransitionDirection() const;
       
   169         
       
   170         void  SetTransitionDirection( TTransitionDirection aId );  
       
   171         
       
   172         void DoDisappearTransition( CCoeControl* aControl );
       
   173         
       
   174         void DoAppearTransition( CCoeControl* aControl );
       
   175         
       
   176         
       
   177         /**
       
   178         * @brief Hides or Un-hides the navigation pane.
       
   179         * @param aVisible ETrue, pane will be visible. EFalse will be hidden.
       
   180         * @param aViewId The ID used to activate the corresponding tab.
       
   181         */
       
   182         void MakeNavigationPaneVisible( TBool aVisible, TInt aViewId );
       
   183         
       
   184         /**
       
   185         * @brief Handles IAD related updates.
       
   186         */
       
   187         void HandleIADUpdateL();
       
   188 
       
   189         
       
   190         //papercut Ana/Digital No24Rpeat Start- rajender
       
   191 		/**
       
   192         * @brief returns handle to tactile feedback.
       
   193         */
       
   194         MTouchFeedback* GetFeedback();
       
   195 		//papercut Ana/Digital No24Rpeat End- rajender
       
   196 		
       
   197 	private:           // New functions
       
   198 	
       
   199 		/**
       
   200 		* @brief Symbian OS constructor. Performs the second phase of construction. May leave.
       
   201 		*/
       
   202 		void ConstructL();
       
   203 		
       
   204 		/**
       
   205 		* @brief Callback function for environment change notifications.
       
   206 		* @param aPtr The TAny* to 'this'.
       
   207 		* @return TInt Symbian OS error code.
       
   208 		*/
       
   209 		static TInt NotifierCallbackL( TAny* aPtr );
       
   210 		
       
   211 		/**
       
   212         * @brief Opens the date and time settings view
       
   213         */
       
   214 		void OpenSettingsViewL();
       
   215 		
       
   216 		/**
       
   217         * @brief Resets the state of the application to what it was initially.
       
   218         */
       
   219         void ResetToInitialStateL();
       
   220         
       
   221         /**
       
   222         * @brief Sets the navigation pane with tabs.
       
   223         */
       
   224         void SetupNavigationPaneL();
       
   225         
       
   226 	private:           // Data
       
   227 	    
       
   228 	    /**
       
   229 	    * @var iEnvChangeNotifier
       
   230 	    * @brief An object of CEnvironmentChangeNotifier. Used to get notifications for changes in
       
   231 	    *        environment.
       
   232 	    */
       
   233 	    CEnvironmentChangeNotifier*         iEnvChangeNotifier;
       
   234 	    
       
   235 	    /**
       
   236         * @var iAppHidden 
       
   237         * @brief ETrue if app is hidden in the background.
       
   238         */
       
   239         TBool                               iAppHidden;
       
   240         
       
   241         /**
       
   242         * @var iNaviPane
       
   243         * @brief The navigation pane decorator.
       
   244         */
       
   245         CAknNavigationControlContainer*     iNaviPane;
       
   246         
       
   247         /**
       
   248         * @var iTabGroup
       
   249         * @brief The tab group.
       
   250         */
       
   251         CAknTabGroup*						iTabGroup;
       
   252         
       
   253         /**
       
   254         * @var iNavigationDecorator
       
   255         * @brief The navigation decorator.
       
   256         */
       
   257         CAknNavigationDecorator*			iNavigationDecorator;
       
   258 
       
   259         /**
       
   260         * @var iIADUpdateFlag
       
   261         * @brief the flag is true for the first time and it is made false after IAD updates
       
   262         *        And it is made true again while exiting.
       
   263         */
       
   264         TBool                               iIADUpdateFlag;
       
   265         
       
   266         /**
       
   267         * @var iUpdate
       
   268         * @brief Object of CIAUpdate class.
       
   269         */
       
   270         CIAUpdate*                          iUpdate;
       
   271         
       
   272         /**
       
   273         * @var iParameters
       
   274         * @brief Object of CIAUpdateParameters class.
       
   275         */
       
   276         CIAUpdateParameters*                iParameters;
       
   277         
       
   278         TBool iTransitionOngoing;
       
   279         TInt  iTransitionGroupId;
       
   280         TBool   iTactileFeedbackSupported;
       
   281         TTransitionDirection iTransitionDirection;
       
   282         
       
   283         MTouchFeedback*  iFeedback;
       
   284 	};
       
   285 
       
   286 #endif 		// __CLOCK_APPUI_H__
       
   287 
       
   288 // End of file