ipcm_plat/mpm_default_connection_api/inc/rmpmdefaultconnection.h
branchGCC_SURGE
changeset 49 faa5ef4f80da
parent 39 f10336de0cd6
parent 47 cb7afde124a3
equal deleted inserted replaced
39:f10336de0cd6 49:faa5ef4f80da
     1 /*
       
     2 * Copyright (c) 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:  Client interface to MPM Default Connection server
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef RMPMDEFAULTCONNECTION_H
       
    19 #define RMPMDEFAULTCONNECTION_H
       
    20 
       
    21 #include <e32std.h>
       
    22 
       
    23 /**
       
    24  *  Cleant API for MPM Default Connection server
       
    25  *  services.
       
    26  *
       
    27  *  Enables registering IAP to be used as default connection. 
       
    28  *  Only one client may be connected at a time 
       
    29  *  @code
       
    30  *  RMPMDefaultConnection rmpmdc;
       
    31  *  TInt err = KErrNone;
       
    32  *  //connect and set default IAP
       
    33  *  err = rmpmdc.Connect();
       
    34  *  err = rmpmdc.SetDefaultIAP( iapId );
       
    35  *
       
    36  *  //when IAP no longer used as default
       
    37  *  err = rmpmdc.ClearDefaultIAP();
       
    38  *  rmpmdc.Close();
       
    39  *  @endcode
       
    40  *
       
    41  *  @lib mpmdefaultconnection.dll
       
    42  *  @since S60 v3.2
       
    43  */
       
    44 class RMPMDefaultConnection : public RSessionBase
       
    45     {
       
    46 
       
    47 public:
       
    48 
       
    49     /**
       
    50      * Constructor.
       
    51      *
       
    52      * @since S60 v3.2
       
    53      */
       
    54     inline RMPMDefaultConnection() : RSessionBase(), 
       
    55     iClientConnected( EFalse )
       
    56     {};
       
    57 
       
    58     /**
       
    59      * Creates connection to server
       
    60      *
       
    61      * @since S60 v3.2
       
    62      * @return KErrNone if successful, otherwise one of the
       
    63      * system-wide error codes
       
    64      */
       
    65     IMPORT_C TInt Connect();
       
    66 
       
    67     /**
       
    68      * Closes connection to server
       
    69      * If IAP has been registered by the client it is also deregistered here
       
    70      *
       
    71      * @since S60 v3.2
       
    72      */
       
    73     IMPORT_C void Close();
       
    74 
       
    75     /**
       
    76      * Sets IAP to be used as default connection
       
    77      *
       
    78      * @since S60 v3.2
       
    79      * @param aIapId CommsDat record id of the IAP
       
    80      * @return KErrNone if successful, otherwise one of the
       
    81      * system-wide error codes
       
    82      */
       
    83     IMPORT_C TInt SetDefaultIAP( TInt aIapId );
       
    84 
       
    85 
       
    86     /**
       
    87      * Clears IAP from being used as default connection
       
    88      *
       
    89      * @since S60 v3.2
       
    90      * @param aIapId CommsDat record id of the IAP
       
    91      * @return KErrNone if successful, otherwise one of the
       
    92      * system-wide error codes
       
    93      */
       
    94     IMPORT_C TInt ClearDefaultIAP();
       
    95     
       
    96     /**
       
    97      * Returns MPM Default Connection server version.
       
    98      * @since 3.2
       
    99      * @return Version of the MPM Default Connection server
       
   100      */
       
   101      IMPORT_C TVersion Version() const;
       
   102     
       
   103 private: // data
       
   104 
       
   105     /**
       
   106      * Is client connected to server or not
       
   107      */
       
   108      TBool iClientConnected;    
       
   109 
       
   110     };
       
   111 
       
   112 #endif // RMPMDEFAULTCONNECTION_H