imstutils/imconversationview/imcvuiapp/inc/cimcvappui.h
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2007-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:  application enviroment
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CIMCVAPPUI_H
       
    19 #define CIMCVAPPUI_H
       
    20 
       
    21 #include <aknappui.h>
       
    22 #include <aknViewAppUi.h>
       
    23 #include "mimcvappui.h"
       
    24 // Forward reference
       
    25 class CIMCVAppMessageExtensionsHandler;
       
    26 class CIMCVAppLayoutInfo;
       
    27 class MIMCVAppLayoutInfo;
       
    28 class MIMCVEngineFactory;
       
    29 class CIMCVAppView;
       
    30 class CIMCVAppStatusPaneHandler;
       
    31 class MIMCVAppLayoutChangeObserver;
       
    32 class MIMCVAppResourceChangeObserver;
       
    33 class TAknLayoutScalableParameterLimits;
       
    34 class TAknWindowComponentLayout;
       
    35 class MIMCVUiAppSkinVariant;
       
    36 class CIMCVAppInputAbsorber;
       
    37 class CIMCVEngine;
       
    38 
       
    39 
       
    40 /*! 
       
    41   @class CIMCVAppUi
       
    42   
       
    43   @discussion An instance of class CIMCVAppUi is the UserInterface part of the AVKON
       
    44   application framework for the conversationview example application
       
    45   */
       
    46 class CIMCVAppUi :public CAknViewAppUi,
       
    47 				  public MIMCVAppUi
       
    48 		    {
       
    49 		public:
       
    50 		/*!
       
    51 		  @function ConstructL
       
    52 		  
       
    53 		  @discussion Perform the second phase construction of a CIMCVAppUi object
       
    54 		  this needs to be public due to the way the framework constructs the AppUi 
       
    55 		  */
       
    56 		    void ConstructL();
       
    57 
       
    58 		/*!
       
    59 		  @function CIMCVAppUi
       
    60 		  
       
    61 		  @discussion Perform the first phase of two phase construction.
       
    62 		  This needs to be public due to the way the framework constructs the AppUi 
       
    63 		  */
       
    64 		    CIMCVAppUi();
       
    65 
       
    66 
       
    67 		/*!
       
    68 		  @function ~CIMCVAppUi
       
    69 		  
       
    70 		  @discussion Destroy the object and release all memory objects
       
    71 		  */
       
    72 		    ~CIMCVAppUi();
       
    73 		 
       
    74 		 /**
       
    75 		* return ETrue if deletion is happening
       
    76 		*/ 
       
    77 		 TBool IsUnderDestruction() ;
       
    78 		   
       
    79 		/**
       
    80 		* return the mbn full resource path
       
    81 		*/ 
       
    82 		TDes& MbmFullPath();
       
    83 		/**
       
    84 		* StorePreviousViewDetails store the previce application and view details 
       
    85 		* @param aPreviousApplicationUid application uid
       
    86 		* @param aPreviousViewUid ,previous active view uid
       
    87 		*/
       
    88 		void StorePreviousViewDetails(TInt aPreviousApplicationUid,TInt aPreviousViewUid);
       
    89 		
       
    90 		/**
       
    91 		* switch application to background 	
       
    92 		*/
       
    93 		void SendMeToBackground();
       
    94 		
       
    95 		
       
    96 		/**
       
    97 		* switch application to foreground 
       
    98 		* @param aAppUid application uid
       
    99 		*/
       
   100 		void BringToForeground( TUid aAppUid );
       
   101 		
       
   102 	    /**
       
   103          * constructs mif and rsc file paths based on branding, else
       
   104          * initializes with default s60 path.
       
   105          * @since S60 5.0
       
   106          */  
       
   107 		void ConstructBrandL( );
       
   108 		
       
   109 		/**
       
   110          * reconstructs the mif and rsc's after the uninstallation of the brand.
       
   111          * initializes with default s60 path.
       
   112          * @since S60 5.0
       
   113          */
       
   114 		void ReInitializeBrandL();
       
   115 		
       
   116 		/**
       
   117 		 * Releases branding access.
       
   118 		 */
       
   119 		void ReleaseBrandAccess();        
       
   120        
       
   121 		/**
       
   122 		 * SkinVariantL
       
   123 		 */
       
   124 		
       
   125 		MIMCVUiAppSkinVariant*	SkinVariantL();
       
   126 		
       
   127 		/**
       
   128 		 * is the application in Foreground
       
   129 		 * @param Return True - if Application in Foreground else returns False
       
   130 		 */
       
   131 		TBool IsAppInForeground();
       
   132 		
       
   133 		/*
       
   134 		 * return active engine isntance
       
   135 		 */
       
   136 		CIMCVEngine& ActiveEngine() const ;
       
   137 		
       
   138 	public: 		    
       
   139 	
       
   140 			 /**
       
   141 		 * Adds layout change observer
       
   142 		 * @param aObserver Pointer to observer
       
   143 		 */
       
   144          void AddLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) ;
       
   145 
       
   146 		/**
       
   147 		 * Removes layout observer
       
   148 		 * @param aObserver Pointer to removed observer
       
   149 		 */
       
   150          void RemoveLayoutChangeObserver( MIMCVAppLayoutChangeObserver* aObserver ) ;
       
   151         
       
   152 		/**
       
   153 		 * Adds resource observer
       
   154 		 * @param aObserver Pointer to observer
       
   155 		 */
       
   156         void AddResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) ;
       
   157 
       
   158 		/**
       
   159 		 * Removes resource observer
       
   160 		 * @param aObserver Pointer to removed observer
       
   161 		 */
       
   162          void RemoveResourceChangeObserver( MIMCVAppResourceChangeObserver* aObserver ) ;
       
   163         
       
   164 	public: // from CAknAppUi
       
   165 			/*
       
   166 			@function HandleCommandL
       
   167 			@discussion Handle user menu selections
       
   168 			@param aCommand the enumerated code for the option selected
       
   169 			*/
       
   170 			void HandleCommandL(TInt aCommand);
       
   171 			
       
   172 			/*
       
   173 			@function HandleWsEventL
       
   174 			@param aEvent, event occured Handle user menu selections
       
   175 			@param aDestination , to delivered
       
   176 			*/
       
   177 			void HandleWsEventL( const TWsEvent& aEvent,CCoeControl* aDestination );
       
   178 
       
   179 			/*
       
   180 			@function LayoutInfo
       
   181 			@return  pointer to layout info
       
   182 			*/
       
   183 			MIMCVAppLayoutInfo* LayoutInfo();
       
   184 			/**
       
   185 			* From CEikAppui, Handles a change to the application's resources
       
   186 			* which are shared across the environment
       
   187 			* @param aType The type of resources that have changed
       
   188 			*/
       
   189 			void HandleResourceChangeL( TInt aType );
       
   190 			
       
   191 			/**
       
   192 			* Proceses message from external application
       
   193 			* Used from Phonebooks external tab (Buddylist) to start instant
       
   194 			* messaging or from xmpp server to show new messages
       
   195 			*
       
   196 			* @since S60 v3.0
       
   197 			* @param aUid       Uid somethig. Needed to get this function called
       
   198 			* @param aParamData Data for processing
       
   199 			*/
       
   200 			void ProcessMessageL( TUid aUid, const TDesC8& aParamData );
       
   201   			/**
       
   202 			* @since S60 v3.0
       
   203 			* from CAknViewAppUi
       
   204 			* @param aForeground   , ETrue if in Forground else Background
       
   205 			*/
       
   206 			 void HandleForegroundEventL( TBool aForeground );
       
   207     
       
   208 	
       
   209     public : // new functions
       
   210     			
       
   211 			
       
   212 			/**
       
   213 			* shut down and exit the application 
       
   214 			*/
       
   215 			void ShutDownAndCloseApplicationL();			
       
   216 		
       
   217 			/**
       
   218 	         * Capture events if needed
       
   219 	         */
       
   220 	        void CaptureEventsL();
       
   221 
       
   222 	        /**
       
   223 	         * Releases events capturing
       
   224 	         */
       
   225 	        void ReleaseCapturingL();
       
   226 
       
   227 	        /**
       
   228 	         * Returns if events are captured
       
   229 	         * @return ETrue if captured
       
   230 	         */
       
   231 	        TBool AreEventsCaptured() const;
       
   232 	        
       
   233 	     
       
   234         
       
   235 	private :
       
   236 		   	        
       
   237 	        /**
       
   238 	         * CCalculatePreviewPaneWidth  
       
   239 	         */
       
   240 	        void CalculatePreviewPaneWidth();
       
   241 	        
       
   242 	        /**
       
   243 	         * SelectWindowVariety variety from window
       
   244 	         * @param aNumberOfLines lines to be used
       
   245 	         * @param aLimits ,limits
       
   246 	         */	        
       
   247 	        TInt SelectWindowVariety( const TInt aNumberOfLines, const TAknLayoutScalableParameterLimits& aLimits ) const;
       
   248         	/**
       
   249 	         * RectFromLayout rect from layout
       
   250 	         * @param aParent parant
       
   251 	         * @param aComponentLayout layout
       
   252 	         * @return rect
       
   253 	         */
       
   254         	TRect RectFromLayout( const TRect& aParent,	const TAknWindowComponentLayout& aComponentLayout ) const;
       
   255         	
       
   256         	/**
       
   257              * Prepares branding access
       
   258              *
       
   259              * @since S60 5.0
       
   260              */  
       
   261 			TInt PrepareBrandingAccess();
       
   262 
       
   263                 	        
       
   264         	 /**
       
   265         	  * handle connection close and exit the servicetab also
       
   266         	  * @param aEventValue, the event value to publish
       
   267         	  */
       
   268         	 void HandleServiceCloseExitL(TInt aEventValue );
       
   269 	
       
   270 	private:
       
   271 			
       
   272 			// owned , refrence to message hadler    
       
   273 		    CIMCVAppMessageExtensionsHandler* iMessageHandler;
       
   274 		    
       
   275 		    // onwed, layout info
       
   276 			CIMCVAppLayoutInfo* iLayoutInfo;
       
   277 			
       
   278 			// owned, reference to imcvuiengine component
       
   279 			MIMCVEngineFactory* iEngineFactory ;
       
   280 			      
       
   281         	 // owned , used to set the tile, label icon in title pane
       
   282        		 CIMCVAppStatusPaneHandler* iStatusPaneHandler;
       
   283        		       		 
       
   284        		RPointerArray<MIMCVAppLayoutChangeObserver> iLayoutObservers;
       
   285         
       
   286         	// Doesn't own objects. Array of resource observers
       
   287         	RPointerArray<MIMCVAppResourceChangeObserver> iResourceObservers;
       
   288        		
       
   289        		TFileName		iChatMbmFullPath;
       
   290        		
       
   291        		// phonebook application uid
       
   292         	TInt iPbkApplicationUid;
       
   293         	// phonebook active view id
       
   294        		TInt iPbkActiveViewUid;
       
   295        		// owned
       
   296        		MIMCVUiAppSkinVariant* iSkinVariant;
       
   297        		
       
   298        		TBool iDestructingFlag;
       
   299        		
       
   300        		TBool iServerDisconnected;
       
   301        		
       
   302        		//owns the instance of the inputobserver
       
   303        		CIMCVAppInputAbsorber* iInputAbsorber;
       
   304        		//not Owns : pointer to view
       
   305        		CIMCVAppView* iCIMCVAppView;
       
   306        		
       
   307        		//is app in forground or background
       
   308        		TBool iIsAppForeground;
       
   309        		
       
   310 		    };
       
   311 
       
   312 
       
   313 #endif // CIMCVAPPUI_H
       
   314