iptel_plat/cch_client_api/inc/cchclient.h
changeset 0 a4daefaec16c
child 20 65a3ef1d5bd0
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 2006-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:  RCCHClient declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef R_CCHCLIENT_H
       
    20 #define R_CCHCLIENT_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 
       
    26 #include "CCHServer.h"
       
    27 #include "CCHClientServer.h"
       
    28 
       
    29 // CONSTANTS
       
    30 // None
       
    31 
       
    32 // MACROS
       
    33 // None
       
    34 
       
    35 // DATA TYPES
       
    36 // None
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 // None
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 // None
       
    43 
       
    44 // CLASS DECLARATION
       
    45     
       
    46 /**
       
    47  *  RCCHClient declaration.
       
    48  *  A CCH sub-session object. This sub-session provides the functionality
       
    49  *  for CCH.
       
    50  *  @lib cchclient.lib
       
    51  *  @since S60 3.2
       
    52  */
       
    53 class RCCHClient : public RSubSessionBase
       
    54     {
       
    55 
       
    56 public: // Constructors and destructor
       
    57     
       
    58     /**
       
    59      * C++ default constructor
       
    60      */
       
    61     IMPORT_C RCCHClient();
       
    62     
       
    63     /**
       
    64      * Destructor.
       
    65      */
       
    66     IMPORT_C virtual ~RCCHClient();
       
    67 
       
    68 public: // New functions
       
    69 
       
    70     /**
       
    71      * Opens a new sub-session to CCH within an existing session.
       
    72      * @since S60 3.2
       
    73      * @param aRCCHServer Open CCH session
       
    74      * @return General Symbian error code
       
    75      */
       
    76     IMPORT_C TInt Open( const RCCHServer& aRCCHServer );
       
    77     
       
    78     /**
       
    79      * Close sub-session to CCH server
       
    80      * @since S60 3.2
       
    81      */
       
    82     IMPORT_C void Close();
       
    83     
       
    84     /**
       
    85      * Register to server
       
    86      * If CCH server crashes, Symbian will complete this message with KErrServerTerminated,
       
    87      * CCH client is possible to create new handle to CCH server
       
    88      * @since S60 5.0
       
    89      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
    90      * system-wide error codes
       
    91      */
       
    92     IMPORT_C void RegisterToServer( TRequestStatus& aReqStatus ) const;
       
    93 
       
    94     /**
       
    95      * Cancel register server request
       
    96      * @since S60 5.0
       
    97      */
       
    98     IMPORT_C void RegisterToServerCancel( ) const;
       
    99     
       
   100     /**
       
   101      * Subscribe to specific service events, if any service's subservices 
       
   102      * status has changed, CCH sends notify to the client. 
       
   103      * @since S60 3.2
       
   104      * @param aServiceSelection Which service's or type of subservices
       
   105      * client wants to be notified, if aServiceSelection iServiceId is zero and
       
   106      * iType is ECCHUnknown then all subservice events are selected
       
   107      * @param aServiceStatus On completion contains selected service's status
       
   108      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   109      * system-wide error codes
       
   110      */
       
   111     IMPORT_C void SubscribeToEvents( const TServiceSelection& aServiceSelection,
       
   112                                      TPckgBuf<TServiceStatus>& aServiceStatus,
       
   113                                      TRequestStatus& aReqStatus ) const;
       
   114                                      
       
   115     /**
       
   116      * Cancel all subscribe event request.
       
   117      * @since S60 3.2
       
   118      */
       
   119     IMPORT_C void SubscribeToEventsCancel() const;
       
   120       
       
   121     /**
       
   122      * Get services. Client queries for all services and sub-services, 
       
   123      * network scan is performed.
       
   124      * @since S60 3.2
       
   125      * @param aServices On completion contains all services and subservices
       
   126      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   127      * system-wide error codes
       
   128      */
       
   129     IMPORT_C void GetServicesL( CArrayFixFlat<TCCHService>& aServices,
       
   130                                 TRequestStatus& aReqStatus );
       
   131     
       
   132     /**
       
   133      * Get services. Client queries for certain services or type of 
       
   134      * subservices, network scan is not performed.
       
   135      * @since S60 3.2
       
   136      * @param aServiceSelection Which service's or type of subservices
       
   137      * client wants to get, if aServiceSelection iServiceId is zero and 
       
   138      * iType is ECCHUnknown then all services are selected
       
   139      * @param aServices On completion contains all selected service and 
       
   140      * subservices
       
   141      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   142      * system-wide error codes.
       
   143      */
       
   144     IMPORT_C void GetServicesL( const TServiceSelection& aServiceSelection,
       
   145                                 CArrayFixFlat<TCCHService>& aServices,
       
   146                                 TRequestStatus& aReqStatus );
       
   147                                
       
   148     /**
       
   149      * Cancel get services request.
       
   150      * @since S60 3.2
       
   151      */
       
   152      IMPORT_C void GetServicesCancel() const;
       
   153                                 
       
   154     /**
       
   155      * Client asks for the state of service or subservice of a certain 
       
   156      * service. To perform operation quickly, network scan is not performed.
       
   157      * @since S60 3.2
       
   158      * @param aServiceSelection Which service's state client wants to get.
       
   159      * aServiceSelection's iServiceId and iType are compulsory
       
   160      * @param aState On completion contains selected service's state. 
       
   161      * @return General symbian error code
       
   162      */
       
   163     IMPORT_C TInt GetServiceState( const TServiceSelection& aServiceSelection,
       
   164                                    TCCHSubserviceState& aState ) const;
       
   165           
       
   166     /**
       
   167      * Enable services. All sub-services under the service are enabled.
       
   168      * @since S60 3.2
       
   169      * @param aServiceSelection Which service's or type of subservices
       
   170      * client wants to enable, aServiceSelection's iServiceId and iType 
       
   171      * are compulsory
       
   172      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   173      * system-wide error codes.
       
   174      * @param aConnectivityCheck If value is True Connectivity Plug-in will
       
   175      * make test call to check is the connection truly working.
       
   176      */
       
   177     IMPORT_C void EnableService( const TServiceSelection& aServiceSelection,
       
   178                                  TRequestStatus& aReqStatus,
       
   179                                  TBool aConnectivityCheck = EFalse ) const;
       
   180                                  
       
   181     /**
       
   182      * Cancel enable services request.
       
   183      * @since S60 3.2
       
   184      */
       
   185     IMPORT_C void EnableServiceCancel() const;                                 
       
   186                                  
       
   187     /**
       
   188      * Client disables service. All sub-services under the service are 
       
   189      * disabled.
       
   190      * @since S60 3.2
       
   191      * @param aServiceSelection Which service's or type of subservices
       
   192      * client wants to disable, aServiceSelection's iServiceId and iType 
       
   193      * are compulsory
       
   194      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   195      * system-wide error codes.
       
   196      */
       
   197     IMPORT_C void DisableService( const TServiceSelection& aServiceSelection,
       
   198                                   TRequestStatus& aReqStatus ) const;
       
   199                                   
       
   200     /**
       
   201      * Cancel disable service request.
       
   202      * @since S60 3.2
       
   203      */
       
   204     IMPORT_C void DisableServiceCancel() const;                                  
       
   205     
       
   206     /**
       
   207      * Get service specifics information about service and protocol
       
   208      * @since S60 3.2
       
   209      * @param aServiceSelection Which service's or type of subservices
       
   210      * client wants get service information, aServiceSelection's iServiceId 
       
   211      * and iType are compulsory
       
   212      * @param aBuffer On completion contains selected service's protocol
       
   213      * information, aBuffer's max length is in KCCHMaxProtocolNameLength
       
   214      * which is defined in CCHClientServer.h-file
       
   215      * @return General symbian error code.  
       
   216      */
       
   217     IMPORT_C TInt GetServiceInfo( const TServiceSelection& aServiceSelection,
       
   218                                   TDes& aBuffer ) const;
       
   219     
       
   220     /**
       
   221      * Client set's connection information of sub-service of a certain 
       
   222      * service.
       
   223      * @since S60 3.2
       
   224      * @param aServiceConnInfo Service where client wants to set connection
       
   225      * information. Note that iSNAPLocked is read only.
       
   226      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   227      * system-wide error codes.
       
   228      */
       
   229     IMPORT_C void SetConnectionInfo( 
       
   230         const TPckgBuf<TServiceConnectionInfo>& aServiceConnInfo,
       
   231         TRequestStatus& aReqStatus );
       
   232                                      
       
   233     /**
       
   234      * Cancel set connection information request.
       
   235      * @since S60 3.2
       
   236      */
       
   237     IMPORT_C void SetConnectionInfoCancel() const;                                     
       
   238                                      
       
   239     /**
       
   240      * Client ask connection information of subservice of a certain service.
       
   241      * @since S60 3.2
       
   242      * @param aServiceSelection Service which client wants to get connection 
       
   243      * information, aServiceSelection's iServiceId and iType are compulsory
       
   244      * @param aServiceConnInfo On completion contains selected service's 
       
   245      * connection information
       
   246      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   247      * system-wide error codes.
       
   248      */
       
   249     IMPORT_C void GetConnectionInfo( 
       
   250         const TServiceSelection& aServiceSelection,
       
   251         TPckgBuf<TServiceConnectionInfo>& aServiceConnInfo,
       
   252         TRequestStatus& aReqStatus ) const;
       
   253                                      
       
   254     /**
       
   255      * Cancel get connection information request.
       
   256      * @since S60 3.2
       
   257      */
       
   258     IMPORT_C void GetConnectionInfoCancel() const;
       
   259     
       
   260     /**
       
   261      * Client asks for exclusive reservation of the service e.g. to block 
       
   262      * ALR during a VoIP call
       
   263      * @since S60 3.2
       
   264      * @param aServiceSelection Which service client wants to reserve.
       
   265      * aServiceSelection's iServiceId and iType are compulsory
       
   266      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   267      * system-wide error codes.
       
   268      */
       
   269     IMPORT_C TInt ReserveService( const TServiceSelection& aServiceSelection );
       
   270     
       
   271     /**
       
   272      * Client asks to free the exclusive service reservation.
       
   273      * @since S60 3.2
       
   274      * @param aServiceSelection Which service client wants to free.
       
   275      * aServiceSelection's iServiceId and iType are compulsory
       
   276      * @param aReqStatus KErrNone if successful, otherwise another of the 
       
   277      * system-wide error codes.
       
   278      */
       
   279     IMPORT_C TInt FreeService( const TServiceSelection& aServiceSelection );
       
   280     
       
   281     /**
       
   282      * Returns service's reservation status.
       
   283      * @since S60 3.2
       
   284      * @param aServiceSelection Which service's reference count client wants 
       
   285      * to get.
       
   286      * aServiceSelection's iServiceId and iType are compulsory
       
   287      * @return Reservation status
       
   288      */
       
   289     IMPORT_C TBool IsReserved( const TServiceSelection& aServiceSelection ) 
       
   290                     const;
       
   291     
       
   292 private:
       
   293 
       
   294     // Prohibit copy constructor if not deriving from CBase.
       
   295     RCCHClient( const RCCHClient& );
       
   296 
       
   297     // Prohibit assigment operator if not deriving from CBase.
       
   298     RCCHClient& operator=( const RCCHClient& );                                        
       
   299     
       
   300 private:
       
   301 
       
   302     TPtr8* iService;   
       
   303     
       
   304     };
       
   305 
       
   306 #endif // R_CCHCLIENT_H
       
   307 
       
   308 // End of file