cmmanager/cmmgr/cmmapi/inc/cmconnectionmethodwrapper.h
changeset 20 9c97ad6591ae
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
       
     1 /*
       
     2 * Copyright (c) 2009-2010 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:
       
    15 * Collects API calls from RCmConnectionMethod- and
       
    16 * RCmConnectionMethodExt-classes.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef CMCONNECTIONMETHODWRAPPER_H
       
    22 #define CMCONNECTIONMETHODWRAPPER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "cmconnectionmethodapi.h"
       
    26 
       
    27 class RCmManagerApi;
       
    28 
       
    29 
       
    30 NONSHARABLE_CLASS( CCmConnectionMethodWrapper ) : public CBase
       
    31     {
       
    32 public:
       
    33     static CCmConnectionMethodWrapper* NewL();
       
    34     static CCmConnectionMethodWrapper* NewLC();
       
    35     virtual ~CCmConnectionMethodWrapper();
       
    36 
       
    37 public:
       
    38     CCmConnectionMethodWrapper();
       
    39 
       
    40 public:
       
    41     void GetConnMethodWithIdL(
       
    42             RCmManagerApi* aCmManagerApi,
       
    43             const TUint32 aIapId,
       
    44             TInt& aExistingHandle );
       
    45     void GetConnMethodFromDestWithIndexL(
       
    46             RCmManagerApi* aCmManagerApi,
       
    47             const TInt aDestHandle,
       
    48             const TInt aIndex,
       
    49             TInt& aExistingHandle );
       
    50     void GetConnMethodFromDestWithIdL(
       
    51             RCmManagerApi* aCmManagerApi,
       
    52             const TInt aDestHandle,
       
    53             const TInt aIapId,
       
    54             TInt& aExistingHandle );
       
    55     void CreateConnMethodL(
       
    56             RCmManagerApi* aCmManagerApi,
       
    57             const TUint32 aBearerType );
       
    58     void CreateConnMethodWithIdL(
       
    59             RCmManagerApi* aCmManagerApi,
       
    60             const TUint32 aBearerType,
       
    61             const TUint32 aIapId );
       
    62     TInt CreateConnMethodCopy(
       
    63             RCmManagerApi* aCmManagerApi,
       
    64             const TInt aConnMethodHandle );
       
    65     void CreateConnMethodToDestL(
       
    66             RCmManagerApi* aCmManagerApi,
       
    67             const TInt aDestHandle,
       
    68             const TUint32 aBearerType );
       
    69     void CreateConnMethodToDestWithIdL(
       
    70             RCmManagerApi* aCmManagerApi,
       
    71             const TInt aDestHandle,
       
    72             const TUint32 aBearerType,
       
    73             const TUint32 aIapId );
       
    74 
       
    75     TInt GetIntAttribute(
       
    76             const TUint32 aAttribute,
       
    77             TUint32& aValue );
       
    78     TInt GetBoolAttribute(
       
    79             const TUint32 aAttribute,
       
    80             TBool& aValue );
       
    81     TInt GetStringAttribute(
       
    82             const TUint32 aAttribute,
       
    83             HBufC* aBuffer );
       
    84     TInt GetString8Attribute(
       
    85             const TUint32 aAttribute,
       
    86             HBufC8* aBuffer );
       
    87 
       
    88     TInt SetIntAttribute(
       
    89             const TUint32 aAttribute,
       
    90             const TUint32 aValue );
       
    91     TInt SetBoolAttribute(
       
    92             const TUint32 aAttribute,
       
    93             const TBool aValue );
       
    94     TInt SetStringAttribute(
       
    95             const TUint32 aAttribute,
       
    96             const TDesC16& aValue );
       
    97     TInt SetString8Attribute(
       
    98             const TUint32 aAttribute,
       
    99             const TDesC8& aValue );
       
   100 
       
   101     TInt Update();
       
   102     TInt Refresh();
       
   103     TInt Delete( TBool& aResult );
       
   104     TInt IsEqual( const TInt aHandle, TBool& aResult );
       
   105 
       
   106     TBool SessionConnected() const;
       
   107     void CloseSession();
       
   108     TInt GetHandle() const;
       
   109     RCmManagerApi* GetMainSession() const;
       
   110 
       
   111     void IncreaseReferenceCounter();
       
   112     TInt DecreaseReferenceCounter();
       
   113 
       
   114 private:
       
   115     // Subsession to server representing this connection method handle.
       
   116     RCmConnectionMethodApi iCmConnectionMethodApi;
       
   117 
       
   118     // Pointer for main session to server.
       
   119     RCmManagerApi* iCmManagerApi; // Not owned.
       
   120 
       
   121     // Counts the number of references client has to this specific handle.
       
   122     TInt iReferenceCounter;
       
   123     };
       
   124 
       
   125 #endif // CMCONNECTIONMETHODWRAPPER_H
       
   126 
       
   127 // End of file