imstutils/imconversationview/imcvuiengine/inc/cimcvenginecchhandler.h
changeset 15 81eeb8c83ce5
parent 0 5e5d6b214f4f
equal deleted inserted replaced
0:5e5d6b214f4f 15:81eeb8c83ce5
     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_CIMCVENGINECCHHANDLER_H
       
    20 #define     C_CIMCVENGINECCHHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <cch.h>
       
    25 
       
    26 #include "cimcvengine.h"
       
    27 #include "mimcvenginecchhandler.h"
       
    28 #include "mimcvenginecchobserver.h"
       
    29 class CSPSettings;
       
    30 // CLASS DECLARATION
       
    31 /**
       
    32  *  CCH handler
       
    33  *  This class implements the handling of CCH
       
    34  *
       
    35  *  @lib imcvengine.lib
       
    36  *  @since S60 5.0
       
    37  */
       
    38  
       
    39  
       
    40 NONSHARABLE_CLASS( CIMCVEngineCchHandler ) : public CBase,
       
    41 										public MIMCVEngineCchHandler,
       
    42 										public MCchServiceStatusObserver
       
    43     {
       
    44     public:
       
    45 
       
    46         /**
       
    47          * Two-phased constructor.
       
    48          * @param aServiceId, service id to monitor
       
    49          */
       
    50         static CIMCVEngineCchHandler* NewL(TUint aServiceId, 
       
    51         								CIMCVEngine& aEngine);
       
    52 
       
    53         /**
       
    54          * Two-phased constructor.
       
    55          * @param aServiceId, service id to monitor
       
    56          */
       
    57         static CIMCVEngineCchHandler* NewLC(TUint aServiceId, 
       
    58         									CIMCVEngine& aEngine);
       
    59         
       
    60         /**
       
    61          * Standard C++ destructor
       
    62          */    
       
    63         ~CIMCVEngineCchHandler();
       
    64         
       
    65 	/**
       
    66          * Register for CCh Events
       
    67 	 * @param aObserver - Observer
       
    68          */
       
    69         void RegisterObserver(MIMCVEngineCCHObserver* aObserver);
       
    70 	
       
    71 	/**
       
    72          * UnRegister for CCh Events
       
    73 	 * 
       
    74          */
       
    75 	void UnRegisterObserver();
       
    76 
       
    77         /**
       
    78          * Gets service state
       
    79          *
       
    80          * @since S60 5.0         
       
    81          * @param aCCHState service state (result)
       
    82          * @return TInt Standard Symbian error code
       
    83          */         
       
    84          TInt GetServiceState(TCCHSubserviceState& aCCHState);
       
    85 
       
    86         /**
       
    87          * Enables service
       
    88          *
       
    89          * @since S60 5.0         
       
    90          * @return TInt, error code
       
    91          */
       
    92         TInt EnableService();
       
    93             
       
    94         
       
    95         /**
       
    96          * Returns the User Id for this service
       
    97          * Returns HbufC* and the caller of this function should deallocate the same
       
    98          * @since S60 5.0         
       
    99          * @return HBufC*
       
   100          */
       
   101         HBufC* GetUserIdL();
       
   102         
       
   103         /**
       
   104          * Returns the XimpFw Protocol UID for this service
       
   105          * Returns TInt 
       
   106          * @since S60 5.0         
       
   107          * @return TInt , error code
       
   108          */
       
   109         TInt GetAdapterUidL(); 
       
   110         
       
   111         /**
       
   112          * Disables service
       
   113          *
       
   114          * @since S60 5.0         
       
   115          * @return TInt, error code
       
   116          */
       
   117         TInt DisableService();        
       
   118         
       
   119     
       
   120     	/**
       
   121          * IsServiceLoggedIn
       
   122          *
       
   123          * @since S60 5.0         
       
   124          * 
       
   125          * @return ETrue - if Service Logged In, EFalse - Service Not Logged In
       
   126          */         
       
   127          TBool IsServiceLoggedIn();
       
   128     
       
   129     private:
       
   130     	// methods from MCchServiceStatusObserver
       
   131         
       
   132         /**
       
   133          * @see MCchServiceStatusObserver
       
   134          */
       
   135 		void ServiceStatusChanged(
       
   136 				TInt aServiceId,
       
   137 				const TCCHSubserviceType aType,
       
   138 				const TCchServiceStatus& aServiceStatus );    
       
   139 				
       
   140 		void DoHandleServiceStatusChangedL(
       
   141 				TInt aServiceId,
       
   142 				const TCCHSubserviceType aType,
       
   143 				const TCchServiceStatus& aServiceStatus ); 				 
       
   144     private: // Implementation
       
   145 
       
   146         /**
       
   147          * Standard C++ constructor
       
   148          */    
       
   149         CIMCVEngineCchHandler(TUint aServiceId, 
       
   150         						CIMCVEngine& aEngine);
       
   151         
       
   152         /**
       
   153          * Performs the 2nd phase of construction.
       
   154          *
       
   155          */        
       
   156         void ConstructL();
       
   157 
       
   158    				
       
   159     private: // Data    
       
   160 
       
   161 		// Own: CCH Client
       
   162 		CCch*	iCchClient;		
       
   163 		
       
   164 		TUint iServiceId;	//Service Id
       
   165 		
       
   166 		CIMCVEngine& iEngine; //engine
       
   167 		
       
   168 		//doesnt own
       
   169 		MIMCVEngineCCHObserver* iObserver;
       
   170         
       
   171     };
       
   172 
       
   173 #endif // C_CIMCVENGINECCHHANDLER_H
       
   174 
       
   175 // End of file