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