cmmanager/cmmgr/cmmapi/inc/cmdestinationwrapper.h
changeset 20 9c97ad6591ae
child 27 489cf6208544
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 RCmDestination- and RCmDestinationExt-classes.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CMDESTINATIONWRAPPER_H
       
    21 #define CMDESTINATIONWRAPPER_H
       
    22 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "cmdestinationapi.h"
       
    26 
       
    27 class RCmManagerApi;
       
    28 
       
    29 
       
    30 NONSHARABLE_CLASS( CCmDestinationWrapper ) : public CBase
       
    31     {
       
    32 public:
       
    33     static CCmDestinationWrapper* NewL();
       
    34     static CCmDestinationWrapper* NewLC();
       
    35     virtual ~CCmDestinationWrapper();
       
    36 
       
    37 public:
       
    38     CCmDestinationWrapper();
       
    39 
       
    40 public:
       
    41     void GetDestWithIdL(
       
    42             RCmManagerApi* aCmManagerApi,
       
    43             const TUint32 aId,
       
    44             TInt& aExistingHandle );
       
    45     void CreateDestByNameL(
       
    46             RCmManagerApi* aCmManagerApi,
       
    47             const TDesC& aName );
       
    48     void CreateDestByNameAndIdL(
       
    49             RCmManagerApi* aCmManagerApi,
       
    50             const TDesC& aName,
       
    51             const TUint32 aId );
       
    52     void GetConnMethodAsEmbeddedDestL(
       
    53             RCmManagerApi* aCmManagerApi,
       
    54             const TInt aConnMethodHandle,
       
    55             TInt& aExistingHandle );
       
    56 
       
    57     TInt ConnectionMethodCount( TInt& aCount );
       
    58     TInt Priority( const TInt aHandle, TUint& aPriority );
       
    59     TInt GetName( HBufC* aBuffer );
       
    60     TInt GetId( TUint32& aId );
       
    61     TInt GetElementId( TUint32& aElementId );
       
    62     TInt GetMetadata(
       
    63             const TUint32 aMetadataField,
       
    64             TUint32& aValue );
       
    65     TInt GetProtectionLevel( TInt& aProtectionLevel );
       
    66 
       
    67     TInt AddConnectionMethod(
       
    68             const TInt aConnMethodHandle,
       
    69             TInt& aIndex );
       
    70     TInt AddEmbeddedDestination(
       
    71             const TInt aDestHandle,
       
    72             TInt& aIndex );
       
    73     TInt DeleteConnectionMethod(
       
    74             const TInt aConnMethodHandle);
       
    75     TInt RemoveConnectionMethod(
       
    76             const TInt aConnMethodHandle );
       
    77 
       
    78     TInt ModifyPriority(
       
    79             const TInt aConnMethodHandle,
       
    80             const TUint aIndex );
       
    81     TInt SetName( const TDesC& aValue );
       
    82     TInt SetMetadata(
       
    83             const TUint32 aMetaField,
       
    84             const TUint32 aValue );
       
    85     TInt SetProtection( const TInt aValue );
       
    86     TInt SetHidden( const TBool aHidden );
       
    87     TInt Update();
       
    88     TInt Refresh();
       
    89     TInt Delete();
       
    90     TInt IsConnected( TBool& aResult );
       
    91     TInt IsHidden( TBool& aResult );
       
    92     TInt IsEqual( const TInt aHandle, TBool& aResult );
       
    93 
       
    94     TBool SessionConnected();
       
    95     void CloseSession();
       
    96     TInt GetHandle() const;
       
    97     RCmManagerApi* GetMainSession() const;
       
    98 
       
    99     void IncreaseReferenceCounter();
       
   100     TInt DecreaseReferenceCounter();
       
   101 
       
   102 private:
       
   103     // Subsession to server representing this destination handle.
       
   104     RCmDestinationApi iCmDestinationApi;
       
   105 
       
   106     // Pointer for main session to server.
       
   107     RCmManagerApi* iCmManagerApi; // Not owned.
       
   108 
       
   109     // Counts the number of references client has to this specific handle.
       
   110     TInt iReferenceCounter;
       
   111     };
       
   112 
       
   113 #endif // CMDESTINATIONWRAPPER_H
       
   114 
       
   115 // End of file