9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Destination extended interface class. |
14 * Description: |
|
15 * Destination extended interface class. |
15 * |
16 * |
16 */ |
17 */ |
17 |
18 |
18 #ifndef DESTINATIONEXT_H |
19 |
19 #define DESTINATIONEXT_H |
20 #ifndef CMDESTINATIONEXT_H |
20 |
21 #define CMDESTINATIONEXT_H |
21 // System includes |
22 |
22 #include <E32def.h> |
|
23 #include <e32base.h> |
23 #include <e32base.h> |
24 #include <metadatabase.h> |
24 #include <metadatabase.h> |
25 #include <cmmanagerdef.h> |
25 #include <cmmanagerdef.h> |
26 |
26 |
27 // FORWARD DECLARATIONS |
27 // Forward declarations |
28 class CCmDestinationData; |
|
29 class CCmManagerImpl; |
|
30 class RCmConnectionMethodExt; |
28 class RCmConnectionMethodExt; |
31 class RCmDestinationExt; |
29 class CCmDestinationWrapper; |
32 class CGulIcon; |
30 |
33 |
31 |
34 /** |
32 /** |
35 * RCmDestination is for getting/setting values of a network destination. |
33 * RCmDestination is for getting/setting values of a network destination. |
36 * @lib cmmanager.lib |
34 * @lib cmmanager.lib |
37 * @since S60 v3.2 |
35 * @since S60 v3.2 |
38 */ |
36 */ |
39 NONSHARABLE_CLASS(RCmDestinationExt) |
37 NONSHARABLE_CLASS( RCmDestinationExt ) |
40 { |
38 { |
41 //===================================================================== |
|
42 // Constructors/Destructors |
|
43 // |
|
44 public: |
39 public: |
45 |
|
46 /** Default constructor. */ |
40 /** Default constructor. */ |
47 IMPORT_C RCmDestinationExt(); |
41 IMPORT_C RCmDestinationExt(); |
48 |
42 |
49 //===================================================================== |
|
50 // API functions |
|
51 public: |
43 public: |
52 |
|
53 /** |
44 /** |
54 * Close the session. |
45 * Close the session. |
55 */ |
46 */ |
56 IMPORT_C void Close(); |
47 IMPORT_C void Close(); |
57 |
48 |
58 IMPORT_C ~RCmDestinationExt(); |
49 IMPORT_C ~RCmDestinationExt(); |
59 |
50 |
60 IMPORT_C RCmDestinationExt(const RCmDestinationExt& aCmDestination); |
51 IMPORT_C RCmDestinationExt( const RCmDestinationExt& aDestination ); |
61 |
52 |
62 //===================================================================== |
|
63 // Conn method handling |
|
64 |
|
65 /** |
53 /** |
66 * Return the number of connection methods in the destination |
54 * Return the number of connection methods in the destination |
67 * @param None |
55 * @param None |
68 * @return number of the connection method in this destination |
56 * @return number of the connection method in this destination |
69 */ |
57 */ |
70 IMPORT_C TInt ConnectionMethodCount(); |
58 IMPORT_C TInt ConnectionMethodCount(); |
71 |
59 |
72 /** |
60 /** |
73 * Return a reference to the connection method. |
61 * Return a reference to the connection method. |
74 * The index must be less than the return value of |
62 * The index must be less than the return value of |
75 * ConnectionMethodCount() |
63 * ConnectionMethodCount() |
76 * @param anIndex index of the connection method to be returned |
64 * @param anIndex index of the connection method to be returned |
77 * @return connection method |
65 * @return connection method |
78 */ |
66 */ |
79 IMPORT_C RCmConnectionMethodExt ConnectionMethodL( TInt anIndex ); |
67 IMPORT_C RCmConnectionMethodExt ConnectionMethodL( TInt aIndex ); |
80 |
68 |
81 /** |
69 /** |
82 * Returns the connection method with the ECmId. |
70 * Returns the connection method with the ECmId. |
83 * Leaves with KErrNotFound if not found. |
71 * Leaves with KErrNotFound if not found. |
84 * @param aCmId unique id of the requested connection method. |
72 * @param aCmId unique id of the requested connection method. |
85 * @return connection method |
73 * @return connection method |
86 */ |
74 */ |
87 IMPORT_C RCmConnectionMethodExt ConnectionMethodByIDL( |
75 IMPORT_C RCmConnectionMethodExt ConnectionMethodByIDL( |
88 TInt aCmId ); |
76 TInt aConnMethodId ); |
89 |
|
90 //Getting attributes |
|
91 |
77 |
92 /** |
78 /** |
93 * Return the priority of the passed connection method |
79 * Return the priority of the passed connection method |
94 * @param aCCMItem connection method |
80 * @param aCCMItem connection method |
95 * @return the priority of the queried connection method |
81 * @return the priority of the queried connection method |
96 */ |
82 */ |
97 IMPORT_C TUint PriorityL(const RCmConnectionMethodExt& aCCMItem ); |
83 IMPORT_C TUint PriorityL( |
98 |
84 const RCmConnectionMethodExt& aConnectionMethod ); |
|
85 |
99 /** |
86 /** |
100 * Return the name of the destination. Ownership is passed. |
87 * Return the name of the destination. Ownership is passed. |
101 * HBuf ownership is passed to the caller |
88 * HBuf ownership is passed to the caller |
102 * @return name of the destination. |
89 * @return name of the destination. |
103 */ |
90 */ |
104 IMPORT_C HBufC* NameLC(); |
91 IMPORT_C HBufC* NameLC(); |
105 |
92 |
106 /** |
93 /** |
107 * Return the destination's Id attribute |
94 * Return the destination's Id attribute |
108 * @return id of the destination |
95 * @return id of the destination |
109 */ |
96 */ |
110 IMPORT_C TUint32 Id(); |
97 IMPORT_C TUint32 Id(); |
111 |
98 |
112 /** |
99 /** |
113 * Return the destination's ElementId attribute |
100 * Return the destination's ElementId attribute |
114 * @return TUint32 |
101 * @return TUint32 |
115 */ |
102 */ |
116 IMPORT_C TUint32 ElementId(); |
103 IMPORT_C TUint32 ElementId(); |
117 |
104 |
118 /** |
|
119 * Return the Icon pointer. Ownership is passed. |
|
120 * This fucton leaves if the client does not have a valid UI context |
|
121 * @return icon of the destination |
|
122 */ |
|
123 IMPORT_C CGulIcon* IconL(); |
|
124 |
|
125 /** |
105 /** |
126 * Return the Metadata |
106 * Return the Metadata |
127 * @return TUint32 |
107 * @return TUint32 |
128 */ |
108 */ |
129 IMPORT_C TUint32 MetadataL( CMManager::TSnapMetadataField aMetaField ) const; |
109 IMPORT_C TUint32 MetadataL( |
130 |
110 CMManager::TSnapMetadataField aMetadataField ) const; |
|
111 |
131 /** |
112 /** |
132 * Return the protection level of the destination. |
113 * Return the protection level of the destination. |
133 * @return protection level |
114 * @return protection level |
134 */ |
115 */ |
135 IMPORT_C CMManager::TProtectionLevel ProtectionLevel(); |
116 IMPORT_C CMManager::TProtectionLevel ProtectionLevel(); |
136 |
117 |
137 /** |
118 /** |
138 * Return that the destination is hidden or not. |
119 * Return that the destination is hidden or not. |
139 * @return ETrue if the destination is hidden |
120 * @return ETrue if the destination is hidden |
140 */ |
121 */ |
141 IMPORT_C TBool IsHidden(); |
122 IMPORT_C TBool IsHidden(); |
142 |
123 |
143 /** |
124 /** |
144 * Create a connection method that belongs to this destination. |
125 * Create a connection method that belongs to this destination. |
145 * @param aImplementationUid - implementation uid (bearer type) of the |
126 * @param aImplementationUid - implementation uid (bearer type) of the |
146 * connection method to be created |
127 * connection method to be created |
147 * @return newly created connection method |
128 * @return newly created connection method |
148 */ |
129 */ |
149 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
130 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
150 TUint32 aBearerType ); |
131 TUint32 aBearerType ); |
151 |
132 |
152 /* |
133 /* |
153 * Adds an existing connection method to a destination |
134 * Adds an existing connection method to a destination |
154 * @param aConnectionMethod Connection method to be added |
135 * @param aConnectionMethod Connection method to be added |
155 * @return index in the Connection Method list |
136 * @return index in the Connection Method list |
156 */ |
137 */ |
157 IMPORT_C TInt AddConnectionMethodL( |
138 IMPORT_C TInt AddConnectionMethodL( |
158 RCmConnectionMethodExt aConnectionMethod ); |
139 RCmConnectionMethodExt aConnectionMethod ); |
159 |
140 |
160 /* |
141 /* |
161 * Embeds an existing destination into this destination. |
142 * Embeds an existing destination into this destination. |
162 * @param RCmDestinationExt - Destination to be embedded |
143 * @param RCmDestinationExt - Destination to be embedded |
163 * @return TInt - index in the Connection Method list |
144 * @return TInt - index in the Connection Method list |
164 */ |
145 */ |
165 IMPORT_C TInt AddEmbeddedDestinationL( |
146 IMPORT_C TInt AddEmbeddedDestinationL( |
166 const RCmDestinationExt& aDestination ); |
147 const RCmDestinationExt& aDestination ); |
167 |
148 |
168 /** |
149 /** |
169 * Remove a connection method from a destination and delete it |
150 * Remove a connection method from a destination and delete it |
170 * on update. |
151 * on update. |
171 * Exception: conenction method is not deleted if it's referenced |
152 * Exception: conenction method is not deleted if it's referenced |
172 * from any other destination. |
153 * from any other destination. |
173 * @param aConnectionMethod the connection method to be deleted. |
154 * @param aConnectionMethod the connection method to be deleted. |
174 */ |
155 */ |
175 IMPORT_C void DeleteConnectionMethodL( |
156 IMPORT_C void DeleteConnectionMethodL( |
176 RCmConnectionMethodExt& aConnectionMethod ); |
157 RCmConnectionMethodExt& aConnectionMethod ); |
177 |
158 |
178 /** |
159 /** |
179 * Remove connection method from the destination |
160 * Remove connection method from the destination |
180 * @param aConnectionMethod connection method to be removed |
161 * @param aConnectionMethod connection method to be removed |
181 */ |
162 */ |
182 IMPORT_C void RemoveConnectionMethodL( |
163 IMPORT_C void RemoveConnectionMethodL( |
183 RCmConnectionMethodExt aConnectionMethod ); |
164 RCmConnectionMethodExt aConnectionMethod ); |
184 |
165 |
185 |
|
186 /** |
166 /** |
187 * Set the connection method's priority based on the passed |
167 * Set the connection method's priority based on the passed |
188 * index. Indexing starts from zero(the highest priority). |
168 * index. Indexing starts from zero(the highest priority). |
189 * @param aCCMItem the connection method item |
169 * @param aCCMItem the connection method item |
190 * @param aIndex the new priority of the connection method in the |
170 * @param aIndex the new priority of the connection method in the |
191 * destination |
171 * destination |
192 */ |
172 */ |
193 IMPORT_C void ModifyPriorityL( RCmConnectionMethodExt& aCCMItem, |
173 IMPORT_C void ModifyPriorityL( |
194 TUint aIndex ); |
174 RCmConnectionMethodExt& aConnectionMethod, |
195 |
175 TUint aIndex ); |
|
176 |
196 /** |
177 /** |
197 * Set the destination's name |
178 * Set the destination's name |
198 * @param aDestinationName new name of the destination |
179 * @param aDestinationName new name of the destination |
199 */ |
180 */ |
200 IMPORT_C void SetNameL( const TDesC& aName ); |
181 IMPORT_C void SetNameL( const TDesC& aName ); |
201 |
182 |
202 /** |
|
203 * Set the destination's icon index. |
|
204 * This fucton leaves if the client does not have a valid UI context |
|
205 * @param aIconIndex new icon index of the destination |
|
206 */ |
|
207 IMPORT_C void SetIconL( TUint32 anIndex ); |
|
208 |
|
209 /** |
183 /** |
210 * Set the Metadata |
184 * Set the Metadata |
211 * @param aMetaField field to be modified |
185 * @param aMetaField field to be modified |
212 * @param aValue value to be set |
186 * @param aValue value to be set |
213 */ |
187 */ |
214 IMPORT_C void SetMetadataL( CMManager::TSnapMetadataField aMetaField, |
188 IMPORT_C void SetMetadataL( |
215 TUint32 aValue ); |
189 CMManager::TSnapMetadataField aMetadataField, |
216 |
190 TUint32 aValue ); |
|
191 |
217 /** |
192 /** |
218 * Set the protection level of the destination. |
193 * Set the protection level of the destination. |
219 * @param aProtLevel new protection level |
194 * @param aProtLevel new protection level |
220 */ |
195 */ |
221 IMPORT_C void SetProtectionL( CMManager::TProtectionLevel aProtLevel ); |
196 IMPORT_C void SetProtectionL( CMManager::TProtectionLevel aProtLevel ); |
222 |
197 |
223 /** |
198 /** |
224 * Set if the destination is hidden or not. |
199 * Set if the destination is hidden or not. |
225 * @param aHidden - ETrue if destination is hidden |
200 * @param aHidden - ETrue if destination is hidden |
226 */ |
201 */ |
227 IMPORT_C void SetHiddenL( TBool aHidden ); |
202 IMPORT_C void SetHiddenL( TBool aHidden ); |
228 |
203 |
229 /** |
204 /** |
230 * Update all values of the destination and its connection method. |
205 * Update all values of the destination and its connection method. |
231 * Nothing if stored, if update leaves due to any reason. |
206 * Nothing if stored, if update leaves due to any reason. |
232 */ |
207 */ |
233 IMPORT_C void UpdateL(); |
208 IMPORT_C void UpdateL(); |
234 |
209 |
235 /** |
210 /** |
236 * Delete destination and its connection methods from CommsDat. |
211 * Delete destination and its connection methods from CommsDat. |
237 * Connection methods that belong to other destination, too, are |
212 * Connection methods that belong to other destination, too, are |
238 * not deleted. |
213 * not deleted. |
239 */ |
214 */ |
240 IMPORT_C void DeleteLD(); |
215 IMPORT_C void DeleteLD(); |
241 |
216 |
242 /** |
217 /** |
243 * Returns if there's connection created with any of the destination's |
218 * Returns if there's connection created with any of the destination's |
244 * connection method. |
219 * connection method. |
245 * @return ETrue if there's connection with any of the destination's |
220 * @return ETrue if there's connection with any of the destination's |
246 * connection method. |
221 * connection method. |
247 */ |
222 */ |
248 IMPORT_C TBool IsConnectedL() const; |
223 IMPORT_C TBool IsConnectedL() const; |
249 |
224 |
250 /** |
225 /** |
251 * Compares whether two objects content is the same. |
226 * Compares whether two objects content is the same. |
252 * @return ETrue if the content is same. |
227 * @return ETrue if the content is same. |
253 */ |
228 */ |
254 IMPORT_C TBool operator==(const RCmDestinationExt& aDestination) const; |
229 IMPORT_C TBool operator==( |
|
230 const RCmDestinationExt& aDestination ) const; |
255 |
231 |
256 /** |
232 /** |
257 * Compares whether two objects content is different. |
233 * Compares whether two objects content is different. |
258 * @return ETrue if the content is different. |
234 * @return ETrue if the content is different. |
259 */ |
235 */ |
260 IMPORT_C TBool operator!=(const RCmDestinationExt& aDestination) const; |
236 IMPORT_C TBool operator!=( |
261 |
237 const RCmDestinationExt& aDestination ) const; |
262 /** |
238 |
263 * assignment operator |
239 /** |
264 * |
240 * assignment operator |
|
241 * |
265 * @since S60 3.2 |
242 * @since S60 3.2 |
266 * @param aDestination the destination being compared |
243 * @param aDestination the destination being compared |
267 * @return RCmDestination |
244 * @return RCmDestination |
268 */ |
245 */ |
269 IMPORT_C RCmDestinationExt& operator=(const RCmDestinationExt& |
246 IMPORT_C RCmDestinationExt& operator=( |
270 aCmDestination); |
247 const RCmDestinationExt& aDestination ); |
271 |
248 |
272 /** |
249 /** |
273 * Create a connection method with given id that belongs to this destination. |
250 * Create a connection method with given id that belongs to this |
274 * @param aImplementationUid - implementation uid (bearer type) of the |
251 * destination. |
|
252 * @param aImplementationUid - implementation uid (bearer type) of the |
275 * connection method to be created |
253 * connection method to be created |
276 * @param aConnMethdId Predefined id for the connection method |
254 * @param aConnMethdId Predefined id for the connection method |
277 * (id range is from 1 to max IAP record amount in CommsDat). |
255 * (id range is from 1 to max IAP record amount in CommsDat). |
278 * @return newly created connection method or leaves with |
256 * @return newly created connection method or leaves with |
279 * KErrAlreadyExists if there exists CM with the same Id. |
257 * KErrAlreadyExists if there exists CM with the same Id. |
280 */ |
258 */ |
281 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
259 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
282 TUint32 aBearerType, |
260 TUint32 aBearerType, |
283 TUint32 aConnMethId ); |
261 TUint32 aConnMethodId ); |
284 |
|
285 private: // Data |
|
286 |
|
287 CCmDestinationData* iDestinatonData; |
|
288 |
262 |
289 private: |
263 private: |
290 |
|
291 friend class RCmManagerExt; |
264 friend class RCmManagerExt; |
292 friend class RCmConnectionMethodExt; |
265 friend class RCmConnectionMethodExt; |
|
266 |
|
267 private: |
|
268 CCmDestinationWrapper* iCmDestinationWrapper; |
293 }; |
269 }; |
294 |
270 |
295 #endif // DESTINATIONEXT_H |
271 #endif // CMDESTINATIONEXT_H |
|
272 |
|
273 // End of file |