phoneengine/servicehandling/inc/cpeservicehandling.h
branchRCL_3
changeset 62 5266b1f337bd
parent 61 41a7f70b3818
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
    18 
    18 
    19 #ifndef C_PESERVICEHANDLING_H
    19 #ifndef C_PESERVICEHANDLING_H
    20 #define C_PESERVICEHANDLING_H
    20 #define C_PESERVICEHANDLING_H
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
       
    23 #include <cch.h>
    23 #include "mpeservicehandling.h"
    24 #include "mpeservicehandling.h"
    24 
    25 
    25 class  MPEPhoneModelInternal;
    26 class  MPEPhoneModelInternal;
    26 
    27 
    27 /**
    28 /**
    30  *  
    31  *  
    31  *  @lib peservicehandling.lib
    32  *  @lib peservicehandling.lib
    32  *  @since S60 v5.0
    33  *  @since S60 v5.0
    33  */
    34  */
    34 NONSHARABLE_CLASS( CPEServiceHandling ): public CBase,
    35 NONSHARABLE_CLASS( CPEServiceHandling ): public CBase,
       
    36                                          public MCchServiceStatusObserver,
    35                                          public MPEServiceHandling
    37                                          public MPEServiceHandling
    36     {
    38     {
    37 
    39 
    38     public: // Constructors and destructor
    40 	public: // Constructors and destructor
    39 
    41 
    40         /**
    42 	    /**
    41          * Two-phased constructor.
    43 	     * Two-phased constructor.
    42          */
    44 	     */
    43         IMPORT_C static CPEServiceHandling* NewL( MPEPhoneModelInternal& aModel );
    45 	    IMPORT_C static CPEServiceHandling* NewL( MPEPhoneModelInternal& aModel );
    44 
    46 
    45         /**
    47 	    /**
    46          * Two-phased constructor.
    48 	     * Two-phased constructor.
    47          */
    49 	     */
    48         IMPORT_C static CPEServiceHandling* NewLC( MPEPhoneModelInternal& aModel );
    50 	    IMPORT_C static CPEServiceHandling* NewLC( MPEPhoneModelInternal& aModel );
    49 
    51 
    50         /**
    52 	    /**
    51          * Destructors.
    53 	     * Destructors.
    52          */
    54 	     */
    53         IMPORT_C virtual ~CPEServiceHandling();
    55 	    IMPORT_C virtual ~CPEServiceHandling();
    54 
    56 
    55     public: // from MPEServiceHandling
    57 	public: // from MPEServiceHandling
    56     
    58 	
    57         /**
    59         /**
    58          * From MPEServiceHandling.
    60          * From MPEServiceHandling.
    59          * Enables service defined by the given identifier.
    61          * Enables service defined by the given identifier.
    60          * This function does the service enabling and service status error checking.
    62          * This function does the service enabling and service status error checking.
    61          * If service is enabled successfully, send message 
    63          * If service is enabled successfully, send message 
    62          * (EPEMessageServiceEnabled) to PhoneEngine. 
    64          * (EPEMessageServiceEnabled) to PhoneEngine. 
    63          * 
    65          * 
    64          * @since   S60 5.0
    66          * @since   S60 5.0
    65          * @param   aServiceId      Identifier of the service.
    67          * @param   aServiceId      Identifier of the service.
    66          */                                     
    68          */	                                    
    67         void EnableServiceL( TInt aServiceId );
    69 	    void EnableServiceL( TInt aServiceId );
    68        
    70 	   
    69         /**
    71         /**
    70          * From MPEServiceHandling.
    72          * From MPEServiceHandling.
    71          * Cancel current service.
    73          * Cancel current service.
    72          */ 
    74          */ 
    73         void CancelServiceEnabling() const;
    75 	    void CancelServiceEnabling() const;
    74         
    76 	    
    75         /**
    77         /**
    76          * From MPEServiceHandling.
    78          * From MPEServiceHandling.
    77          * Disable service.
    79          * Disable service.
    78          */ 
    80          */ 
    79         void DisableService() const;
    81         void DisableService() const;
    80     
    82     
    81     private: // Constructors
    83     public: // from MCchServiceStatusObserver
       
    84         
       
    85         /**
       
    86          * From MCchServiceStatusObserver.
       
    87          * Signaled when service status or error changes.
       
    88          *
       
    89          * @param   aServiceId      Identifier of the service.
       
    90          * @param   aType           Service type.
       
    91          * @param   aServiceStatus  Service status.
       
    92          */
       
    93         void ServiceStatusChanged( TInt aServiceId, 
       
    94                                    const TCCHSubserviceType aType,
       
    95                                    const TCchServiceStatus& aServiceStatus );
       
    96 	private: // Constructors
    82 
    97 
    83         /**
    98         /**
    84          * C++ default constructor.
    99          * C++ default constructor.
    85          */
   100          */
    86         CPEServiceHandling( MPEPhoneModelInternal& aModel );
   101         CPEServiceHandling( MPEPhoneModelInternal& aModel );
    87         
   102         
    88         /**
   103         /**
    89          * By default Symbian 2nd phase constructor is private.
   104          * By default Symbian 2nd phase constructor is private.
    90          */
   105          */
    91         void ConstructL();
   106         void ConstructL();
    92                
   107 	    
    93     private: // data
   108     private: // functions
    94         
   109     
    95         /**
   110         /**
    96          * PhoneModel.
   111          * Enable service, if not already enabled.
    97          * Not own.
   112          *
       
   113          * @param  aState       Service state.
       
   114          * @param  aService     Service.
       
   115          * @return Error code.
    98          */
   116          */
    99         MPEPhoneModelInternal& iModel;
   117         TInt EnableServiceIfNeeded( const TCCHSubserviceState& aState, 
   100         
   118                                     CCchService& aService );
   101         /**
   119         /**
   102          * Current service identifier.
   120         * Sends ServiceHandlingError message to PhoneEngine and saves 
   103          */
   121         * errorcode to member variable.
   104         TInt iCurrentServiceId;
   122         * 
       
   123         * @param  aErrorCode, Cch errorcode.
       
   124         */	    
       
   125         void SendErrorMessage( TInt aErrorCode );
       
   126        
       
   127 	private: // data
       
   128 	    
       
   129 	    /**
       
   130 	     * CCH client.
       
   131 	     * Own.
       
   132 	     */
       
   133 	    CCch* iCchClient;
       
   134 
       
   135 	    /**
       
   136 	     * PhoneModel.
       
   137 	     * Not own.
       
   138 	     */
       
   139 	    MPEPhoneModelInternal& iModel;
       
   140 	    
       
   141 	    /**
       
   142 	     * Current service identifier.
       
   143 	     */
       
   144 	    TInt iCurrentServiceId;
   105     };
   145     };
   106 
   146 
   107 #endif // C_PESERVICEHANDLING_H
   147 #endif // C_PESERVICEHANDLING_H