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