Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Declaration of the class CApUtils
15 * Contains utility functions for access point handling
23 // Deprecation warning
24 #warning This header file has been deprecated. Will be removed in one of the next SDK releases.
29 #include <ApEngineVer.h>
30 #include <ApEngineConsts.h>
37 TInt iVariant; /// Local variant value
38 TBool iWlanSupported; /// WLAN feature supported or not
39 TBool iIsFeatureManagerInitialised;
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).
54 class CApUtils :public CBase
56 public: // Constructors and destructor
59 * Two-phased constructor. Leaves on failure, places instance
61 * @param aDb a reference to a CCommsDataBase object.
62 * @return The constructed CApUtils.
66 IMPORT_C static CApUtils* NewLC( CCommsDatabase& aDb );
74 IMPORT_C virtual ~CApUtils();
77 protected: // Constructors
79 * C++ default constructor.
86 * Second-phase constructor.
90 IMPORT_C void ConstructL( CCommsDatabase& aDb );
95 public: // New functions
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)
105 IMPORT_C TBool IsAPInUseL( TUint32 aUid );
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.
122 IMPORT_C void WapBearerTypeL( TUint32 aUid, TDes& aBearer );
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.
132 IMPORT_C TApBearerType BearerTypeL( TUint32 aUid );
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.
144 IMPORT_C void ISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType );
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.
153 IMPORT_C TBool IsValidNameL( const TDesC& aNameText );
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
165 IMPORT_C TBool MakeValidNameL( TDes& aNameText );
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.
178 IMPORT_C void NameL( TUint32 aUid, TDes& aName );
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.
192 IMPORT_C void SetNameL( TDes& aName, TUint32 aUid );
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.
203 IMPORT_C void SetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType );
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.
213 IMPORT_C TUint32 IapIdFromWapIdL( TUint32 aUid );
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.
223 IMPORT_C TUint32 WapIdFromIapIdL( TUint32 aUid );
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?
237 IMPORT_C TBool HasMandatoryFieldsFilledL( TUint32 aUid );
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.
249 IMPORT_C TBool IAPExistsL( TUint32 aUid );
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.
260 IMPORT_C TBool WapApExistsL( TUint32 aUid );
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?
270 IMPORT_C TBool DoHasMandatoryFieldsFilledL(
272 CCommsDbTableView* aWapt = NULL,
273 TApBearerType aBearertype = EApBearerTypeAllBearers );
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.
285 IMPORT_C TBool IsValidNameL( const TDesC& aNameText,
286 TUint32 aAcceptUid );
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.
296 IMPORT_C TBool IsReadOnlyL( TUint32 aUid );
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.
306 TBool IsWlanL( TUint32 aLanCommdbId );
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.
318 TBool HasWlanSSIDL( TUint32 aLanCommdbId );
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.
335 void DoWapBearerTypeL( TUint32 aUid, TDes& aBearer );
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.
343 TApBearerType DoBearerTypeL( TUint32 aUid );
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.
352 void DoISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType );
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.
363 void DoNameL( TUint32 aUid, TDes& aName );
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.
375 void DoSetNameL( TDes& aName, TUint32 aUid );
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.
384 void DoSetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType );
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.
396 TBool DoesExistsL( TPtrC aTable, TUint32 aUid );
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.
406 TBool DoIsWlanL( TUint32 aLanCommdbId );
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...