uiservicetab/vimpstengine/inc/cvimpstenginecchhandler.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     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:  Class handling the use of Cch
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef     C_CVIMPSTENGINECCHHANDLER_H
       
    20 #define     C_CVIMPSTENGINECCHHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <cch.h>
       
    25 #include <cchuiobserver.h>
       
    26 #include "mvimpstenginecchhandlerobserver.h"
       
    27 #include "tvimpstenums.h"
       
    28 #include "mvimpstenginecchuieventobserver.h"
       
    29 
       
    30 #include "cvimpstsettingsstore.h"
       
    31 /**
       
    32  *  structure.
       
    33  */
       
    34 struct TObserverStructure
       
    35 	{
       
    36 	MVIMPSTEngineCchHandlerObserver* iObserver; /* observer */
       
    37 	TCCHSubserviceType iSubserviceType; /* subservice type(IM/VOIP/PRESENCE */
       
    38 	}; 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42  *  CCH handler
       
    43  *  This class implements the handling of CCH
       
    44  *
       
    45  *  @lib vimpstengine.lib
       
    46  *  @since S60 5.0
       
    47  */ 
       
    48 NONSHARABLE_CLASS( CVIMPSTEngineCchHandler ) : public CBase,
       
    49 							 public MCchServiceStatusObserver,
       
    50 							 public MCchUiObserver
       
    51 							 
       
    52     {
       
    53     //for test cases.
       
    54     friend class T_VimpstEngineCchHandler;
       
    55     public:
       
    56 
       
    57         /**
       
    58          * Two-phased constructor.
       
    59          * @param aServiceId, service id to monitor
       
    60          * @return a new instace of this class
       
    61          */
       
    62         static CVIMPSTEngineCchHandler* NewL(TUint aServiceId, MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver);
       
    63 
       
    64         /**
       
    65          * Two-phased constructor.
       
    66          * @param aServiceId, service id to monitor
       
    67          * @return a new instace of this class
       
    68          * 
       
    69          */
       
    70         static CVIMPSTEngineCchHandler* NewLC(TUint aServiceId,MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver );
       
    71         
       
    72         /**
       
    73          * Standard C++ destructor
       
    74          */    
       
    75         ~CVIMPSTEngineCchHandler();
       
    76         
       
    77         /**
       
    78          * Shuts down connection to CCH.
       
    79          *
       
    80          * @since S60 5.0
       
    81          * @return None
       
    82          */
       
    83         void ShutdownCch();
       
    84         
       
    85         /**
       
    86          * Gets service state
       
    87          *
       
    88          * @since S60 5.0
       
    89          * @param aServiceId service id
       
    90          * @param aSubServiceType subservice typ(IM/VOIP/PRESENCE)
       
    91          * @param aCCHState state of the cch.
       
    92          * @return TInt Standard Symbian error code
       
    93          */         
       
    94          TInt GetServiceState(TUint aServiceId,
       
    95 									TInt aSubServiceType, 
       
    96 									TCCHSubserviceState& aCCHState
       
    97 									);
       
    98 
       
    99         /**
       
   100          * Enables service
       
   101          * @since S60 5.0
       
   102          * @return TInt, error code
       
   103          */
       
   104         TInt EnableService();
       
   105 
       
   106         /**
       
   107          * Disables service
       
   108          * @since S60 5.0
       
   109          * @return None
       
   110          */
       
   111         TInt DisableService();
       
   112                 
       
   113     
       
   114        	/**
       
   115        	 * Register for CCH Events
       
   116        	 * @param aObserver
       
   117        	 * @param aSubServiceType type of subservice
       
   118        	 */
       
   119         void RegisterCchObserverL(MVIMPSTEngineCchHandlerObserver* aObserver,
       
   120                                                    TCCHSubserviceType aSubServiceType );
       
   121         
       
   122         /**
       
   123        	 * UnRegister for CCH Events
       
   124        	 * @param aSubServiceType - type of subservice
       
   125        	 */                                           
       
   126         void UnRegisterCchObserver( TCCHSubserviceType aSubServiceType );
       
   127         
       
   128         
       
   129         /**
       
   130          * Returns the connection parameters
       
   131          * @param aSubServiceType type of subservice
       
   132          * @return own data - Ownership Transferred to the caller
       
   133          */        
       
   134         HBufC* GetConParametersL(			
       
   135 		    TCchConnectionParameter aConnParam );
       
   136         
       
   137         /**
       
   138          * Set cch connection parameter
       
   139          *
       
   140          * @since S60 v5.0
       
   141          * @param aServiceId service id
       
   142          * @param aConnParam cch connection parameter
       
   143          * @param aConnParamValue connection parameter value
       
   144          * @return Error code.
       
   145          */
       
   146         TInt SetConnectionParameter(
       
   147            TCchConnectionParameter aConnParam,
       
   148            const TDesC& aConnParamValue );
       
   149            
       
   150 		
       
   151 		/**
       
   152 		 * Change Connection
       
   153 		 * Shows CCHUI dialog for changing the Network Connection for this service
       
   154 		 * ECchUiDialogTypeChangeConnection
       
   155 		 * @return Error Code
       
   156 		 */
       
   157 		TInt ChangeConnectionL();
       
   158 		
       
   159 		/**
       
   160 		* For getting cchui api.
       
   161 		* 
       
   162 		* @return reference to cchui api.
       
   163 		*/
       
   164     	MCchUi& CchUiApi() const;
       
   165             
       
   166     	/**
       
   167         * For checking whether password available in settings or not
       
   168         * @param aConnection Param value 
       
   169         * @Return true if password is present in the settings else returns false    
       
   170         */
       
   171     	TBool IsPasswordAvailable( TCchConnectionParameter aConnParam );
       
   172     public: // methods from MCchServiceObserver
       
   173         
       
   174         /**
       
   175          * @see MCchServiceObserver
       
   176          */
       
   177 		void ServiceStatusChanged(
       
   178 				TInt aServiceId,
       
   179 				const TCCHSubserviceType aType,
       
   180 				const TCchServiceStatus& aServiceStatus );
       
   181 
       
   182 		
       
   183 		// methods from MCchUiObserver
       
   184         /**
       
   185 		   * @see MCchUiObserver
       
   186 		 */
       
   187 
       
   188 		void ConnectivityDialogsCompletedL(
       
   189 		        TInt aServiceId, 
       
   190 		        MCchUiObserver::TCchUiOperationResult aOperationResult );
       
   191 
       
   192 		    
       
   193     private: // Implementation
       
   194 
       
   195         /**
       
   196          * Standard C++ constructor
       
   197          * @param aServiceId service id.
       
   198          */    
       
   199         CVIMPSTEngineCchHandler(TUint aServiceId, MVIMPSTEngineCchUiEventObserver& aCchUiEventObserver);
       
   200         
       
   201         /**
       
   202          * Performs the 2nd phase of construction.
       
   203          */        
       
   204         void ConstructL();
       
   205 
       
   206     private: // Data
       
   207     
       
   208         // does not own array of observers.
       
   209         RArray<TObserverStructure> iObserverStructure;
       
   210         MVIMPSTSettingsStore* iSettingsStore;
       
   211 		// Own CCH Client
       
   212 		CCch*	iCchClient;		
       
   213 		
       
   214 		// service id
       
   215 		TUint iServiceId;
       
   216 		MVIMPSTEngineCchUiEventObserver& iCchUiEventObserver;		
       
   217     };
       
   218 
       
   219 #endif // C_CVIMPSTENGINECCHHANDLER_H
       
   220 
       
   221 // End of file