epoc32/include/mw/apdatahandler.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.
     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 class CApDataHandler
    15 *
    16 */
    17 
    18 
    19 #ifndef APDATAHANDLER_H
    20 #define APDATAHANDLER_H
    21 
    22 // Deprecation warning
    23 #warning This header file has been deprecated. Will be removed in one of the next SDK releases.
    24  
    25  
    26 //  INCLUDES
    27 #include <commdb.h>
    28 #include <etelmm.h>
    29 #include <ApEngineVer.h>
    30 #include <ApEngineConsts.h>
    31 
    32 
    33 // FORWARD DECLARATIONS
    34 class CApAccessPointItem;
    35 class CApNetworkItem;
    36 
    37 // extra data holder.
    38 typedef struct
    39     {
    40         TInt    iIsIpv6Supported;            // Is Ipv6 Supported?
    41         TBool   iIsFeatureManagerInitialised;// Is FeatureManager Initialised?
    42 
    43         /**
    44         * Indicates if HSCSD Access point is supported or not.
    45         */
    46         TBool   iIsAppHscsdSupport;              
    47 
    48         TInt    iVariant;               /// Local variant value
    49 
    50 
    51     }THandlerExtra;
    52 
    53 // CLASS DECLARATION
    54 
    55 /**
    56 *  Representation of the access point handler.
    57 *  Encapsulates a session with the CommsDB
    58 *  Provides a way to access the database and manipulate its data.
    59 */
    60 class CApDataHandler :public CBase
    61     {
    62     public:  // Constructors and destructor
    63         
    64         /**
    65         * Two-phased constructor. Leaves on failure, places instance
    66         * on cleanup stack.
    67         * @param aDb a reference to a CCommsDataBase object.
    68         * @return The constructed CApDataHandler.
    69         *
    70         * @deprecated
    71         */
    72         IMPORT_C static CApDataHandler* NewLC( CCommsDatabase& aDb );
    73 
    74 
    75         /**
    76         * Destructor.
    77         *
    78         * @deprecated
    79         */
    80         IMPORT_C virtual ~CApDataHandler();
    81 
    82 
    83 protected:      // Constructors
    84 
    85         /**
    86         * C++ default constructor.
    87         *
    88         * @deprecated
    89         */
    90         IMPORT_C CApDataHandler();
    91 
    92         /**
    93         * Second-phase constructor.
    94         *
    95         * @deprecated
    96         */
    97         IMPORT_C void ConstructL( CCommsDatabase& aDb );
    98 
    99 
   100     private:
   101 
   102 
   103     public: // New functions
   104         // query
   105         /**
   106         * Reads up one access point's data from the database.
   107         * Expects that CApDataHandler has been created and the database had
   108         * been opened.
   109         * In case of error, function leaves with error code.
   110         * <br>Error conditions:
   111         *   - Insufficient memory,
   112         *   - AP does not exists,
   113         *   - Server connection failure.
   114         *
   115         * @param aUid The Uid of the access point to be read
   116         * @param aApItem A reference to a CApAccessPointItem to hold the data.
   117         * @return no return value.
   118         *
   119         * @deprecated
   120         */
   121         IMPORT_C void AccessPointDataL( TUint32 aUid,
   122                                       CApAccessPointItem& aApItem );
   123 
   124 
   125         // update
   126         /**
   127         * Updates data stored in an existing access point.
   128         * Expects that CApDataHandler has been created and the database had
   129         * been opened.
   130         * In case of error, no data is stored.
   131         * <br>Error conditions:
   132         *   - Insufficient memory
   133         *   - Server connection failure
   134         *   - Lock already present by other task
   135         *   - Uid does not exists.
   136         *   - Attempting to update read-only records will result
   137         *     in KErrAccessDenied
   138         *
   139         * @param aApItem A reference to a CApAccessPointItem holding the data
   140         * @param aNameChanged a reference to a TBool that will indicate
   141         * whether the name has changed or not.
   142         * @return No return value.
   143         *
   144         * @deprecated
   145         */
   146         IMPORT_C void UpdateAccessPointDataL( CApAccessPointItem& aApItem,
   147                                               TBool& aNameChanged );
   148 
   149 
   150         // Creating new AP
   151         /**
   152         * Creates a copy of a previously existing access point.
   153         * Expects that CApDataHandler has been created and the database had
   154         * been opened.
   155         * In case of error, no access point will be created.
   156         * <br>Error conditions:
   157         *   - Insufficient memory
   158         *   - Server connection failure.
   159         *   - Lock already present by other task.
   160         *   - Access point does not exist.
   161         *   - Attempting to create new in protected tables will results
   162         *     in KErrAccessDenied
   163         *
   164         * @param aBaseId The UID of the existing access point to copy from.
   165         * @return The Uid of the newly constructed and saved access point.
   166         *
   167         * @deprecated
   168         */
   169         IMPORT_C TUint32 CreateCopyFromL( TUint32 aBaseId );
   170 
   171 
   172         /**
   173         * Create a new access point from supplied data
   174         * Expects that CApDataHandler has been created and the database had
   175         * been opened.
   176         * The name of the AP will be corrected to be unique if necessary and
   177         * returned in the passed aApItem.
   178         * In case of error, no access point will be created and the passed
   179         * one will remain intact.
   180         * <br>Error conditions:
   181         *   - Insufficient memory
   182         *   - Server connection failure.
   183         *   - Lock already present by other task.
   184         *   - Attempting to create new in protected tables will result
   185         * in KErrAccessDenied
   186         *
   187         * @param aApItem Reference to a CApAccessPointItem holding the data
   188         * @return The UID of the newly created and saved access point.
   189         *
   190         * @deprecated
   191         */
   192         IMPORT_C TUint32 CreateFromDataL( CApAccessPointItem& aApItem );
   193 
   194 
   195         // Remove
   196         /**
   197         * Removes the given access point from the database.
   198         * Expects that CApDataHandler has been created and the database had
   199         * been opened.
   200         * In case of error, access point will not be removed.
   201         * <br>Error conditions:
   202         *   - Insufficient memory,
   203         *   - Server connection failure.
   204         *   - Lock already present by other task.
   205         *   - Access point does not exist.
   206         *   - Attempting to remove read-only records will result
   207         * in KErrAccessDenied
   208         *
   209         * @param aUid The UID of the access point to remove.
   210         * @return no return value.
   211         *
   212         * @deprecated
   213         */
   214         IMPORT_C void RemoveAPL( TUint32 aUid );
   215 
   216 
   217         // Getting default access point
   218         /**
   219         * Reads the UID of the default access point.
   220         * Expects that CApDataHandler has been created and the database had
   221         * been opened.
   222         * In case of error, leaves with CommsDb or system error codes.
   223         * <br>Error conditions:
   224         *   - Insufficient memory;
   225         *   - Server connection failure;
   226         *   - Lock already present;
   227         *   - Access point does not exists.
   228         *
   229         * @param aIsWAP A boolean indicating whether to read the default
   230         * WAP or the default IAP/ISP (dep. on the database type) access point.
   231         * @return The UID of the default access point.
   232         *
   233         * @deprecated
   234         */
   235         IMPORT_C TUint32 DefaultL( TBool aIsWap ) const;
   236 
   237 
   238         // Setting as default
   239         /**
   240         * Sets the default access point.
   241         * Expects that CApDataHandler has been created and the database had
   242         * been opened.
   243         * In case of error, leaves with CommsDb or system error codes.
   244         * <br>Error conditions:
   245         *   - Insufficient memory;
   246         *   - Server connection failure;
   247         *   - Lock already present;
   248         *   - Access point does not exists.
   249         *   - Given Access Point is not of the desired type.
   250         *
   251         * @param aUid The UID of the access point to be set as default.
   252         * @param aIntendedType The default type ( IAP, WAP, Both).
   253         *
   254         * @deprecated
   255         */
   256         IMPORT_C void SetAsDefaultL(TUint32 aUid,
   257                                     TCommsDbIspType aIntendedType );
   258 
   259 
   260 
   261         // Setting preferences
   262         /**
   263         * Sets the access point preference. Can be used only if the
   264         * database type is IAP.
   265         * Expects that CApDataHandler has been created and the database had
   266         * been opened.
   267         * In case of error, leaves with CommsDb or system error codes.
   268         * <br>Error conditions:
   269         *   - Insufficient memory;
   270         *   - Server connection failure;
   271         *   - Lock already present;
   272         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   273         * @param aRank The ranking of the connection preference.
   274         * @param aDircetion Specifies the direction of this connection
   275         * preference
   276         * @param aBearers The bearer set being valid for this connection
   277         * preference
   278         * @param aPrompt Enum value indicating whether or not the user
   279         * should be prompted or warned on connection
   280         * @param aIAP The identifier of the preferred IAP for this connection.
   281         * @param aOverwrite Boolean value indicating that if a same record
   282         * present, overwrite it or not.
   283         *
   284         * @deprecated
   285         */
   286         IMPORT_C void SetPreferredIfDbIapTypeL
   287                                     (
   288                                     TUint32 aRank,
   289                                     TCommDbConnectionDirection aDirection,
   290                                     TUint32 aBearers,
   291                                     TCommDbDialogPref aPrompt,
   292                                     TUint32 aIAP,
   293                                     TBool aOverwrite
   294                                     );
   295 
   296         /**
   297         * Sets the access point preference. Can be used only if the
   298         * database type is ISP.
   299         * Expects that CApDataHandler has been created and the database had
   300         * been opened.
   301         * In case of error, leaves with CommsDb or system error codes.
   302         * <br>Error conditions:
   303         *   - Insufficient memory;
   304         *   - Server connection failure;
   305         *   - Lock already present;
   306         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   307         * @param aRank The ranking of the connection preference.
   308         * @param aDircetion Specifies the direction of this connection
   309         * preference
   310         * @param aBearers The bearer set beeing valid for this connection
   311         * preference
   312         * @param aPrompt Enum value indicating whether or not the user
   313         * should be prompted or warned on connection
   314         * @param aISP The identifier of the preferred ISP for this connection.
   315         * @param aChargeCard Identifier of the preferred chargecard for
   316         * this connection.
   317         * @param aServiceType The type of the service.
   318         * @param aOverwrite Boolean value indicating that if a same record is
   319         * present, overwrite it or not.
   320         *
   321         * @deprecated
   322         */
   323         IMPORT_C void SetPreferredIfDbIspTypeL
   324                                     (
   325                                     TUint32 aRank,
   326                                     TCommDbConnectionDirection aDirection,
   327                                     TUint32 aBearers,
   328                                     TCommDbDialogPref aPrompt,
   329                                     TUint32 aISP,
   330                                     TUint32 aChargeCard,
   331                                     const TDesC& aServiceType,
   332                                     TBool aOverwrite
   333                                     );
   334 
   335 
   336 
   337         /**
   338         * Gets the access point preference. Can be used only if the
   339         * database type is IAP.
   340         * Expects that CApDataHandler has been created and the database had
   341         * been opened.
   342         * In case of error, leaves with CommsDb or system error codes.
   343         * <br>Error conditions:
   344         *   - Insufficient memory;
   345         *   - Server connection failure;
   346         *   - Lock already present;
   347         * @param aRank The ranking of the desired connection preference.
   348         * @param aDircetion Specifies the direction of the desired connection
   349         * preference
   350         * @param aBearers The bearer set beeing valid for this connection
   351         * preference
   352         * @param aPrompt Enum value indicating whether or not the user
   353         * should be prompted or warned on connection
   354         * @param aIAP The identifier of the preferred IAP for this
   355         * connection preference.
   356         *
   357         * @deprecated
   358         */
   359         IMPORT_C void GetPreferredIfDbIapTypeL
   360                                     (
   361                                     TUint32 aRank,
   362                                     TCommDbConnectionDirection aDirection,
   363                                     TUint32& aBearers,
   364                                     TUint32& aPrompt,
   365                                     TUint32& aIAP
   366                                     );
   367 
   368         /**
   369         * Gets the access point preference. Can be used only if the
   370         * database type is ISP.
   371         * Expects that CApDataHandler has been created and the database had
   372         * been opened.
   373         * In case of error, leaves with CommsDb or system error codes.
   374         * <br>Error conditions:
   375         *   - Insufficient memory;
   376         *   - Server connection failure;
   377         *   - Lock already present;
   378         * @param aRank The ranking of the desired connection preference.
   379         * @param aDircetion Specifies the direction of the desired connection
   380         * preference
   381         * @param aBearers The bearer set beeing valid for this connection
   382         * preference
   383         * @param aPrompt Enum value indicating whether or not the user
   384         * should be prompted or warned on connection
   385         * @param aISP The identifier of the preferred ISP for this
   386         * connection preference.
   387         * @param aChargeCard Identifier of the preferred chargecard for
   388         * this connection preference.
   389         * @return The type of the service.
   390         *
   391         * @deprecated
   392         */
   393         IMPORT_C const TDesC& GetPreferredIfDbIspTypeL
   394                                     (
   395                                     TUint32 aRank,
   396                                     TCommDbConnectionDirection aDirection,
   397                                     TUint32& aBearers,
   398                                     TUint32& aPrompt,
   399                                     TUint32& aISP,
   400                                     TUint32& aChargeCard
   401                                     );
   402 
   403 
   404         // Getting default access point
   405         /**
   406         * Reads the UID of the default access point.
   407         * Expects that CApDataHandler has been created and the database had
   408         * been opened.
   409         * In case of error, leaves with CommsDb or system error codes.
   410         * <br>Error conditions:
   411         *   - Insufficient memory;
   412         *   - Server connection failure;
   413         *   - Lock already present;
   414         *   - Access point does not exists.
   415         *
   416         * @param aIsWAP A boolean indicating whether to read the default
   417         * WAP or the default IAP/ISP (dep. on the database type) access point.
   418         * @param aReadOnly A TBool passed by reference to hold whether the
   419         * the default access point record is read-only or not.
   420         * @return The UID of the default access point.
   421         *
   422         * @deprecated
   423         */
   424         IMPORT_C TUint32 DefaultL( TBool aIsWap, TBool& aReadOnly )const;
   425 
   426 
   427 
   428 
   429         // Remove
   430         /**
   431         * Removes the given network group from the database.
   432         * Expects that CApDataHandler has been created and the database had
   433         * been opened.
   434         * In case of error, network group will not be removed.
   435         * <br>Error conditions:
   436         *   - Insufficient memory,
   437         *   - Server connection failure.
   438         *   - Lock already present by other task.
   439         *   - network group does not exist.
   440         *   - Attempting to remove read-only records will result
   441         * in KErrAccessDenied
   442         *
   443         * @param aUid The UID of the network group to remove.
   444         * @return no return value.
   445         *
   446         * @deprecated
   447         */
   448         IMPORT_C void RemoveNetworkL( TUint32 aUid );
   449 
   450 
   451         /**
   452         * Creates a network group from the data.
   453         * Expects that CApDataHandler has been created and the database had
   454         * been opened.
   455         * In case of error, network group will not be created.
   456         * <br>Error conditions:
   457         *   - Insufficient memory,
   458         *   - Server connection failure.
   459         *   - Lock already present by other task.
   460         *   - network group does not exist.
   461         *   - Attempting to remove read-only records will result
   462         * in KErrAccessDenied
   463         *
   464         * @param aNetwork The network item to create/write into db.
   465         * @return no return value.
   466         *
   467         * @deprecated
   468         */
   469         IMPORT_C void CreateNetworkL( CApNetworkItem& aNetwork );
   470 
   471 
   472         /**
   473         * Reads up a network part of the access point
   474         * Network is identified by the iNetworkId of the passed access point
   475         *
   476         * @deprecated
   477         */
   478         IMPORT_C void ReadNetworkPartL( CApAccessPointItem& aItem );
   479 
   480 
   481 
   482         /**
   483         * Reads up a network 
   484         * Network is identified by passed uid
   485         *
   486         * @deprecated
   487         */
   488         IMPORT_C void ReadNetworkL( TUint32 aUid, CApNetworkItem& aNetwork );
   489 
   490 
   491     protected:  // New functions
   492         /**
   493         * Reads the WAP part of the data from the database.
   494         * In case of error, leaves with CommDb error codes.
   495         * @param aWapId The UID of the Access Point to read the data from.
   496         * @param aApItem A reference to a CApAccessPointItem to hold the data
   497         * @return No return value.
   498         */
   499         void ReadWapDataL( TUint32 aWapId, CApAccessPointItem& aApItem );
   500 
   501 
   502         /**
   503         * Reads the IAP part of the data from the database.
   504         * In case of error, leaves with CommDb error codes.
   505         * @param aIapId The UID of the record in the IAP table to read
   506         * the data.
   507         * @param aApItem A reference to a CApAccessPointItem to hold the data
   508         * @return No return value.
   509         */
   510         void ReadIapDataL( TUint32 aIapId, CApAccessPointItem& aApItem );
   511 
   512 
   513         /**
   514         * Reads the ISP part of the data from the database.
   515         * In case of error, leaves with CommDb error codes.
   516         * @param aIspId The UID of the record in the ISP table to
   517         * read the data.
   518         * @param aApItem A reference to a CApAccessPointItem to hold the data
   519         * @return No return value.
   520         */
   521         void ReadIspDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   522 
   523 
   524         /**
   525         * Reads the GPRS data from the database.
   526         * In case of error, leaves with CommDb error codes.
   527         * @param aIspId The UID of the record in the GPRS table to
   528         * read the data from.
   529         * @param aApItem A reference to a CApAccessPointItem to hold the data
   530         * @return No return value.
   531         */
   532         void ReadGprsDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   533 
   534 
   535         /**
   536         * Reads the LAN data from the database.
   537         * In case of error, leaves with CommDb error codes.
   538         * @param aIspId The UID of the record in the LAN table to
   539         * read the data from.
   540         * @param aApItem A reference to a CApAccessPointItem to hold the data
   541         * @return No return value.
   542         */
   543         void ReadLanDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   544 
   545 
   546         /**
   547         * Reads the DialIn/Out ISP data from the database.
   548         * In case of error, leaves with CommDb error codes.
   549         * @param aIspId The UID of the record in the Dialup table to
   550         * read the data from.
   551         * @param aApItem A reference to a CApAccessPointItem to hold the data
   552         * @return No return value.
   553         */
   554         void ReadDialInOutDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   555 
   556         
   557         /**
   558         * Reads up the VPN bearer type info in case of a VPN access point
   559         * In case of error, leaves with CommDb error codes.
   560         * @param aIspId The UID of the record in the VPN table to
   561         * read the data from.
   562         * @param aApItem A reference to a CApAccessPointItem to hold the data
   563         * @return No return value.
   564         */
   565         void ReadVpnInfoL( TUint32 aIspId, CApAccessPointItem& aApItem);
   566 
   567 
   568         /**
   569         * Writes the WAP bearer part of the data to the database.
   570         * In case of error, leaves with CommDb error codes.
   571         * @param aIsNew A Boolean indicating whether it is a new record or it
   572         * is an update operation.
   573         * @param aWapId The UID of the WAP Access Point record to update.
   574         * Used only if aIsNew EFalse.
   575         * @param aApItem Reference to a CApAccessPointItem which holds the data
   576         * @return No return value.
   577         */
   578         void WriteWapBearerDataL
   579                         (
   580                         TBool aIsNew,
   581                         TUint32 aWapId,
   582                         CApAccessPointItem& aApItem
   583                         );
   584 
   585 
   586         /**
   587         * Writes the WAP AP part of the data to the database.
   588         * In case of error, leaves with CommDb error codes.
   589         * @param aIsNew A Boolean indicating whether it is a new record or it
   590         * is an update operation.
   591         * @param aWapId The UID of the WAP Access Point record to update.
   592         * Used only if aIsNew EFalse.
   593         * @param aApItem Reference to a CApAccessPointItem which holds the data
   594         * @return No return value.
   595         */
   596         void WriteWapApDataL
   597                         (
   598                         TBool aIsNew,
   599                         TUint32 aWapId,
   600                         CApAccessPointItem& aApItem
   601                         );
   602 
   603 
   604 
   605         /**
   606         * Writes the IAP part of the data to the database.
   607         * In case of error, leaves with CommDb error codes.
   608         * @param aIsNew A Boolean indicating whether it is a new record or it
   609         * is an update operation.
   610         * @param aIapId The UID of the IAP Access Point record to update.
   611         * Used only if aIsNew EFalse.
   612         * @param aApItem Reference to a CApAccessPointItem which holds the data
   613         * @return No return value.
   614         */
   615         void WriteIapDataL
   616                         (
   617                         TBool aIsNew,
   618                         TUint32 aIapId,
   619                         CApAccessPointItem& aApItem
   620                         );
   621 
   622         /**
   623         * Writes the ISP part of the data to the database.
   624         * In case of error, leaves with CommDb error codes.
   625         * @param aIsNew A Boolean indicating whether it is a new record or it
   626         * is an update operation.
   627         * @param aIspId The UID of the ISP Access Point record to update.
   628         * Used only if aIsNew EFalse.
   629         * @param aApItem Reference to a CApAccessPointItem which holds the data
   630         * @return No return value.
   631         */
   632         void WriteIspDataL( TBool aIsNew, TUint32 aIspId,
   633                             CApAccessPointItem& aApItem );
   634 
   635         /**
   636         * Writes the Gprs data to the database.
   637         * In case of error, leaves with CommDb error codes.
   638         * @param aIsNew A Boolean indicating whether it is a new record or it
   639         * is an update operation.
   640         * @param aApItem Reference to a CApAccessPointItem which holds the data
   641         * @return No return value.
   642         */
   643         void WriteGprsDataL( TBool aIsNew,
   644                             CApAccessPointItem& aApItem );
   645 
   646         /**
   647         * Writes the LAN data to the database.
   648         * In case of error, leaves with CommDb error codes.
   649         * @param aIsNew A Boolean indicating whether it is a new record or it
   650         * is an update operation.
   651         * @param aApItem Reference to a CApAccessPointItem which holds the data
   652         * @return No return value.
   653         */
   654         void WriteLanDataL( TBool aIsNew,
   655                             CApAccessPointItem& aApItem );
   656 
   657 
   658         /**
   659         * Writes the data to the database.
   660         * In case of error, leaves with CommDb error codes.
   661         * @param aApItem Reference to a CApAccessPointItem which holds the data
   662         * @param aIsNew A Boolean indicating whether it is a new record or it
   663         * is an update operation.
   664         * @return No return value.
   665         */
   666         TUint32 DoUpdateAccessPointDataL( CApAccessPointItem& aApItem,
   667                                        TBool aIsNew, TBool& aNameChanged );
   668 
   669 
   670         /**
   671         * Sets the default IAP & ISP records in Global Settings.
   672         * In case of error, leaves with CommDb error codes.
   673         * @param aApItem A UID to the WAP Access Point record to
   674         * be used as a default.
   675         * @return No return value.
   676         */
   677         void SetDefaultIapIspL( TUint32 aUid );
   678 
   679         // Remove
   680         /**
   681         * Removes the WAP_BEARER table part of the access point from
   682         * the database.
   683         * Expects that CApDataHandler has been created and the database had
   684         * been opened.
   685         * In case of error, access point will not be removed.
   686         * @param aUid The UID of the access point to remove.
   687         * @return No return value.
   688         */
   689         void RemoveWapBearerApL( TUint32 aUid );
   690 
   691 
   692         /**
   693         * Removes the WAP_ACCESS_POINT table part of the access point from
   694         * the database.
   695         * Expects that CApDataHandler has been created and the database had
   696         * been opened.
   697         * In case of error, access point will not be removed.
   698         * @param aUid The UID of the access point to remove.
   699         * @return No return value.
   700         */
   701         void RemoveWapApL( TUint32 aUid );
   702 
   703 
   704         /**
   705         * Removes the IAP part of the access point from the database.
   706         * Expects that CApDataHandler has been created and the database had
   707         * been opened.
   708         * In case of error, access point will not be removed.
   709         * @param aUid The UID of the IAP part of the access point to remove.
   710         * @return No return value.
   711         */
   712         void RemoveIapL( TUint32 aUid );
   713 
   714 
   715         /**
   716         * Removes the ISP part of the access point from the database.
   717         * Expects that CApDataHandler has been created and the database had
   718         * been opened.
   719         * In case of error, access point will not be removed.
   720         * @param aUid The UID of the ISP part of the access point to remove.
   721         * @param aOut TBool indicating whether Dial out or dial in ISP.
   722         * @return No return value.
   723         */
   724         void RemoveIspL( TUint32 aUid, TBool aOut );
   725 
   726 
   727         /**
   728         * Removes the GPRS part of the access point from the database.
   729         * Expects that CApDataHandler has been created and the database had
   730         * been opened.
   731         * In case of error, access point will not be removed.
   732         * @param aUid The UID of the GPRS part of the access point to remove.
   733         * @return No return value.
   734         */
   735         void RemoveGprsL( TUint32 aUid, TBool aOut );
   736 
   737 
   738         /**
   739         * Removes the LAN part of the access point from the database.
   740         * Expects that CApDataHandler has been created and the database had
   741         * been opened.
   742         * In case of error, access point will not be removed.
   743         * @param aUid The UID of the LAN part of the access point to remove.
   744         * @return No return value.
   745         */
   746         void RemoveLanL( TUint32 aUid );
   747 
   748 
   749         /**
   750         * Removes the WLAN part of the access point from the database.
   751         * Expects that CApDataHandler has been created and the database had
   752         * been opened.
   753         * In case of error, access point will not be removed.
   754         * @param aUid The UID of the LAN part of the access point to remove.
   755         * @return No return value.
   756         */
   757         void RemoveWlanL( TUint32 aUid );
   758         
   759         
   760         /**
   761         * Handles the bearer change related things (deleting old links,
   762         * inserting new ones if needed in the database).
   763         * Expects that CApDataHandler has been created and the database had
   764         * been opened.
   765         * In case of error, access point data will not be changed.
   766         * @param aApItem A reference to a CApAccessPointItem holding the
   767         * CHANGED data.
   768         * @return Boolean indicating whether bearer has changed or not.
   769         */
   770         TBool HandleBearerChangeIfNeededL( CApAccessPointItem& aApItem );
   771 
   772 
   773 
   774         /**
   775         * Reads up one access point's data from the database.
   776         * Expects that CApDataHandler has been created and the database had
   777         * been opened.
   778         * In case of error, function leaves with error code.
   779         * <br>Error conditions:
   780         *   - Insufficient memory,
   781         *   - AP does not exists,
   782         *   - Server connection failure.
   783         *
   784         * @param aUid The Uid of the access point to be read
   785         * @param aApItem A reference to a CApAccessPointItem to hold the data.
   786         * @return no return value.
   787         */
   788         void DoAccessPointDataL( TUint32 aUid, CApAccessPointItem& aApItem );
   789 
   790 
   791         /**
   792         * Removes the given access point from the database.
   793         * Expects that CApDataHandler has been created and the database had
   794         * been opened.
   795         * In case of error, access point will not be removed.
   796         * <br>Error conditions:
   797         *   - Insufficient memory,
   798         *   - Server connection failure.
   799         *   - Lock already present by other task.
   800         *   - Access point does not exist.
   801         *   - Attempting to remove read-only records will result
   802         * in KErrAccessDenied
   803         *
   804         * @param aUid The UID of the access point to remove.
   805         * @return no return value.
   806         */
   807         void DoRemoveAPL( TUint32 aUid );
   808 
   809 
   810         /**
   811         * Sets the default access point.
   812         * Expects that CApDataHandler has been created and the database had
   813         * been opened.
   814         * In case of error, leaves with CommsDb or system error codes.
   815         * <br>Error conditions:
   816         *   - Insufficient memory;
   817         *   - Server connection failure;
   818         *   - Lock already present;
   819         *   - Access point does not exists.
   820         *   - Given Access Point is not of the desired type.
   821         *
   822         * @param aUid The UID of the access point to be set as default.
   823         * @param aIntendedType The default type ( IAP, WAP, Both).
   824         */
   825         void DoSetAsDefaultL(TUint32 aUid, TCommsDbIspType aIntendedType );
   826 
   827 
   828         /**
   829         * Sets the access point preference. Can be used only if the
   830         * database type is IAP.
   831         * Expects that CApDataHandler has been created and the database had
   832         * been opened.
   833         * In case of error, leaves with CommsDb or system error codes.
   834         * <br>Error conditions:
   835         *   - Insufficient memory;
   836         *   - Server connection failure;
   837         *   - Lock already present;
   838         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   839         * @param aRank The ranking of the connection preference.
   840         * @param aDircetion Specifies the direction of this connection
   841         * preference
   842         * @param aBearers The bearer set beeing valid for this connection
   843         * preference
   844         * @param aPrompt Enum value indicating whether or not the user
   845         * should be prompted or warned on connection
   846         * @param aIAP The identifier of the preferred IAP for this connection.
   847         * @param aOverwrite Boolean value indicating that if a same record
   848         * present, overwrite it or not.
   849         */
   850         void DoSetPreferredIfDbIapTypeL
   851                                     (
   852                                     TUint32 aRank,
   853                                     TCommDbConnectionDirection aDirection,
   854                                     TUint32 aBearers,
   855                                     TCommDbDialogPref aPrompt,
   856                                     TUint32 aIAP,
   857                                     TBool aOverwrite
   858                                     );
   859 
   860 
   861         /**
   862         * Sets the access point preference. Can be used only if the
   863         * database type is ISP.
   864         * Expects that CApDataHandler has been created and the database had
   865         * been opened.
   866         * In case of error, leaves with CommsDb or system error codes.
   867         * <br>Error conditions:
   868         *   - Insufficient memory;
   869         *   - Server connection failure;
   870         *   - Lock already present;
   871         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   872         * @param aRank The ranking of the connection preference.
   873         * @param aDircetion Specifies the direction of this connection
   874         * preference
   875         * @param aBearers The bearer set beeing valid for this connection
   876         * preference
   877         * @param aPrompt Enum value indicating whether or not the user
   878         * should be prompted or warned on connection
   879         * @param aISP The identifier of the preferred ISP for this connection.
   880         * @param aChargeCard Identifier of the preferred chargecard for
   881         * this connection.
   882         * @param aServiceType The type of the service.
   883         * @param aOverwrite Boolean value indicating that if a same record
   884         * present, overwrite it or not.
   885         */
   886         void DoSetPreferredIfDbIspTypeL
   887                                     (
   888                                     TUint32 aRank,
   889                                     TCommDbConnectionDirection aDirection,
   890                                     TUint32 aBearers,
   891                                     TCommDbDialogPref aPrompt,
   892                                     TUint32 aISP,
   893                                     TUint32 aChargeCard,
   894                                     const TDesC& aServiceType,
   895                                     TBool aOverwrite
   896                                     );
   897 
   898 
   899         /**
   900         * Converts setted AP speed from TApCallSpeed to commsdb values
   901         * @param The access point item whose speed needs to be converted
   902         * @return no return value
   903         */
   904         /*****************************************************
   905         *   Series 60 Customer / ETel
   906         *   Series 60  ETel API
   907         *****************************************************/
   908         void ApSpeed2EtelL( CApAccessPointItem* aItem );
   909 
   910 
   911         /**
   912         * Converts commsdb speed values to TApCallSpeed 
   913         * @param The access point item whose speed needs to be converted
   914         * @return no return value
   915         */
   916         /*****************************************************
   917         *   Series 60 Customer / ETel
   918         *   Series 60  ETel API
   919         *****************************************************/
   920         void EtelSpeed2ApL(  CApAccessPointItem& aItem );
   921 
   922 
   923         // Getting default access point
   924         /**
   925         * Reads the UID of the default access point.
   926         * Expects that CApDataHandler has been created and the database had
   927         * been opened.
   928         * In case of error, leaves with CommsDb or system error codes.
   929         * <br>Error conditions:
   930         *   - Insufficient memory;
   931         *   - Server connection failure;
   932         *   - Lock already present;
   933         *   - Access point does not exists.
   934         *
   935         * @param aIsWAP A boolean indicating whether to read the default
   936         * WAP or the default IAP/ISP (dep. on the database type) access point.
   937         * @param TBool*: if not NULL, a holder for the read-only flag of
   938         * the default access point. Prepared for future products but also used
   939         * here through passing NULL ptr.
   940         * @return The UID of the default access point.
   941         */
   942         TUint32 DoGetDefaultL( TBool aIsWap, TBool* aReadOnly ) const;
   943 
   944 
   945         /**
   946         * Writes the proxy data of an access point
   947         * @param aIsNew Boolean stating whether the access point is new
   948         * @param aApItem A CApAccessPointItem passed by reference 
   949         * holding the current access point data. It's record ID's will be 
   950         * updated if needed (in case it is a new item )
   951         */
   952         void WriteProxyDataL( TBool aIsNew, 
   953                               const CApAccessPointItem& aApItem );
   954 
   955 
   956         /**
   957         * Reads up the proxy data of an access point
   958         * @param aApItem A CApAccessPointItem passed by reference 
   959         * holding the current access point data. 
   960         */
   961         void ReadProxyDataL( CApAccessPointItem& aApItem );
   962 
   963 
   964         /**
   965         * Removes a proxy data
   966         * @param aServiceType   The service type to remove for
   967         * @param aIspId         The service record ID
   968         */
   969         void RemoveProxyDataL( HBufC* aServiceType, TUint32 aIspId );
   970 
   971 
   972         /**
   973         * Writes the network data of an access point
   974         * @param aIsNew Boolean stating whether the access point is new
   975         * @param aApItem A CApAccessPointItem passed by reference 
   976         * holding the current access point data. It's record ID's will be 
   977         * updated if needed (in case it is a new item )
   978         */
   979         void WriteNetworkDataL( TBool aIsNew, CApAccessPointItem& aApItem );
   980 
   981 
   982         /**
   983         * Reads up the network data of an access point
   984         * @param aApItem A CApAccessPointItem passed by reference 
   985         * holding the current access point data. 
   986         */
   987         void ReadNetworkDataL( CApAccessPointItem& aApItem );
   988 
   989 
   990         /**
   991         * Removes the network data
   992         * @param aIspId The record ID to remove
   993         */
   994         void RemoveNetworkDataL( TUint32 aIspId );
   995 
   996 
   997         /**
   998         * Gets the location record ID
   999         * @return The UID of the location.
  1000         */
  1001         TUint32 GetLocationIdL();
  1002 
  1003 
  1004         /**
  1005         * Gets the modem record ID
  1006         * @return The UID of the modem record.
  1007         */
  1008         TUint32 GetModemBearerIDL( CApAccessPointItem& aApItem );
  1009 
  1010 
  1011         /**
  1012         * Returns the protocol for the passed item
  1013         * @param aApItem An access point item 
  1014         * @return The protocol of the passed item.
  1015         */
  1016         TUint32 ProtocolL( CApAccessPointItem& aApItem );
  1017 
  1018         /**
  1019         * Returns the commsdb speed for the passed item
  1020         * @param aApItem An access point item 
  1021         * @return The speed of the passed item.
  1022         */
  1023         TUint32 CommsDbSpeedL( CApAccessPointItem& aApItem );
  1024 
  1025 
  1026         /**
  1027         * Reads up common IP & PPP SERVICE data parts of an access point.
  1028         * Leaves if it is not persent in the database
  1029         * @param The table to read from
  1030         * @param The CApAccessPointItem to store into
  1031         */
  1032         void ReadServiceL( CCommsDbTableView& ispt, 
  1033                            CApAccessPointItem& aApItem );
  1034 
  1035 
  1036         /**
  1037         * Reads up CSD/GPRS IPv6 parts of an access point.
  1038         * Leaves if it is not persent in the database
  1039         * @param The table to read from
  1040         * @param The CApAccessPointItem to store into
  1041         */
  1042         void ReadServiceIp6L( CCommsDbTableView& ispt,
  1043                               CApAccessPointItem& aApItem );
  1044 
  1045 
  1046         /**
  1047         * Writes common IP & PPP SERVICE data parts of an access point.
  1048         * Leaves if it is not persent in the database
  1049         * @param The table to write into 
  1050         * @param The CApAccessPointItem holding the data to store 
  1051         */
  1052         void WriteServiceL( CCommsDbTableView& aTable,
  1053                             CApAccessPointItem& aApItem );
  1054 
  1055 
  1056         /**
  1057         * Writes the IPv6 parts of an access point.
  1058         * Leaves if it is not persent in the database
  1059         * @param The table to write to 
  1060         * @param The CApAccessPointItem to read the data from
  1061         */
  1062         void WriteServiceIp6L( CCommsDbTableView& ispt,
  1063                                CApAccessPointItem& aApItem );
  1064 
  1065 
  1066         /**
  1067         * Writes the CSD isp data to the database.
  1068         * In case of error, leaves with CommDb error codes.
  1069         * Leaves with KErrNotSupported if (HS)CSD bearer type is not supported.
  1070         * @param aIsNew A Boolean indicating whether it is a new record or it
  1071         * is an update operation.
  1072         * @param aApItem Reference to a CApAccessPointItem which holds the data
  1073         * @return No return value.
  1074         */
  1075         void WriteCsdDataL( TBool aIsNew, CApAccessPointItem& aApItem );
  1076 
  1077 
  1078         /**
  1079         * Gets the local variant value 
  1080         * @return A TInt stating the variant
  1081         */
  1082 //        TInt GetVariantL();
  1083 
  1084 
  1085         /**
  1086         * Reads up WLAN data parts of an access point.
  1087         * Leaves if it is not persent in the database
  1088         * @param The table to read from
  1089         * @param The CApAccessPointItem to store into
  1090         */
  1091         void ReadWlanL( CCommsDbTableView& lant,
  1092                         CApAccessPointItem& aApItem );
  1093 
  1094 
  1095         /**
  1096         * Writes the WLAN parts of an access point.
  1097         * Leaves if it is not persent in the database
  1098         * @param The table to write to 
  1099         * @param The CApAccessPointItem to read the data from
  1100         */
  1101         void WriteWlanL( CCommsDbTableView& aTable,
  1102                          CApAccessPointItem& aApItem );
  1103 
  1104         /**
  1105         * Creates a new record in the LANBearer table if there is none for WLAN
  1106         * @return The UID of the LANBEarer record.
  1107         */
  1108         TUint32 CreateLanBearerIfNeededL();
  1109 
  1110 
  1111 
  1112         /**
  1113         * Reads up the name of the LAN/Modem bearer record
  1114         */
  1115         void ReadModemBearerNameL( CApAccessPointItem& aApItem );
  1116         
  1117 
  1118     private:    // Data
  1119         CCommsDatabase* iDb;
  1120 //        TCommDbDatabaseType iDbType;  // deprecated and not used but kept 
  1121                                         // to maintain class size for BC
  1122         // no change in size as deprecated removed, 
  1123         // new added, with the same size...
  1124         THandlerExtra*  iExt;
  1125 
  1126 
  1127     };
  1128 
  1129 #endif      // APDATAHANDLER_H
  1130 
  1131 // End of File