1 /* |
|
2 * Copyright (c) 2002 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: Declaration of the class CApUtils |
|
15 * Contains utility functions for access point handling |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef APUTILS_H |
|
21 #define APUTILS_H |
|
22 |
|
23 // Deprecation warning |
|
24 #warning This header file has been deprecated and will be fully removed between weeks 12 and 18 of 2010. See Polonium CR #153 for details. |
|
25 |
|
26 |
|
27 // INCLUDES |
|
28 #include <commdb.h> |
|
29 #include <ApEngineVer.h> |
|
30 #include <ApEngineConsts.h> |
|
31 |
|
32 |
|
33 |
|
34 // extra data holder. |
|
35 typedef struct |
|
36 { |
|
37 TInt iVariant; /// Local variant value |
|
38 TBool iWlanSupported; /// WLAN feature supported or not |
|
39 TBool iIsFeatureManagerInitialised; |
|
40 }TUtilsExtra; |
|
41 |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Representation of access point utilities. |
|
47 * Provides utilities to access points for clients. |
|
48 * Encapsulates database handling. |
|
49 * This class provides utility functions for clients that need some |
|
50 * specific information or parameters from (maybe more than one) AP. |
|
51 * It is provided for ease of use so clients do not have to work with |
|
52 * CApDataHandler's concept (one object-one Uid). |
|
53 */ |
|
54 class CApUtils :public CBase |
|
55 { |
|
56 public: // Constructors and destructor |
|
57 |
|
58 /** |
|
59 * Two-phased constructor. Leaves on failure, places instance |
|
60 * on cleanup stack. |
|
61 * @param aDb a reference to a CCommsDataBase object. |
|
62 * @return The constructed CApUtils. |
|
63 * |
|
64 * @deprecated |
|
65 */ |
|
66 IMPORT_C static CApUtils* NewLC( CCommsDatabase& aDb ); |
|
67 |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 * |
|
72 * @deprecated |
|
73 */ |
|
74 IMPORT_C virtual ~CApUtils(); |
|
75 |
|
76 |
|
77 protected: // Constructors |
|
78 /** |
|
79 * C++ default constructor. |
|
80 * |
|
81 * @deprecated |
|
82 */ |
|
83 IMPORT_C CApUtils(); |
|
84 |
|
85 /** |
|
86 * Second-phase constructor. |
|
87 * |
|
88 * @deprecated |
|
89 */ |
|
90 IMPORT_C void ConstructL( CCommsDatabase& aDb ); |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 public: // New functions |
|
96 |
|
97 /** |
|
98 * Indicates whether a given access point is in use or not. |
|
99 * If access point does not exists, return value is TRUE |
|
100 * @param aUid The UID of the access point. |
|
101 * @return Boolean indicating if it is in use (if used, TRUE) |
|
102 * |
|
103 * @deprecated |
|
104 */ |
|
105 IMPORT_C TBool IsAPInUseL( TUint32 aUid ); |
|
106 |
|
107 |
|
108 /** |
|
109 * Indicates the WAP bearer type of a given access point. |
|
110 * Passed descriptor MUST be large enough to hold the new data, |
|
111 * otherwise leaves with KErrDescOverflow. |
|
112 * The maximum length is the maximum length of a 'normal' text fields |
|
113 * length in Comms DB, KCommsDbSvrMaxFieldLength, |
|
114 * which is defined in cdblen.h. |
|
115 * @param aUid The UID of the access point. |
|
116 * @param aBearer A reference to a TBearer to hold the bearer |
|
117 * type of the access point. |
|
118 * @return no return value. |
|
119 * |
|
120 * @deprecated |
|
121 */ |
|
122 IMPORT_C void WapBearerTypeL( TUint32 aUid, TDes& aBearer ); |
|
123 |
|
124 |
|
125 /** |
|
126 * Gets the bearer type of a given access point. Leaves on error. |
|
127 * @param aUid The UID of the access point. |
|
128 * @return The type of the bearer. |
|
129 * |
|
130 * @deprecated |
|
131 */ |
|
132 IMPORT_C TApBearerType BearerTypeL( TUint32 aUid ); |
|
133 |
|
134 |
|
135 |
|
136 /** |
|
137 * Indicates the ISP type of a given access point. |
|
138 * @param aUid The UID of the access point. |
|
139 * @param aIspType A reference to a TCommsDbIspType to hold the value |
|
140 * @return No return value. |
|
141 * |
|
142 * @deprecated |
|
143 */ |
|
144 IMPORT_C void ISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType ); |
|
145 |
|
146 /** |
|
147 * Indicates whether a given name is valid or not. |
|
148 * @param aNameText The name to check. |
|
149 * @return Boolean indicating if it is valid or not. |
|
150 * |
|
151 * @deprecated |
|
152 */ |
|
153 IMPORT_C TBool IsValidNameL( const TDesC& aNameText ); |
|
154 |
|
155 |
|
156 /** |
|
157 * TBool CApUtils::MakeValidNameL(TDes& aNameText); |
|
158 * Creates a valid name based on the given one. |
|
159 * @param aNameText The name to use for creating a valid name. |
|
160 * The new name is returned in it, too. |
|
161 * @return Whether the name was changed or not |
|
162 * |
|
163 * @deprecated |
|
164 */ |
|
165 IMPORT_C TBool MakeValidNameL( TDes& aNameText ); |
|
166 |
|
167 |
|
168 /** |
|
169 * Reads the Name of a given access point |
|
170 * @param aUid The UID of the access point. |
|
171 * @param A reference to hold the name of the access point. |
|
172 * @return no return value. |
|
173 * Passed descriptor MUST be large enough to hold the new data, |
|
174 * otherwise leaves with KErrDescOverflow. |
|
175 * |
|
176 * @deprecated |
|
177 */ |
|
178 IMPORT_C void NameL( TUint32 aUid, TDes& aName ); |
|
179 |
|
180 |
|
181 /** |
|
182 * Sets the Name of a given access point |
|
183 * Name is validated and modified if needed. |
|
184 * Passed aName buffer MUST be large enough to hold the modified name. |
|
185 * @param aName A reference to the name of the access point. |
|
186 * The given name is returned in it. |
|
187 * @param aUid The UID of the access point. |
|
188 * @return no return value. |
|
189 * |
|
190 * @deprecated |
|
191 */ |
|
192 IMPORT_C void SetNameL( TDes& aName, TUint32 aUid ); |
|
193 |
|
194 |
|
195 /** |
|
196 * Sets the ISP type for a given access point |
|
197 * @param aUid The UID of the access point |
|
198 * @param aIspType The desired Isp type of the access point |
|
199 * @return no return value. |
|
200 * |
|
201 * @deprecated |
|
202 */ |
|
203 IMPORT_C void SetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType ); |
|
204 |
|
205 |
|
206 /** |
|
207 * Gets the Iap record ID for a given access point ID |
|
208 * @param aUid The UID of the access point |
|
209 * @return The Iap record ID. |
|
210 * |
|
211 * @deprecated |
|
212 */ |
|
213 IMPORT_C TUint32 IapIdFromWapIdL( TUint32 aUid ); |
|
214 |
|
215 |
|
216 /** |
|
217 * Gets the Wap record ID for a given Iap record ID |
|
218 * @param aUid The UID of the Iap |
|
219 * @return The Wap access point ID. |
|
220 * |
|
221 * @deprecated |
|
222 */ |
|
223 IMPORT_C TUint32 WapIdFromIapIdL( TUint32 aUid ); |
|
224 |
|
225 |
|
226 |
|
227 /** |
|
228 * Returns whether the access point has the WAP-mandatory |
|
229 * fields filled or not. |
|
230 * Starts a transaction which is 'internal' to ApEngine if |
|
231 * client not started one. |
|
232 * @param aUid The UID of the access point |
|
233 * @return TBool Are the WAP-mandatory fields filled in the access point? |
|
234 * |
|
235 * @deprecated |
|
236 */ |
|
237 IMPORT_C TBool HasMandatoryFieldsFilledL( TUint32 aUid ); |
|
238 |
|
239 /** |
|
240 * Returns in a TBool whether the internet access point part |
|
241 * identified by the passed aUid exists or not. |
|
242 * param aUid the internet access point ID to check for |
|
243 * (NOT equals to Wap access point ID). |
|
244 * return TBool indicating whether an internet access point |
|
245 * with the given ID exists or not. |
|
246 * |
|
247 * @deprecated |
|
248 */ |
|
249 IMPORT_C TBool IAPExistsL( TUint32 aUid ); |
|
250 |
|
251 /** |
|
252 * Returns in a TBool whether the access point identified |
|
253 * by the passed aUid exists or not. |
|
254 * @param aUid the access point ID to check for.(Wap access point ID). |
|
255 * @return TBool indicating whether an access point with the |
|
256 * given ID exists or not. |
|
257 * |
|
258 * @deprecated |
|
259 */ |
|
260 IMPORT_C TBool WapApExistsL( TUint32 aUid ); |
|
261 |
|
262 /** |
|
263 * Returns whether the access point has the WAP-mandatory |
|
264 * fields filled or not. |
|
265 * @param aUid The UID of the access point |
|
266 * @return TBool Are the WAP-mandatory fields filled in the access point? |
|
267 * |
|
268 * @deprecated |
|
269 */ |
|
270 IMPORT_C TBool DoHasMandatoryFieldsFilledL( |
|
271 TUint32 aUid, |
|
272 CCommsDbTableView* aWapt = NULL, |
|
273 TApBearerType aBearertype = EApBearerTypeAllBearers ); |
|
274 |
|
275 |
|
276 /** |
|
277 * Indicates whether a given name is valid or not. |
|
278 * The name is valid if none, or only the aAcceptUid AP has it. |
|
279 * @param aNameText The name to check. |
|
280 * @param aAcceptUid A UID to accept with this name |
|
281 * @return Boolean indicating if it is valid or not. |
|
282 * |
|
283 * @deprecated |
|
284 */ |
|
285 IMPORT_C TBool IsValidNameL( const TDesC& aNameText, |
|
286 TUint32 aAcceptUid ); |
|
287 |
|
288 |
|
289 /** |
|
290 * Determines whether a given AP is read-only or not. |
|
291 * @param aUid A UID to look for |
|
292 * @return Boolean indicating if it is read-only or not. |
|
293 * |
|
294 * @deprecated |
|
295 */ |
|
296 IMPORT_C TBool IsReadOnlyL( TUint32 aUid ); |
|
297 |
|
298 |
|
299 |
|
300 /** |
|
301 * Determines whether a given LAN_SERVICE commsdb id |
|
302 * is linked to a WLAN data (thus is it a WLAN) or not. |
|
303 * @param aUid A UID to look for |
|
304 * @return Boolean indicating if it is WLAN or not. |
|
305 */ |
|
306 TBool IsWlanL( TUint32 aLanCommdbId ); |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 /** |
|
312 * Determines whether a given LAN_SERVICE commsdb id |
|
313 * which is linked to a WLAN data (thus is it a WLAN) |
|
314 * has a valid SSID or it is empty |
|
315 * @param aUid A UID to look for |
|
316 * @return Boolean indicating if it has WLAN SSID or not. |
|
317 */ |
|
318 TBool HasWlanSSIDL( TUint32 aLanCommdbId ); |
|
319 |
|
320 protected: |
|
321 |
|
322 |
|
323 /** |
|
324 * Indicates the WAP bearer type of a given access point. |
|
325 * Passed descriptor MUST be large enough to hold the new data, |
|
326 * otherwise leaves with KErrDescOverflow. |
|
327 * The maximum length is the maximum length of a 'normal' text fields |
|
328 * length in Comms DB, KCommsDbSvrMaxFieldLength, |
|
329 * which is defined in cdblen.h. |
|
330 * @param aUid The UID of the access point. |
|
331 * @param aBearer A reference to a TBearer to hold the bearer |
|
332 * type of the access point. |
|
333 * @return no return value. |
|
334 */ |
|
335 void DoWapBearerTypeL( TUint32 aUid, TDes& aBearer ); |
|
336 |
|
337 |
|
338 /** |
|
339 * Gets the bearer type of a given access point. Leaves on error. |
|
340 * @param aUid The UID of the access point. |
|
341 * @return The type of the bearer. |
|
342 */ |
|
343 TApBearerType DoBearerTypeL( TUint32 aUid ); |
|
344 |
|
345 |
|
346 /** |
|
347 * Indicates the ISP type of a given access point. |
|
348 * @param aUid The UID of the access point. |
|
349 * @param aIspType A reference to a TCommsDbIspType to hold the value |
|
350 * @return No return value. |
|
351 */ |
|
352 void DoISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType ); |
|
353 |
|
354 |
|
355 /** |
|
356 * Reads the Name of a given access point |
|
357 * @param aUid The UID of the access point. |
|
358 * @param A reference to hold the name of the access point. |
|
359 * @return no return value. |
|
360 * Passed descriptor MUST be large enough to hold the new data, |
|
361 * otherwise leaves with KErrDescOverflow. |
|
362 */ |
|
363 void DoNameL( TUint32 aUid, TDes& aName ); |
|
364 |
|
365 |
|
366 /** |
|
367 * Sets the Name of a given access point |
|
368 * Name is validated and modified if needed. |
|
369 * Passed aName buffer MUST be large enough to hold the modified name. |
|
370 * @param aName A reference to the name of the access point. |
|
371 * The given name is returned in it. |
|
372 * @param aUid The UID of the access point. |
|
373 * @return no return value. |
|
374 */ |
|
375 void DoSetNameL( TDes& aName, TUint32 aUid ); |
|
376 |
|
377 |
|
378 /** |
|
379 * Sets the ISP type for a given access point |
|
380 * @param aUid The UID of the access point |
|
381 * @param aIspType The desired Isp type of the access point |
|
382 * @return no return value. |
|
383 */ |
|
384 void DoSetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType ); |
|
385 |
|
386 |
|
387 /** |
|
388 * Returns in a TBool whether the record |
|
389 * identified by the passed aUid exists or not |
|
390 * in the table identified by the passed table name. |
|
391 * @param aTable The name of the table to check |
|
392 * @param aUid The UID to check for |
|
393 * @return TBool indicating whether the record |
|
394 * with the given ID exists in the given table or not. |
|
395 */ |
|
396 TBool DoesExistsL( TPtrC aTable, TUint32 aUid ); |
|
397 |
|
398 |
|
399 /** |
|
400 * Wrapper for public API. |
|
401 * Determines whether a given LAN_SERVICE commsdb id |
|
402 * is linked to a WLAN data (thus is it a WLAN) or not. |
|
403 * @param aUid A UID to look for |
|
404 * @return Boolean indicating if it is WLAN or not. |
|
405 */ |
|
406 TBool DoIsWlanL( TUint32 aLanCommdbId ); |
|
407 |
|
408 |
|
409 private: // Data |
|
410 CCommsDatabase* iDb; |
|
411 // TCommDbDatabaseType iDbType; // deprecated and not used but kept |
|
412 // to maintain class size for BC |
|
413 // Added a new iExt for expansion instead of TCommDbDatabaseType |
|
414 // same size, no BC problem... |
|
415 TUtilsExtra* iExt; |
|
416 |
|
417 |
|
418 }; |
|
419 |
|
420 #endif // APUTILS_H |
|
421 |
|
422 // End of File |
|