2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Connection Method interface class.
18 #ifndef CMCONNECTIONMETHOD_H
19 #define CMCONNECTIONMETHOD_H
23 #include <cmconnectionmethoddef.h>
26 class CCmPluginBaseEng;
30 * RCmConnectionMethod is for getting/setting values of a connection method.
34 NONSHARABLE_CLASS( RCmConnectionMethod )
36 //=====================================================================
37 // Constructors/Destructors
42 * Default constructor.
44 IMPORT_C RCmConnectionMethod();
50 IMPORT_C RCmConnectionMethod(const RCmConnectionMethod& aItem);
56 IMPORT_C ~RCmConnectionMethod();
58 //=====================================================================
67 IMPORT_C void Close();
70 * Gets the value for a TInt attribute.
73 * @param aAttribute Identifies the attribute to be retrieved.
74 * @return contains the requested TInt attribute.
76 IMPORT_C TUint32 GetIntAttributeL( TUint32 aAttribute ) const;
79 * Gets the value for a TBool attribute.
82 * @param aAttribute Identifies the attribute to be retrieved.
83 * @return contains the requested TBool attribute.
85 IMPORT_C TBool GetBoolAttributeL( TUint32 aAttribute ) const;
88 * Gets the value for a String16 attribute.
89 * HBuf ownership is passed to the caller
92 * @param aAttribute Identifies the attribute to be retrieved.
93 * @return copy of the requested attribute. Ownership is passed.
95 IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const;
98 * Gets the value for a String8 attribute.
99 * HBuf ownership is passed to the caller
102 * @param aAttribute Identifies the attribute to be retrieved.
103 * @return copy of the requested attribute. Ownership is passed.
105 IMPORT_C HBufC8* GetString8AttributeL(
106 const TUint32 aAttribute ) const;
109 * Call this function only if this CM is an embedded destination!
112 * @return embedded destination
114 IMPORT_C RCmDestination DestinationL() const;
118 * checks if connection methods are the same
121 * @param aConnMethod the connection method being compared
122 * @return ETrue if the destinations are the same
124 IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const;
127 * checks if connection methods are not the same
130 * @param aConnMethod the connection method being compared
131 * @return ETrue if the destinations are different
133 IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const;
137 * assignment operator
140 * @return RCmConnectionMethod
142 IMPORT_C RCmConnectionMethod& operator=(const RCmConnectionMethod&
146 * Creates a copy of this connection method. UpdateL() has to be called
147 * to store new connection method in database. Ownership is passed.
149 IMPORT_C RCmConnectionMethod CreateCopyL();
152 * Sets the value for a TInt attribute.
153 * @param aAttribute Identifies the attribute to be set.
154 * @param aValue The value to be set.
157 IMPORT_C void SetIntAttributeL( TUint32 aAttribute, TUint32 aValue );
160 * Sets the value for a TBool attribute.
161 * @param aAttribute Identifies the attribute to be set.
162 * @param aValue The value to be set.
165 IMPORT_C void SetBoolAttributeL( TUint32 aAttribute, TBool aValue );
168 * Sets the value for a String16 attribute.
169 * @param aAttribute Identifies the attribute to be set.
170 * @param aValue The value to be set.
173 IMPORT_C void SetStringAttributeL( TUint32 aAttribute,
174 const TDesC16& aValue );
177 * Sets the value for a String8 attribute.
178 * @param aAttribute Identifies the attribute to be set.
179 * @param aValue The value to be set.
182 IMPORT_C void SetString8AttributeL( TUint32 aAttribute,
183 const TDesC8& aValue );
186 * Try to delete the connection method. If it is referenced from
187 * any destination, then the references are removed and the
188 * connection method is deleted.
189 * Do NOT call this function if you got this
190 * connection method from a destination. Call destination's
191 * DeleteConnectionMethodL() function instead.
192 * @return ETrue if connection method deleted.
194 IMPORT_C TBool DeleteL();
197 * Update in the database.
200 IMPORT_C void UpdateL();
204 friend class RCmDestination;
205 friend class RCmManager;
210 * the implementation class
212 CCmPluginBaseEng* iImplementation;
215 #include <cmconnectionmethod.inl>
217 #endif // CMCONNECTIONMETHOD_H