|
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 TInt GetIcon( HBufC* aBuffer ); |
|
94 TInt SetIcon( const TDesC& aValue); |
|
95 |
|
96 TBool SessionConnected(); |
|
97 void CloseSession(); |
|
98 TInt GetHandle() const; |
|
99 RCmManagerApi* GetMainSession() const; |
|
100 |
|
101 void IncreaseReferenceCounter(); |
|
102 TInt DecreaseReferenceCounter(); |
|
103 |
|
104 private: |
|
105 // Subsession to server representing this destination handle. |
|
106 RCmDestinationApi iCmDestinationApi; |
|
107 |
|
108 // Pointer for main session to server. |
|
109 RCmManagerApi* iCmManagerApi; // Not owned. |
|
110 |
|
111 // Counts the number of references client has to this specific handle. |
|
112 TInt iReferenceCounter; |
|
113 }; |
|
114 |
|
115 #endif // CMDESTINATIONWRAPPER_H |
|
116 |
|
117 // End of file |