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: Connection manager IF class. |
14 * Description: |
|
15 * Connection manager IF class. |
15 * |
16 * |
16 */ |
17 */ |
17 |
18 |
|
19 |
18 #ifndef CMMANAGEREXT_H |
20 #ifndef CMMANAGEREXT_H |
19 #define CMMANAGEREXT_H |
21 #define CMMANAGEREXT_H |
20 |
22 |
21 // System includes |
|
22 #include <e32std.h> |
|
23 #include <e32base.h> |
23 #include <e32base.h> |
24 #include <e32cmn.h> |
|
25 #include <metadatabase.h> |
24 #include <metadatabase.h> |
26 #include <coneresloader.h> |
|
27 #include <cmmanagerdef.h> |
25 #include <cmmanagerdef.h> |
28 #include <cmconnectionmethodext.h> |
26 #include <cmconnectionmethodext.h> |
29 #include <cmdefconnvalues.h> |
27 #include <cmdefconnvalues.h> |
30 |
28 |
31 // FORWARD DECLARATIONS |
29 // Forward declarations |
32 class RCmDestinationExt; |
30 class RCmDestinationExt; |
33 class CCmManagerImpl; |
31 class RCmManagerApi; |
34 class CGulIcon; |
32 |
35 |
33 |
36 /** |
34 /** |
37 * RCmManager is used to query and modify network destinations and connection |
35 * RCmManager is used to query and modify network destinations and connection |
38 * methods. |
36 * methods. |
39 * |
37 * |
40 * @lib cmmanager.lib |
38 * @lib cmmanager.lib |
41 * @since S60 v3.2 |
39 * @since S60 v3.2 |
42 */ |
40 */ |
43 NONSHARABLE_CLASS(RCmManagerExt) |
41 NONSHARABLE_CLASS( RCmManagerExt ) |
44 { |
42 { |
45 //===================================================================== |
|
46 // Constructors/Destructors |
|
47 // |
|
48 public: |
43 public: |
49 |
|
50 /** Inline constructor */ |
44 /** Inline constructor */ |
51 inline RCmManagerExt(); |
45 inline RCmManagerExt(); |
52 |
46 |
53 //===================================================================== |
|
54 // API functions |
|
55 public: |
47 public: |
56 |
|
57 /** Open session */ |
48 /** Open session */ |
58 IMPORT_C void OpenL(); |
49 IMPORT_C void OpenL(); |
59 |
50 |
60 /** Open session and create tables if they don't exist*/ |
51 /** Open session and create tables if they don't exist */ |
61 IMPORT_C void CreateTablesAndOpenL(); |
52 IMPORT_C void CreateTablesAndOpenL(); |
62 |
53 |
63 /** |
54 /** |
64 * Symbian constructor |
55 * Symbian constructor |
65 * Pushes the object on the cleanup stack |
56 * Pushes the object on the cleanup stack |
66 * |
57 * |
67 * @since S60 3.2 |
58 * @since S60 3.2 |
68 */ |
59 */ |
69 IMPORT_C void OpenLC(); |
60 IMPORT_C void OpenLC(); |
70 |
61 |
71 /** Close session */ |
62 /** Close session */ |
72 IMPORT_C void Close(); |
63 IMPORT_C void Close(); |
73 |
64 |
74 /** |
65 /** |
75 * GetBearerInfoXXX function can be used to query |
66 * GetBearerInfoXXX function can be used to query bearer informantion |
76 * bearer informantion that doesn't belong |
67 * that doesn't belong to a specific connection method, such as |
77 * to a specific connection method, such as |
|
78 * ECmCoverage or ECmDefaultPriority etc. |
68 * ECmCoverage or ECmDefaultPriority etc. |
79 * NULL pointer, returned from string functions, means |
69 * NULL pointer, returned from string functions, means attribute exists |
80 * attribute exists but has no value. |
70 * but has no value. |
|
71 * HBuf ownership is passed to the caller. |
|
72 */ |
|
73 IMPORT_C TUint32 GetBearerInfoIntL( |
|
74 TUint32 aBearerType, |
|
75 TUint32 aAttribute ) const; |
|
76 IMPORT_C TBool GetBearerInfoBoolL( |
|
77 TUint32 aBearerType, |
|
78 TUint32 aAttribute ) const; |
|
79 IMPORT_C HBufC* GetBearerInfoStringL( |
|
80 TUint32 aBearerType, |
|
81 TUint32 aAttribute ) const; |
|
82 IMPORT_C HBufC8* GetBearerInfoString8L( |
|
83 TUint32 aBearerType, |
|
84 TUint32 aAttribute ) const; |
|
85 |
|
86 /** |
|
87 * GetConnectionMethodInfoXXX function can be used to query any, |
|
88 * non-bearer specific information about a given connection method. This |
|
89 * can be e.g. ECmBearerType, ECmName, ECmStartPage etc. |
|
90 * NULL pointer, returned from string functions, means attribute exists |
|
91 * but has no value. |
81 * HBuf ownership is passed to the caller |
92 * HBuf ownership is passed to the caller |
82 */ |
93 */ |
83 IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType, |
94 IMPORT_C TUint32 GetConnectionMethodInfoIntL( |
84 TUint32 aAttribute ) const; |
95 TUint32 aIapId, |
85 IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType, |
96 TUint32 aAttribute ) const; |
86 TUint32 aAttribute ) const; |
97 IMPORT_C TBool GetConnectionMethodInfoBoolL( |
87 IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType, |
98 TUint32 aIapId, |
88 TUint32 aAttribute ) const; |
99 TUint32 aAttribute ) const; |
89 IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType, |
100 IMPORT_C HBufC* GetConnectionMethodInfoStringL( |
90 TUint32 aAttribute ) const; |
101 TUint32 aIapId, |
91 |
102 TUint32 aAttribute ) const; |
92 /** |
103 IMPORT_C HBufC8* GetConnectionMethodInfoString8L( |
93 * GetConnectionMethodInfoXXX function can be used to |
104 TUint32 aIapId, |
94 * query any, non-bearer specific information about |
105 TUint32 aAttribute ) const; |
95 * a given connection method. This can be e.g. ECmBearerType, |
106 |
96 * ECmName, ECmStartPage etc. |
107 /** |
97 * NULL pointer, returned from string functions, means |
108 * Creates a Destination with the passed name. |
98 * attribute exists but has no value. |
|
99 * HBuf ownership is passed to the caller |
|
100 */ |
|
101 IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId, |
|
102 TUint32 aAttribute ) const; |
|
103 IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId, |
|
104 TUint32 aAttribute ) const; |
|
105 IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId, |
|
106 TUint32 aAttribute ) const; |
|
107 IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId, |
|
108 TUint32 aAttribute ) const; |
|
109 |
|
110 /** |
|
111 * Creates a Destination with the passed name. |
|
112 * @param aName the name of the new destination. |
109 * @param aName the name of the new destination. |
113 * @return RCmDestinationExt new destination. ownership is passed to the |
110 * @return RCmDestinationExt new destination. ownership is passed to the |
114 * caller |
111 * caller |
115 */ |
112 */ |
116 IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName ); |
113 IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName ); |
117 |
114 |
118 /** |
115 /** |
119 * Creates a connection method does not belong to any destination |
116 * Creates a connection method does not belong to any destination |
120 * @param aImplementationUid - bearer type of the new connection method |
117 * @param aImplementationUid - bearer type of the new connection method |
121 * @return RCmConnectionMethodExt newly created connection method. |
118 * @return RCmConnectionMethodExt newly created connection method. |
122 */ |
119 */ |
123 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
120 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
124 TUint32 aBearerType ); |
121 TUint32 aBearerType ); |
125 |
122 |
126 /** |
123 /** |
127 * Copies a connection method belonging to one destination to |
124 * Copies a connection method belonging to one destination to another. |
128 * another. The connection method becomes shared. |
125 * The connection method becomes shared. Calls UpdateL on the |
129 * Calls UpdateL on the destination |
126 * destination. |
130 * @param aTargetDestination |
127 * @param aTargetDestination |
131 * @param aConnectionMethodId |
128 * @param aConnectionMethodId |
132 * @return TInt - index in the Connection Method list |
129 * @return TInt - index in the Connection Method list |
133 */ |
130 */ |
134 IMPORT_C TInt CopyConnectionMethodL( |
131 IMPORT_C TInt CopyConnectionMethodL( |
135 RCmDestinationExt& aTargetDestination, |
132 RCmDestinationExt& aTargetDestination, |
136 RCmConnectionMethodExt& aConnectionMethod ); |
133 RCmConnectionMethodExt& aConnectionMethod ); |
137 |
134 |
138 /** |
135 /** |
139 * Moves a connection method belonging to one destination to |
136 * Moves a connection method belonging to one destination to another. The |
140 * another. The connection method is removed from the source destination |
137 * connection method is removed from the source destination. |
141 * @param aSourceDestination |
138 * @param aSourceDestination |
142 * @param aTargetDestination |
139 * @param aTargetDestination |
143 * @param aConnectionMethod |
140 * @param aConnectionMethod |
144 * @return TInt - index in the Connection Method list |
141 * @return TInt - index in the Connection Method list |
145 */ |
142 */ |
146 IMPORT_C TInt MoveConnectionMethodL( |
143 IMPORT_C TInt MoveConnectionMethodL( |
147 RCmDestinationExt& aSourceDestination, |
144 RCmDestinationExt& aSourceDestination, |
148 RCmDestinationExt& aTargetDestination, |
145 RCmDestinationExt& aTargetDestination, |
149 RCmConnectionMethodExt& aConnectionMethod ); |
146 RCmConnectionMethodExt& aConnectionMethod ); |
150 |
147 |
151 /** |
148 /** |
152 * Remove connection method from the destination |
149 * Remove connection method from the destination |
153 * @param aDestination destination the connection method is attached to |
150 * @param aDestination destination the connection method is attached to |
154 * @param aConnectionMethod connection method to be removed |
151 * @param aConnectionMethod connection method to be removed |
155 */ |
152 */ |
156 IMPORT_C void RemoveConnectionMethodL( |
153 IMPORT_C void RemoveConnectionMethodL( |
157 RCmDestinationExt& aDestination, |
154 RCmDestinationExt& aDestination, |
158 RCmConnectionMethodExt& aConnectionMethod ); |
155 RCmConnectionMethodExt& aConnectionMethod ); |
159 |
156 |
160 /** |
157 /** |
161 * Removes connection method from every destination and make it |
158 * Removes connection method from every destination and make it |
162 * uncategorized. |
159 * uncategorized. |
163 * @param aConnectionMethod connection method to be removed |
160 * @param aConnectionMethod connection method to be removed |
164 */ |
161 */ |
165 IMPORT_C void RemoveAllReferencesL( |
162 IMPORT_C void RemoveAllReferencesL( |
166 RCmConnectionMethodExt& aConnectionMethod ); |
163 RCmConnectionMethodExt& aConnectionMethod ); |
167 |
164 |
168 //========================================================================= |
|
169 // API functions - Getter-Setter |
|
170 public: |
165 public: |
171 |
|
172 /** |
166 /** |
173 * Returns the connection method queried by its ID. |
167 * Returns the connection method queried by its ID. |
174 * @param aId if of the connection method |
168 * @param aId if of the connection method |
175 * @return RCmConnectionMethodExt connection method instance |
169 * @return RCmConnectionMethodExt connection method instance |
176 */ |
170 */ |
177 IMPORT_C RCmConnectionMethodExt ConnectionMethodL( |
171 IMPORT_C RCmConnectionMethodExt ConnectionMethodL( |
178 TUint32 aConnectionMethodId ); |
172 TUint32 aConnectionMethodId ); |
179 |
173 |
180 /** |
174 /** |
181 * Returns the list of connection methods that do not belong to any |
175 * Returns the list of connection methods that do not belong to any |
182 * destination |
176 * destination. |
183 * @param aCMArray on return it is the array of IAP ids. |
177 * @param aCMArray on return it is the array of IAP ids. |
184 * @param aCheckBearerType If ETrue only connection methods with |
178 * @param aCheckBearerType If ETrue only connection methods with |
185 * supported bearer types are returned |
179 * supported bearer types are returned. |
186 * @param aLegacyOnly when set to ETrue only Legacy IAP ids will |
180 * @param aLegacyOnly when set to ETrue only Legacy IAP ids will be |
187 * be returned |
181 * returned. |
188 * @param aEasyWlan when set to ETrue EasyWlan id is returned, too |
182 * @param aEasyWlan when set to ETrue EasyWlan id is returned, too. |
189 */ |
183 */ |
190 IMPORT_C void ConnectionMethodL( RArray<TUint32>& aCMArray, |
184 IMPORT_C void ConnectionMethodL( |
191 TBool aCheckBearerType = ETrue, |
185 RArray<TUint32>& aCmArray, |
192 TBool aLegacyOnly = ETrue, |
186 TBool aCheckBearerType = ETrue, |
193 TBool aEasyWlan = EFalse ); |
187 TBool aLegacyOnly = ETrue, |
194 |
188 TBool aEasyWlan = EFalse ); |
195 /** |
189 |
196 * Returns the destination to which a specified |
190 /** |
197 * connection method belongs, search is by destination ID |
191 * Returns the destination to which a specified connection method |
|
192 * belongs, search is by destination ID. |
198 * @param aDestinationId id of the destination |
193 * @param aDestinationId id of the destination |
199 * @return RCmDestinationExt network destination |
194 * @return RCmDestinationExt network destination |
200 */ |
195 */ |
201 IMPORT_C RCmDestinationExt DestinationL( TUint32 aDestinationId ); |
196 IMPORT_C RCmDestinationExt DestinationL( TUint32 aDestinationId ); |
202 |
197 |
203 /** |
198 /** |
204 * Returns an array of all destination id's |
199 * Returns an array of all destination id's |
205 * @param aDestArray array of all available network destination |
200 * @param aDestArray array of all available network destination |
206 */ |
201 */ |
207 IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray ); |
202 IMPORT_C void AllDestinationsL( RArray<TUint32>& aDestArray ); |
208 |
203 |
209 /** |
204 /** |
210 * Returns the copy of the bearer priority array. Ownership is passed. |
205 * Returns the copy of the bearer priority array. Ownership is passed. |
211 * @param aArray bearer priority array |
206 * @param aArray bearer priority array |
212 */ |
207 */ |
213 IMPORT_C void BearerPriorityArrayL( RArray<TBearerPriority>& aArray ) const; |
208 IMPORT_C void BearerPriorityArrayL( |
214 |
209 RArray<TBearerPriority>& aArray ) const; |
|
210 |
215 /** |
211 /** |
216 * Update bearer priority array |
212 * Update bearer priority array |
217 * @param aArray array with new global bearer priority |
213 * @param aArray array with new global bearer priority |
218 */ |
214 */ |
219 IMPORT_C void UpdateBearerPriorityArrayL( |
215 IMPORT_C void UpdateBearerPriorityArrayL( |
220 const RArray<TBearerPriority>& aArray ); |
216 const RArray<TBearerPriority>& aArray ); |
221 |
|
222 |
217 |
223 /** |
218 /** |
224 * Clean up passed global bearer priority array. Delete |
219 * Clean up passed global bearer priority array. Delete |
225 * the elements and calls Reset and Close on the array. |
220 * the elements and calls Reset and Close on the array. |
226 * @param aArray array to be cleaned up |
221 * @param aArray array to be cleaned up |
227 */ |
222 */ |
228 IMPORT_C void CleanupGlobalPriorityArray( |
223 IMPORT_C void CleanupGlobalPriorityArray( |
229 RArray<TBearerPriority>& aArray ) const; |
224 RArray<TBearerPriority>& aArray ) const; |
230 |
225 |
231 /** |
226 /** |
232 * Query all of the supported bearer types. |
227 * Query all of the supported bearer types. |
233 * @param aArray list of all supported bearer types. |
228 * @param aArray list of all supported bearer types. |
234 */ |
229 */ |
235 IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const; |
230 IMPORT_C void SupportedBearersL( RArray<TUint32>& aArray ) const; |
236 |
231 |
237 /** |
|
238 * Returns "Uncategorized" icon. |
|
239 * This fucton leaves if the client does not have a valid UI context |
|
240 * @return CGulIcon* Icon of uncategorized connection methods. Ownership |
|
241 * is passed. |
|
242 */ |
|
243 IMPORT_C CGulIcon* UncategorizedIconL() const; |
|
244 |
|
245 /** |
232 /** |
246 * Returns the id of the EasyWlan connection method. |
233 * Returns the id of the EasyWlan connection method. |
247 * |
234 * |
248 * @since S60 3.2 |
235 * @since S60 3.2 |
249 * @return id of the EasyWLan connection method. 0 if not found. |
236 * @return id of the EasyWLan connection method. 0 if not found. |
253 /** |
240 /** |
254 * Returns the default connection method/SNAP. |
241 * Returns the default connection method/SNAP. |
255 * |
242 * |
256 * @since S60 3.2 |
243 * @since S60 3.2 |
257 */ |
244 */ |
258 IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting ); |
245 IMPORT_C void ReadDefConnL( TCmDefConnValue& aDefConnSetting ); |
|
246 |
259 /** |
247 /** |
260 * Stores the default connection method/SNAP. |
248 * Stores the default connection method/SNAP. |
261 * |
249 * |
262 * @since S60 3.2 |
250 * @since S60 3.2 |
263 */ |
251 */ |
264 IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting ); |
252 IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDefConnSetting ); |
265 |
253 |
266 /** |
254 /** |
267 * Creates a Destination with the passed name and id. |
255 * Creates a Destination with the passed name and id. |
268 * @param aName the name of the new destination. |
256 * @param aName the name of the new destination. |
269 * @param aDestId Predefined id of the destination. |
257 * @param aDestId Predefined id of the destination. |
270 * @return RCmDestinationExt newly created destination or leaves with |
258 * @return RCmDestinationExt newly created destination or leaves with |
271 * KErrAlreadyExists if there exists CM with the same Id. |
259 * KErrAlreadyExists if there exists CM with the same Id. |
272 * Ownership is passed to the caller. |
260 * Ownership is passed to the caller. |
273 */ |
261 */ |
274 IMPORT_C RCmDestinationExt CreateDestinationL( const TDesC& aName, |
262 IMPORT_C RCmDestinationExt CreateDestinationL( |
275 TUint32 aDestId ); |
263 const TDesC& aName, |
276 |
264 TUint32 aDestId ); |
|
265 |
277 /** |
266 /** |
278 * Creates a connection method does not belong to any destination |
267 * Creates a connection method does not belong to any destination |
279 * @param aImplementationUid - bearer type of the new connection |
268 * @param aImplementationUid - bearer type of the new connection |
280 * method |
269 * method |
281 * @param aConnMethodId Predefined id for the connection method |
270 * @param aConnMethodId Predefined id for the connection method |
282 * (id range is from 1 to max IAP record amount in CommsDat). |
271 * (id range is from 1 to max IAP record amount in CommsDat). |
283 * @return RCmConnectionMethodExt newly created connection |
272 * @return RCmConnectionMethodExt newly created connection |
284 * method or leaves with KErrAlreadyExists if there exists CM |
273 * method or leaves with KErrAlreadyExists if there exists CM |
285 * with the same Id. |
274 * with the same Id. |
286 */ |
275 */ |
287 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( TUint32 aImplementationUid, |
276 IMPORT_C RCmConnectionMethodExt CreateConnectionMethodL( |
288 TUint32 aConnMethodId ); |
277 TUint32 aBearerType, |
|
278 TUint32 aConnMethodId ); |
289 |
279 |
290 private: |
280 private: |
291 /** |
281 /** |
292 * This is a private copy constructor without iplemetation. |
282 * This is a private copy constructor without iplemetation. |
293 * The sole purpose of this declaration is to forbid the copying of |
283 * The sole purpose of this declaration is to forbid the copying of |
294 * the objects of this class. |
284 * the objects of this class. |
295 */ |
285 */ |
296 RCmManagerExt(RCmManagerExt& ); |
286 RCmManagerExt( RCmManagerExt& ); |
|
287 |
297 /** |
288 /** |
298 * This is a private copy constructor without iplemetation. |
289 * This is a private copy constructor without iplemetation. |
299 * The sole purpose of this declaration is to forbid the copying of |
290 * The sole purpose of this declaration is to forbid the copying of |
300 * the objects of this class. |
291 * the objects of this class. |
301 */ |
292 */ |
302 RCmManagerExt& operator=( RCmManagerExt& ); |
293 RCmManagerExt& operator=( RCmManagerExt& ); |
303 |
294 |
304 friend class CCmManagerImpl; |
|
305 //========================================================================= |
|
306 // Member data |
|
307 |
|
308 private: |
295 private: |
309 |
296 friend class CCmManagerImpl; |
310 CCmManagerImpl* iImplementation; |
297 |
|
298 private: |
|
299 RCmManagerApi* iCmManagerApi; |
311 }; |
300 }; |
312 |
301 |
313 inline RCmManagerExt::RCmManagerExt() |
302 |
314 : iImplementation(NULL) |
303 inline RCmManagerExt::RCmManagerExt() : iCmManagerApi( NULL ) |
315 { |
304 { |
316 } |
305 } |
317 |
306 |
|
307 |
318 #endif // CMMANAGEREXT_H |
308 #endif // CMMANAGEREXT_H |
|
309 |
|
310 // End of file |