epoc32/include/mw/aputils.h
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mw/aputils.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mw/aputils.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,422 @@
     1.4 -aputils.h
     1.5 +/*
     1.6 +* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). 
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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
    1.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:  Declaration of the class CApUtils
    1.19 +*     Contains utility functions for access point handling
    1.20 +*
    1.21 +*/
    1.22 +
    1.23 +
    1.24 +#ifndef APUTILS_H
    1.25 +#define APUTILS_H
    1.26 +
    1.27 +// Deprecation warning
    1.28 +#warning This header file has been deprecated. Will be removed in one of the next SDK releases.
    1.29 + 
    1.30 + 
    1.31 +//  INCLUDES
    1.32 +#include <commdb.h>
    1.33 +#include <ApEngineVer.h>
    1.34 +#include <ApEngineConsts.h>
    1.35 +
    1.36 +
    1.37 +
    1.38 +// extra data holder.
    1.39 +typedef struct
    1.40 +    {
    1.41 +    TInt    iVariant;               /// Local variant value
    1.42 +    TBool   iWlanSupported;         /// WLAN feature supported or not
    1.43 +    TBool   iIsFeatureManagerInitialised;
    1.44 +    }TUtilsExtra;
    1.45 +
    1.46 +
    1.47 +// CLASS DECLARATION
    1.48 +
    1.49 +/**
    1.50 +*  Representation of access point utilities.
    1.51 +*  Provides utilities to access points for clients.
    1.52 +*  Encapsulates database handling.
    1.53 +*  This class provides utility functions for clients that need some
    1.54 +*  specific information or parameters from (maybe more than one) AP.
    1.55 +*  It is provided for ease of use so clients do not have to work with
    1.56 +*  CApDataHandler's concept (one object-one Uid).
    1.57 +*/
    1.58 +class CApUtils :public CBase
    1.59 +    {
    1.60 +    public:  // Constructors and destructor
    1.61 +
    1.62 +        /**
    1.63 +        * Two-phased constructor. Leaves on failure, places instance
    1.64 +        * on cleanup stack.
    1.65 +        * @param aDb a reference to a CCommsDataBase object.
    1.66 +        * @return The constructed CApUtils.
    1.67 +        *
    1.68 +        * @deprecated
    1.69 +        */
    1.70 +        IMPORT_C static CApUtils* NewLC( CCommsDatabase& aDb );
    1.71 +
    1.72 +
    1.73 +        /**
    1.74 +        * Destructor.
    1.75 +        *
    1.76 +        * @deprecated
    1.77 +        */
    1.78 +        IMPORT_C virtual ~CApUtils();
    1.79 +
    1.80 +
    1.81 +protected: // Constructors
    1.82 +        /**
    1.83 +        * C++ default constructor.
    1.84 +        *
    1.85 +        * @deprecated
    1.86 +        */
    1.87 +        IMPORT_C CApUtils();
    1.88 +
    1.89 +        /**
    1.90 +        * Second-phase constructor.
    1.91 +        *
    1.92 +        * @deprecated
    1.93 +        */
    1.94 +        IMPORT_C void ConstructL( CCommsDatabase& aDb );
    1.95 +
    1.96 +
    1.97 +
    1.98 +
    1.99 +    public: // New functions
   1.100 +
   1.101 +        /**
   1.102 +        * Indicates whether a given access point is in use or not.
   1.103 +        * If access point does not exists, return value is TRUE
   1.104 +        * @param aUid The UID of the access point.
   1.105 +        * @return Boolean indicating if it is in use (if used, TRUE)
   1.106 +        *
   1.107 +        * @deprecated
   1.108 +        */
   1.109 +        IMPORT_C TBool IsAPInUseL( TUint32 aUid );
   1.110 +
   1.111 +
   1.112 +        /**
   1.113 +        * Indicates the WAP bearer type of a given access point.
   1.114 +        * Passed descriptor MUST be large enough to hold the new data,
   1.115 +        * otherwise leaves with KErrDescOverflow.
   1.116 +        * The maximum length is the maximum length of a 'normal' text fields
   1.117 +        * length in Comms DB, KCommsDbSvrMaxFieldLength,
   1.118 +        * which is defined in cdblen.h.
   1.119 +        * @param aUid The UID of the access point.
   1.120 +        * @param aBearer A reference to a TBearer to hold the bearer
   1.121 +        * type of the access point.
   1.122 +        * @return no return value.
   1.123 +        *
   1.124 +        * @deprecated
   1.125 +        */
   1.126 +        IMPORT_C void WapBearerTypeL( TUint32 aUid, TDes& aBearer );
   1.127 +
   1.128 +
   1.129 +        /**
   1.130 +        * Gets the bearer type of a given access point. Leaves on error.
   1.131 +        * @param aUid The UID of the access point.
   1.132 +        * @return The type of the bearer.
   1.133 +        *
   1.134 +        * @deprecated
   1.135 +        */
   1.136 +        IMPORT_C TApBearerType BearerTypeL( TUint32 aUid );
   1.137 +
   1.138 +
   1.139 +
   1.140 +        /**
   1.141 +        * Indicates the ISP type of a given access point.
   1.142 +        * @param aUid The UID of the access point.
   1.143 +        * @param aIspType A reference to a TCommsDbIspType to hold the value
   1.144 +        * @return No return value.
   1.145 +        *
   1.146 +        * @deprecated
   1.147 +        */
   1.148 +        IMPORT_C void ISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType );
   1.149 +
   1.150 +        /**
   1.151 +        * Indicates whether a given name is valid or not.
   1.152 +        * @param aNameText The name to check.
   1.153 +        * @return Boolean indicating if it is valid or not.
   1.154 +        *
   1.155 +        * @deprecated
   1.156 +        */
   1.157 +        IMPORT_C TBool IsValidNameL( const TDesC& aNameText );
   1.158 +
   1.159 +
   1.160 +        /**
   1.161 +        * TBool CApUtils::MakeValidNameL(TDes& aNameText);
   1.162 +        * Creates a valid name based on the given one.
   1.163 +        * @param aNameText The name to use for creating a valid name.
   1.164 +        * The new name is returned in it, too.
   1.165 +        * @return Whether the name was changed or not
   1.166 +        *
   1.167 +        * @deprecated
   1.168 +        */
   1.169 +        IMPORT_C TBool MakeValidNameL( TDes& aNameText );
   1.170 +
   1.171 +
   1.172 +        /**
   1.173 +        * Reads the Name of a given access point
   1.174 +        * @param aUid The UID of the access point.
   1.175 +        * @param A reference to hold the name of the access point.
   1.176 +        * @return no return value.
   1.177 +        * Passed descriptor MUST be large enough to hold the new data,
   1.178 +        * otherwise leaves with KErrDescOverflow.
   1.179 +        *
   1.180 +        * @deprecated
   1.181 +        */
   1.182 +        IMPORT_C void NameL( TUint32 aUid, TDes& aName );
   1.183 +
   1.184 +
   1.185 +        /**
   1.186 +        * Sets the Name of a given access point
   1.187 +        * Name is validated and modified if needed.
   1.188 +        * Passed aName buffer MUST be large enough to hold the modified name.
   1.189 +        * @param aName A reference to the name of the access point.
   1.190 +        * The given name is returned in it.
   1.191 +        * @param aUid The UID of the access point.
   1.192 +        * @return no return value.
   1.193 +        *
   1.194 +        * @deprecated
   1.195 +        */
   1.196 +        IMPORT_C void SetNameL( TDes& aName, TUint32 aUid );
   1.197 +
   1.198 +
   1.199 +        /**
   1.200 +        * Sets the ISP type for a given access point
   1.201 +        * @param aUid The UID of the access point
   1.202 +        * @param aIspType The desired Isp type of the access point
   1.203 +        * @return no return value.
   1.204 +        *
   1.205 +        * @deprecated
   1.206 +        */
   1.207 +        IMPORT_C void SetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType );
   1.208 +
   1.209 +
   1.210 +        /**
   1.211 +        * Gets the Iap record ID for a given access point ID
   1.212 +        * @param aUid The UID of the access point
   1.213 +        * @return The Iap record ID.
   1.214 +        *
   1.215 +        * @deprecated
   1.216 +        */
   1.217 +        IMPORT_C TUint32 IapIdFromWapIdL( TUint32 aUid );
   1.218 +
   1.219 +
   1.220 +        /**
   1.221 +        * Gets the Wap record ID for a given Iap record ID
   1.222 +        * @param aUid The UID of the Iap
   1.223 +        * @return The Wap access point ID.
   1.224 +        *
   1.225 +        * @deprecated
   1.226 +        */
   1.227 +        IMPORT_C TUint32 WapIdFromIapIdL( TUint32 aUid );
   1.228 +
   1.229 +
   1.230 +
   1.231 +        /**
   1.232 +        * Returns whether the access point has the WAP-mandatory
   1.233 +        * fields filled or not.
   1.234 +        * Starts a transaction which is 'internal' to ApEngine if
   1.235 +        * client not started one.
   1.236 +        * @param  aUid The UID of the access point
   1.237 +        * @return TBool Are the WAP-mandatory fields filled in the access point?
   1.238 +        *
   1.239 +        * @deprecated
   1.240 +        */
   1.241 +        IMPORT_C TBool HasMandatoryFieldsFilledL( TUint32 aUid );
   1.242 +
   1.243 +        /**
   1.244 +        * Returns in a TBool whether the internet access point part
   1.245 +        * identified by the passed aUid exists or not.
   1.246 +        * param aUid the internet access point ID to check for
   1.247 +        * (NOT equals to Wap access point ID).
   1.248 +        * return TBool indicating whether an internet access point
   1.249 +        * with the given ID exists or not.
   1.250 +        *
   1.251 +        * @deprecated
   1.252 +        */
   1.253 +        IMPORT_C TBool IAPExistsL( TUint32 aUid );
   1.254 +
   1.255 +        /**
   1.256 +        * Returns in a TBool whether the access point identified
   1.257 +        * by the passed aUid exists or not.
   1.258 +        * @param aUid the access point ID to check for.(Wap access point ID).
   1.259 +        * @return TBool indicating whether an access point with the
   1.260 +        * given ID exists or not.
   1.261 +        *
   1.262 +        * @deprecated
   1.263 +        */
   1.264 +        IMPORT_C TBool WapApExistsL( TUint32 aUid );
   1.265 +
   1.266 +        /**
   1.267 +        * Returns whether the access point has the WAP-mandatory
   1.268 +        * fields filled or not.
   1.269 +        * @param  aUid The UID of the access point
   1.270 +        * @return TBool Are the WAP-mandatory fields filled in the access point?
   1.271 +        *
   1.272 +        * @deprecated
   1.273 +        */
   1.274 +        IMPORT_C TBool DoHasMandatoryFieldsFilledL(
   1.275 +                        TUint32 aUid,
   1.276 +                        CCommsDbTableView* aWapt = NULL,
   1.277 +                        TApBearerType aBearertype = EApBearerTypeAllBearers );
   1.278 +
   1.279 +
   1.280 +        /**
   1.281 +        * Indicates whether a given name is valid or not.
   1.282 +        * The name is valid if none, or only the aAcceptUid AP has it.
   1.283 +        * @param aNameText The name to check.
   1.284 +        * @param aAcceptUid A UID to accept with this name
   1.285 +        * @return Boolean indicating if it is valid or not.
   1.286 +        *
   1.287 +        * @deprecated
   1.288 +        */
   1.289 +        IMPORT_C TBool IsValidNameL( const TDesC& aNameText,
   1.290 +                                     TUint32 aAcceptUid );
   1.291 +
   1.292 +
   1.293 +        /**
   1.294 +        * Determines whether a given AP is read-only or not.
   1.295 +        * @param aUid A UID to look for
   1.296 +        * @return Boolean indicating if it is read-only or not.
   1.297 +        *
   1.298 +        * @deprecated
   1.299 +        */
   1.300 +        IMPORT_C TBool IsReadOnlyL( TUint32 aUid );
   1.301 +
   1.302 +
   1.303 +
   1.304 +        /**
   1.305 +        * Determines whether a given LAN_SERVICE commsdb id 
   1.306 +        * is linked to a WLAN data (thus is it a WLAN) or not.
   1.307 +        * @param aUid A UID to look for
   1.308 +        * @return Boolean indicating if it is WLAN or not.
   1.309 +        */
   1.310 +        TBool IsWlanL( TUint32 aLanCommdbId );
   1.311 +        
   1.312 +        
   1.313 +        
   1.314 +        
   1.315 +        /**
   1.316 +        * Determines whether a given LAN_SERVICE commsdb id 
   1.317 +        * which is linked to a WLAN data (thus is it a WLAN) 
   1.318 +        * has a valid SSID or it is empty
   1.319 +        * @param aUid A UID to look for
   1.320 +        * @return Boolean indicating if it has WLAN SSID or not.
   1.321 +        */
   1.322 +        TBool HasWlanSSIDL( TUint32 aLanCommdbId );
   1.323 +        
   1.324 +    protected:
   1.325 +
   1.326 +
   1.327 +        /**
   1.328 +        * Indicates the WAP bearer type of a given access point.
   1.329 +        * Passed descriptor MUST be large enough to hold the new data,
   1.330 +        * otherwise leaves with KErrDescOverflow.
   1.331 +        * The maximum length is the maximum length of a 'normal' text fields
   1.332 +        * length in Comms DB, KCommsDbSvrMaxFieldLength,
   1.333 +        * which is defined in cdblen.h.
   1.334 +        * @param aUid The UID of the access point.
   1.335 +        * @param aBearer A reference to a TBearer to hold the bearer
   1.336 +        * type of the access point.
   1.337 +        * @return no return value.
   1.338 +        */
   1.339 +        void DoWapBearerTypeL( TUint32 aUid, TDes& aBearer );
   1.340 +
   1.341 +
   1.342 +        /**
   1.343 +        * Gets the bearer type of a given access point. Leaves on error.
   1.344 +        * @param aUid The UID of the access point.
   1.345 +        * @return The type of the bearer.
   1.346 +        */
   1.347 +        TApBearerType DoBearerTypeL( TUint32 aUid );
   1.348 +
   1.349 +
   1.350 +        /**
   1.351 +        * Indicates the ISP type of a given access point.
   1.352 +        * @param aUid The UID of the access point.
   1.353 +        * @param aIspType A reference to a TCommsDbIspType to hold the value
   1.354 +        * @return No return value.
   1.355 +        */
   1.356 +        void DoISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType );
   1.357 +
   1.358 +
   1.359 +        /**
   1.360 +        * Reads the Name of a given access point
   1.361 +        * @param aUid The UID of the access point.
   1.362 +        * @param A reference to hold the name of the access point.
   1.363 +        * @return no return value.
   1.364 +        * Passed descriptor MUST be large enough to hold the new data,
   1.365 +        * otherwise leaves with KErrDescOverflow.
   1.366 +        */
   1.367 +        void DoNameL( TUint32 aUid, TDes& aName );
   1.368 +
   1.369 +
   1.370 +        /**
   1.371 +        * Sets the Name of a given access point
   1.372 +        * Name is validated and modified if needed.
   1.373 +        * Passed aName buffer MUST be large enough to hold the modified name.
   1.374 +        * @param aName A reference to the name of the access point.
   1.375 +        * The given name is returned in it.
   1.376 +        * @param aUid The UID of the access point.
   1.377 +        * @return no return value.
   1.378 +        */
   1.379 +        void DoSetNameL( TDes& aName, TUint32 aUid );
   1.380 +
   1.381 +
   1.382 +        /**
   1.383 +        * Sets the ISP type for a given access point
   1.384 +        * @param aUid The UID of the access point
   1.385 +        * @param aIspType The desired Isp type of the access point
   1.386 +        * @return no return value.
   1.387 +        */
   1.388 +        void DoSetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType );
   1.389 +
   1.390 +
   1.391 +        /**
   1.392 +        * Returns in a TBool whether the record
   1.393 +        * identified by the passed aUid exists or not
   1.394 +        * in the table identified by the passed table name.
   1.395 +        * @param aTable The name of the table to check
   1.396 +        * @param aUid The UID to check for
   1.397 +        * @return TBool indicating whether the record
   1.398 +        * with the given ID exists in the given table or not.
   1.399 +        */
   1.400 +        TBool DoesExistsL( TPtrC aTable, TUint32 aUid );
   1.401 +
   1.402 +
   1.403 +        /**
   1.404 +        * Wrapper for public API.
   1.405 +        * Determines whether a given LAN_SERVICE commsdb id 
   1.406 +        * is linked to a WLAN data (thus is it a WLAN) or not.
   1.407 +        * @param aUid A UID to look for
   1.408 +        * @return Boolean indicating if it is WLAN or not.
   1.409 +        */
   1.410 +        TBool DoIsWlanL( TUint32 aLanCommdbId );
   1.411 +        
   1.412 +        
   1.413 +    private:    // Data
   1.414 +        CCommsDatabase* iDb;
   1.415 +        // TCommDbDatabaseType iDbType; // deprecated and not used but kept 
   1.416 +        // to maintain class size for BC
   1.417 +        // Added a new iExt for expansion instead of TCommDbDatabaseType 
   1.418 +        // same size, no BC problem...
   1.419 +        TUtilsExtra*  iExt;
   1.420 +
   1.421 +
   1.422 +    };
   1.423 +
   1.424 +#endif      // APUTILS_H
   1.425 +
   1.426 +// End of File