commsconfig/cscengine/inc/cscengcchhandler.h
branchRCL_3
changeset 21 f742655b05bf
parent 20 65a3ef1d5bd0
child 22 d38647835c2e
equal deleted inserted replaced
20:65a3ef1d5bd0 21:f742655b05bf
     1 /*
       
     2 * Copyright (c) 2007-2007 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:  For handling interactions betweed UI and CCH.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef C_CSCENGCCHHANDLER_H
       
    21 #define C_CSCENGCCHHANDLER_H
       
    22 
       
    23 #include <cch.h>
       
    24 
       
    25 class MCSCEngCCHObserver;
       
    26 
       
    27 /**
       
    28  * TSupportedSubServices class
       
    29  *
       
    30  * @lib cscengine.lib
       
    31  * @since Series 60 3.2
       
    32  */
       
    33 NONSHARABLE_CLASS ( TSupportedSubServices )
       
    34     {
       
    35     public:
       
    36     
       
    37         /**
       
    38          * Constructor.
       
    39          *
       
    40          * @since S60 3.2
       
    41          */
       
    42         TSupportedSubServices()
       
    43             : iVoIP( EFalse ),
       
    44             iPresence( EFalse ),
       
    45             iIm( EFalse ),
       
    46             iVmbx( EFalse )
       
    47             {}
       
    48 
       
    49     public: // data
       
    50         
       
    51         /*
       
    52          * VoIP
       
    53          */
       
    54         TBool iVoIP;
       
    55     
       
    56         /*
       
    57          * Presence
       
    58          */
       
    59         TBool iPresence;
       
    60     
       
    61         /*
       
    62          * Instant Messaging
       
    63          */
       
    64         TBool iIm;
       
    65         
       
    66         /*
       
    67          * Voice mail box
       
    68          */
       
    69         TBool iVmbx;
       
    70     };
       
    71 
       
    72 
       
    73 /**
       
    74  * An instance of CCSCEngCCHHandler
       
    75  * For handling interactions betweed UI and CCH.
       
    76  *
       
    77  * @lib cscengine.lib
       
    78  * @since Series 60 3.2
       
    79  */
       
    80 NONSHARABLE_CLASS( CCSCEngCCHHandler ) : public CBase, 
       
    81                                                 MCchServiceStatusObserver
       
    82     {    
       
    83     public:
       
    84                 
       
    85         /**
       
    86          * Two-phased constructor.
       
    87          */ 
       
    88         IMPORT_C static CCSCEngCCHHandler* NewL( 
       
    89             MCSCEngCCHObserver& aObserver );
       
    90 
       
    91 
       
    92         /**
       
    93          * Destructor.
       
    94          */
       
    95         virtual ~CCSCEngCCHHandler();
       
    96         
       
    97         
       
    98         /**
       
    99          * Disable service
       
   100          *
       
   101          * @since S60 v5.0
       
   102          * @param aServiceId service id
       
   103          * @return Error code.
       
   104          */
       
   105         IMPORT_C TInt DisableService( TInt aServiceId );
       
   106         
       
   107                 
       
   108         /**
       
   109          * Get supported subservices
       
   110          *
       
   111          * @since S60 v5.0
       
   112          * @param aServiceId service id
       
   113          * @param aSupSubServices supported subservices
       
   114          */
       
   115         IMPORT_C void SupportedSubServicesL( 
       
   116                 TInt aServiceId, 
       
   117                 TSupportedSubServices& aSupSubservices );
       
   118         
       
   119         
       
   120         /**
       
   121          * Get cch connection parameter (RBuf)
       
   122          *
       
   123          * @since S60 v5.0
       
   124          * @param aServiceId service id
       
   125          * @param aConnParam cch connection parameter
       
   126          * @param aConnParamValue connection parameter value
       
   127          * @return Error code.
       
   128          */
       
   129         IMPORT_C TInt GetConnectionParameter( 
       
   130             TInt aServiceId, 
       
   131             TCchConnectionParameter aConnParam,
       
   132             RBuf& aConnParamValue );
       
   133         
       
   134         
       
   135         /**
       
   136          * Get cch connection parameter( TInt )
       
   137          *
       
   138          * @since S60 v5.0
       
   139          * @param aServiceId service id
       
   140          * @param aConnParam cch connection parameter
       
   141          * @param aConnParamValue connection parameter value
       
   142          * @return Error code.
       
   143          */
       
   144         IMPORT_C TInt GetConnectionParameter( 
       
   145             TInt aServiceId, 
       
   146             TCchConnectionParameter aConnParam,
       
   147             TInt& aConnParamValue );
       
   148         
       
   149         
       
   150         /**
       
   151          * Set cch connection parameter
       
   152          *
       
   153          * @since S60 v5.0
       
   154          * @param aServiceId service id
       
   155          * @param aConnParam cch connection parameter
       
   156          * @param aConnParamValue connection parameter value
       
   157          * @return Error code.
       
   158          */
       
   159         IMPORT_C TInt SetConnectionParameter( 
       
   160             TInt aServiceId, 
       
   161             TCchConnectionParameter aConnParam,
       
   162             const TDesC& aConnParamValue );
       
   163         
       
   164         
       
   165         /**
       
   166          * For checking if service is disabled
       
   167          *
       
   168          * @since S60 v3.2
       
   169          * @param aServiceId service id
       
   170          * @return ETrue if service is disabled
       
   171          */
       
   172         IMPORT_C TBool IsServiceDisabled( TInt aServiceId );
       
   173                
       
   174         
       
   175         /**
       
   176          * For checking if service is valid (some subservice(s) is supported)
       
   177          *
       
   178          * @since S60 v5.0
       
   179          * @param aServiceId service id
       
   180          * @return ETrue if service is valid
       
   181          */
       
   182         IMPORT_C TBool IsServiceValidL( TInt aServiceId );
       
   183         
       
   184     private:
       
   185 
       
   186         CCSCEngCCHHandler( 
       
   187             MCSCEngCCHObserver& aObserver );
       
   188 
       
   189         void ConstructL();
       
   190         
       
   191         
       
   192         /**
       
   193          * Returns ETrue if subservice is disabled
       
   194          * 
       
   195          * @since S60 v5.0
       
   196          * @param aServiceId Service id.
       
   197          * @param aType Subservice type.
       
   198          * @return ETrue if subservice is disabled
       
   199          */
       
   200         TBool IsDisabled( TInt aServiceId, TCCHSubserviceType aType );
       
   201         
       
   202         
       
   203         // from base class MCchServiceStatusObserver
       
   204         
       
   205         /**
       
   206          *  From MCchServiceStatusObserver
       
   207          * 
       
   208          * @since S60 v5.0
       
   209          * @param aServiceId Service id.
       
   210          * @param aType Subservice type.
       
   211          * @return aServiceStatus service status.
       
   212          */
       
   213         void ServiceStatusChanged( 
       
   214             TInt aServiceId, 
       
   215             TCCHSubserviceType aType, 
       
   216             const TCchServiceStatus& aServiceStatus );
       
   217         
       
   218     private:  // data
       
   219         
       
   220         /**
       
   221          * Reference for observer.
       
   222          */
       
   223         MCSCEngCCHObserver& iObserver;
       
   224                
       
   225         /**
       
   226          * Handle to CCH Client API.
       
   227          * Own.
       
   228          */
       
   229         CCch* iCchClientApi;
       
   230         
       
   231 #ifdef _DEBUG
       
   232     friend class UT_CSCEngCchHandler;
       
   233 #endif 
       
   234     };
       
   235 
       
   236 #endif // C_CSCENGCCHHANDLER_H