epoc32/include/mw/apdatahandler.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 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".
     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 CDMA data from the database.
   537         * In case of error, leaves with CommDb error codes.
   538         * @param aIspId The UID of the record in the CDMA 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 ReadCdmaDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   544 
   545 
   546         /**
   547         * Reads the LAN data from the database.
   548         * In case of error, leaves with CommDb error codes.
   549         * @param aIspId The UID of the record in the LAN 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 ReadLanDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   555 
   556 
   557         /**
   558         * Reads the DialIn/Out ISP data from the database.
   559         * In case of error, leaves with CommDb error codes.
   560         * @param aIspId The UID of the record in the Dialup 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 ReadDialInOutDataL( TUint32 aIspId, CApAccessPointItem& aApItem );
   566 
   567         
   568         /**
   569         * Reads up the VPN bearer type info in case of a VPN access point
   570         * In case of error, leaves with CommDb error codes.
   571         * @param aIspId The UID of the record in the VPN table to
   572         * read the data from.
   573         * @param aApItem A reference to a CApAccessPointItem to hold the data
   574         * @return No return value.
   575         */
   576         void ReadVpnInfoL( TUint32 aIspId, CApAccessPointItem& aApItem);
   577 
   578 
   579         /**
   580         * Writes the WAP bearer part of the data to the database.
   581         * In case of error, leaves with CommDb error codes.
   582         * @param aIsNew A Boolean indicating whether it is a new record or it
   583         * is an update operation.
   584         * @param aWapId The UID of the WAP Access Point record to update.
   585         * Used only if aIsNew EFalse.
   586         * @param aApItem Reference to a CApAccessPointItem which holds the data
   587         * @return No return value.
   588         */
   589         void WriteWapBearerDataL
   590                         (
   591                         TBool aIsNew,
   592                         TUint32 aWapId,
   593                         CApAccessPointItem& aApItem
   594                         );
   595 
   596 
   597         /**
   598         * Writes the WAP AP part of the data to the database.
   599         * In case of error, leaves with CommDb error codes.
   600         * @param aIsNew A Boolean indicating whether it is a new record or it
   601         * is an update operation.
   602         * @param aWapId The UID of the WAP Access Point record to update.
   603         * Used only if aIsNew EFalse.
   604         * @param aApItem Reference to a CApAccessPointItem which holds the data
   605         * @return No return value.
   606         */
   607         void WriteWapApDataL
   608                         (
   609                         TBool aIsNew,
   610                         TUint32 aWapId,
   611                         CApAccessPointItem& aApItem
   612                         );
   613 
   614 
   615 
   616         /**
   617         * Writes the IAP part of the data to the database.
   618         * In case of error, leaves with CommDb error codes.
   619         * @param aIsNew A Boolean indicating whether it is a new record or it
   620         * is an update operation.
   621         * @param aIapId The UID of the IAP Access Point record to update.
   622         * Used only if aIsNew EFalse.
   623         * @param aApItem Reference to a CApAccessPointItem which holds the data
   624         * @return No return value.
   625         */
   626         void WriteIapDataL
   627                         (
   628                         TBool aIsNew,
   629                         TUint32 aIapId,
   630                         CApAccessPointItem& aApItem
   631                         );
   632 
   633         /**
   634         * Writes the ISP part of the data to the database.
   635         * In case of error, leaves with CommDb error codes.
   636         * @param aIsNew A Boolean indicating whether it is a new record or it
   637         * is an update operation.
   638         * @param aIspId The UID of the ISP Access Point record to update.
   639         * Used only if aIsNew EFalse.
   640         * @param aApItem Reference to a CApAccessPointItem which holds the data
   641         * @return No return value.
   642         */
   643         void WriteIspDataL( TBool aIsNew, TUint32 aIspId,
   644                             CApAccessPointItem& aApItem );
   645 
   646 
   647         /**
   648         * Writes the Cdma data to the database.
   649         * In case of error, leaves with CommDb error codes.
   650         * @param aIsNew A Boolean indicating whether it is a new record or it
   651         * is an update operation.
   652         * @param aApItem Reference to a CApAccessPointItem which holds the data
   653         * @return No return value.
   654         */
   655         void WriteCdmaDataL( TBool aIsNew,
   656                             CApAccessPointItem& aApItem );
   657 
   658 
   659 
   660         /**
   661         * Writes the Gprs data to the database.
   662         * In case of error, leaves with CommDb error codes.
   663         * @param aIsNew A Boolean indicating whether it is a new record or it
   664         * is an update operation.
   665         * @param aApItem Reference to a CApAccessPointItem which holds the data
   666         * @return No return value.
   667         */
   668         void WriteGprsDataL( TBool aIsNew,
   669                             CApAccessPointItem& aApItem );
   670 
   671         /**
   672         * Writes the LAN data to the database.
   673         * In case of error, leaves with CommDb error codes.
   674         * @param aIsNew A Boolean indicating whether it is a new record or it
   675         * is an update operation.
   676         * @param aApItem Reference to a CApAccessPointItem which holds the data
   677         * @return No return value.
   678         */
   679         void WriteLanDataL( TBool aIsNew,
   680                             CApAccessPointItem& aApItem );
   681 
   682 
   683         /**
   684         * Writes the data to the database.
   685         * In case of error, leaves with CommDb error codes.
   686         * @param aApItem Reference to a CApAccessPointItem which holds the data
   687         * @param aIsNew A Boolean indicating whether it is a new record or it
   688         * is an update operation.
   689         * @return No return value.
   690         */
   691         TUint32 DoUpdateAccessPointDataL( CApAccessPointItem& aApItem,
   692                                        TBool aIsNew, TBool& aNameChanged );
   693 
   694 
   695         /**
   696         * Sets the default IAP & ISP records in Global Settings.
   697         * In case of error, leaves with CommDb error codes.
   698         * @param aApItem A UID to the WAP Access Point record to
   699         * be used as a default.
   700         * @return No return value.
   701         */
   702         void SetDefaultIapIspL( TUint32 aUid );
   703 
   704         // Remove
   705         /**
   706         * Removes the WAP_BEARER table part of the access point from
   707         * the database.
   708         * Expects that CApDataHandler has been created and the database had
   709         * been opened.
   710         * In case of error, access point will not be removed.
   711         * @param aUid The UID of the access point to remove.
   712         * @return No return value.
   713         */
   714         void RemoveWapBearerApL( TUint32 aUid );
   715 
   716 
   717         /**
   718         * Removes the WAP_ACCESS_POINT table part of the access point from
   719         * the database.
   720         * Expects that CApDataHandler has been created and the database had
   721         * been opened.
   722         * In case of error, access point will not be removed.
   723         * @param aUid The UID of the access point to remove.
   724         * @return No return value.
   725         */
   726         void RemoveWapApL( TUint32 aUid );
   727 
   728 
   729         /**
   730         * Removes the IAP part of the access point from the database.
   731         * Expects that CApDataHandler has been created and the database had
   732         * been opened.
   733         * In case of error, access point will not be removed.
   734         * @param aUid The UID of the IAP part of the access point to remove.
   735         * @return No return value.
   736         */
   737         void RemoveIapL( TUint32 aUid );
   738 
   739 
   740         /**
   741         * Removes the ISP part of the access point from the database.
   742         * Expects that CApDataHandler has been created and the database had
   743         * been opened.
   744         * In case of error, access point will not be removed.
   745         * @param aUid The UID of the ISP part of the access point to remove.
   746         * @param aOut TBool indicating whether Dial out or dial in ISP.
   747         * @return No return value.
   748         */
   749         void RemoveIspL( TUint32 aUid, TBool aOut );
   750 
   751 
   752         /**
   753         * Removes the GPRS part of the access point from the database.
   754         * Expects that CApDataHandler has been created and the database had
   755         * been opened.
   756         * In case of error, access point will not be removed.
   757         * @param aUid The UID of the GPRS part of the access point to remove.
   758         * @return No return value.
   759         */
   760         void RemoveGprsL( TUint32 aUid, TBool aOut );
   761 
   762 
   763         /**
   764         * Removes the CDMA part of the access point from the database.
   765         * Expects that CApDataHandler has been created and the database had
   766         * been opened.
   767         * In case of error, access point will not be removed.
   768         * @param aUid The UID of the CDMA part of the access point to remove.
   769         * @return No return value.
   770         */
   771         void RemoveCdmaL( TUint32 aUid );
   772 
   773 
   774 
   775         /**
   776         * Removes the LAN part of the access point from the database.
   777         * Expects that CApDataHandler has been created and the database had
   778         * been opened.
   779         * In case of error, access point will not be removed.
   780         * @param aUid The UID of the LAN part of the access point to remove.
   781         * @return No return value.
   782         */
   783         void RemoveLanL( TUint32 aUid );
   784 
   785 
   786         /**
   787         * Removes the WLAN part of the access point from the database.
   788         * Expects that CApDataHandler has been created and the database had
   789         * been opened.
   790         * In case of error, access point will not be removed.
   791         * @param aUid The UID of the LAN part of the access point to remove.
   792         * @return No return value.
   793         */
   794         void RemoveWlanL( TUint32 aUid );
   795         
   796         
   797         /**
   798         * Handles the bearer change related things (deleting old links,
   799         * inserting new ones if needed in the database).
   800         * Expects that CApDataHandler has been created and the database had
   801         * been opened.
   802         * In case of error, access point data will not be changed.
   803         * @param aApItem A reference to a CApAccessPointItem holding the
   804         * CHANGED data.
   805         * @return Boolean indicating whether bearer has changed or not.
   806         */
   807         TBool HandleBearerChangeIfNeededL( CApAccessPointItem& aApItem );
   808 
   809 
   810 
   811         /**
   812         * Reads up one access point's data from the database.
   813         * Expects that CApDataHandler has been created and the database had
   814         * been opened.
   815         * In case of error, function leaves with error code.
   816         * <br>Error conditions:
   817         *   - Insufficient memory,
   818         *   - AP does not exists,
   819         *   - Server connection failure.
   820         *
   821         * @param aUid The Uid of the access point to be read
   822         * @param aApItem A reference to a CApAccessPointItem to hold the data.
   823         * @return no return value.
   824         */
   825         void DoAccessPointDataL( TUint32 aUid, CApAccessPointItem& aApItem );
   826 
   827 
   828         /**
   829         * Removes the given access point from the database.
   830         * Expects that CApDataHandler has been created and the database had
   831         * been opened.
   832         * In case of error, access point will not be removed.
   833         * <br>Error conditions:
   834         *   - Insufficient memory,
   835         *   - Server connection failure.
   836         *   - Lock already present by other task.
   837         *   - Access point does not exist.
   838         *   - Attempting to remove read-only records will result
   839         * in KErrAccessDenied
   840         *
   841         * @param aUid The UID of the access point to remove.
   842         * @return no return value.
   843         */
   844         void DoRemoveAPL( TUint32 aUid );
   845 
   846 
   847         /**
   848         * Sets the default access point.
   849         * Expects that CApDataHandler has been created and the database had
   850         * been opened.
   851         * In case of error, leaves with CommsDb or system error codes.
   852         * <br>Error conditions:
   853         *   - Insufficient memory;
   854         *   - Server connection failure;
   855         *   - Lock already present;
   856         *   - Access point does not exists.
   857         *   - Given Access Point is not of the desired type.
   858         *
   859         * @param aUid The UID of the access point to be set as default.
   860         * @param aIntendedType The default type ( IAP, WAP, Both).
   861         */
   862         void DoSetAsDefaultL(TUint32 aUid, TCommsDbIspType aIntendedType );
   863 
   864 
   865         /**
   866         * Sets the access point preference. Can be used only if the
   867         * database type is IAP.
   868         * Expects that CApDataHandler has been created and the database had
   869         * been opened.
   870         * In case of error, leaves with CommsDb or system error codes.
   871         * <br>Error conditions:
   872         *   - Insufficient memory;
   873         *   - Server connection failure;
   874         *   - Lock already present;
   875         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   876         * @param aRank The ranking of the connection preference.
   877         * @param aDircetion Specifies the direction of this connection
   878         * preference
   879         * @param aBearers The bearer set beeing valid for this connection
   880         * preference
   881         * @param aPrompt Enum value indicating whether or not the user
   882         * should be prompted or warned on connection
   883         * @param aIAP The identifier of the preferred IAP for this connection.
   884         * @param aOverwrite Boolean value indicating that if a same record
   885         * present, overwrite it or not.
   886         */
   887         void DoSetPreferredIfDbIapTypeL
   888                                     (
   889                                     TUint32 aRank,
   890                                     TCommDbConnectionDirection aDirection,
   891                                     TUint32 aBearers,
   892                                     TCommDbDialogPref aPrompt,
   893                                     TUint32 aIAP,
   894                                     TBool aOverwrite
   895                                     );
   896 
   897 
   898         /**
   899         * Sets the access point preference. Can be used only if the
   900         * database type is ISP.
   901         * Expects that CApDataHandler has been created and the database had
   902         * been opened.
   903         * In case of error, leaves with CommsDb or system error codes.
   904         * <br>Error conditions:
   905         *   - Insufficient memory;
   906         *   - Server connection failure;
   907         *   - Lock already present;
   908         * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ).
   909         * @param aRank The ranking of the connection preference.
   910         * @param aDircetion Specifies the direction of this connection
   911         * preference
   912         * @param aBearers The bearer set beeing valid for this connection
   913         * preference
   914         * @param aPrompt Enum value indicating whether or not the user
   915         * should be prompted or warned on connection
   916         * @param aISP The identifier of the preferred ISP for this connection.
   917         * @param aChargeCard Identifier of the preferred chargecard for
   918         * this connection.
   919         * @param aServiceType The type of the service.
   920         * @param aOverwrite Boolean value indicating that if a same record
   921         * present, overwrite it or not.
   922         */
   923         void DoSetPreferredIfDbIspTypeL
   924                                     (
   925                                     TUint32 aRank,
   926                                     TCommDbConnectionDirection aDirection,
   927                                     TUint32 aBearers,
   928                                     TCommDbDialogPref aPrompt,
   929                                     TUint32 aISP,
   930                                     TUint32 aChargeCard,
   931                                     const TDesC& aServiceType,
   932                                     TBool aOverwrite
   933                                     );
   934 
   935 
   936         /**
   937         * Converts setted AP speed from TApCallSpeed to commsdb values
   938         * @param The access point item whose speed needs to be converted
   939         * @return no return value
   940         */
   941         /*****************************************************
   942         *   Series 60 Customer / ETel
   943         *   Series 60  ETel API
   944         *****************************************************/
   945         void ApSpeed2EtelL( CApAccessPointItem* aItem );
   946 
   947 
   948         /**
   949         * Converts commsdb speed values to TApCallSpeed 
   950         * @param The access point item whose speed needs to be converted
   951         * @return no return value
   952         */
   953         /*****************************************************
   954         *   Series 60 Customer / ETel
   955         *   Series 60  ETel API
   956         *****************************************************/
   957         void EtelSpeed2ApL(  CApAccessPointItem& aItem );
   958 
   959 
   960         // Getting default access point
   961         /**
   962         * Reads the UID of the default access point.
   963         * Expects that CApDataHandler has been created and the database had
   964         * been opened.
   965         * In case of error, leaves with CommsDb or system error codes.
   966         * <br>Error conditions:
   967         *   - Insufficient memory;
   968         *   - Server connection failure;
   969         *   - Lock already present;
   970         *   - Access point does not exists.
   971         *
   972         * @param aIsWAP A boolean indicating whether to read the default
   973         * WAP or the default IAP/ISP (dep. on the database type) access point.
   974         * @param TBool*: if not NULL, a holder for the read-only flag of
   975         * the default access point. Prepared for future products but also used
   976         * here through passing NULL ptr.
   977         * @return The UID of the default access point.
   978         */
   979         TUint32 DoGetDefaultL( TBool aIsWap, TBool* aReadOnly ) const;
   980 
   981 
   982         /**
   983         * Writes the proxy data of an access point
   984         * @param aIsNew Boolean stating whether the access point is new
   985         * @param aApItem A CApAccessPointItem passed by reference 
   986         * holding the current access point data. It's record ID's will be 
   987         * updated if needed (in case it is a new item )
   988         */
   989         void WriteProxyDataL( TBool aIsNew, 
   990                               const CApAccessPointItem& aApItem );
   991 
   992 
   993         /**
   994         * Reads up the proxy data of an access point
   995         * @param aApItem A CApAccessPointItem passed by reference 
   996         * holding the current access point data. 
   997         */
   998         void ReadProxyDataL( CApAccessPointItem& aApItem );
   999 
  1000 
  1001         /**
  1002         * Removes a proxy data
  1003         * @param aServiceType   The service type to remove for
  1004         * @param aIspId         The service record ID
  1005         */
  1006         void RemoveProxyDataL( HBufC* aServiceType, TUint32 aIspId );
  1007 
  1008 
  1009         /**
  1010         * Writes the network data of an access point
  1011         * @param aIsNew Boolean stating whether the access point is new
  1012         * @param aApItem A CApAccessPointItem passed by reference 
  1013         * holding the current access point data. It's record ID's will be 
  1014         * updated if needed (in case it is a new item )
  1015         */
  1016         void WriteNetworkDataL( TBool aIsNew, CApAccessPointItem& aApItem );
  1017 
  1018 
  1019         /**
  1020         * Reads up the network data of an access point
  1021         * @param aApItem A CApAccessPointItem passed by reference 
  1022         * holding the current access point data. 
  1023         */
  1024         void ReadNetworkDataL( CApAccessPointItem& aApItem );
  1025 
  1026 
  1027         /**
  1028         * Removes the network data
  1029         * @param aIspId The record ID to remove
  1030         */
  1031         void RemoveNetworkDataL( TUint32 aIspId );
  1032 
  1033 
  1034         /**
  1035         * Gets the location record ID
  1036         * @return The UID of the location.
  1037         */
  1038         TUint32 GetLocationIdL();
  1039 
  1040 
  1041         /**
  1042         * Gets the modem record ID
  1043         * @return The UID of the modem record.
  1044         */
  1045         TUint32 GetModemBearerIDL( CApAccessPointItem& aApItem );
  1046 
  1047 
  1048         /**
  1049         * Returns the protocol for the passed item
  1050         * @param aApItem An access point item 
  1051         * @return The protocol of the passed item.
  1052         */
  1053         TUint32 ProtocolL( CApAccessPointItem& aApItem );
  1054 
  1055         /**
  1056         * Returns the commsdb speed for the passed item
  1057         * @param aApItem An access point item 
  1058         * @return The speed of the passed item.
  1059         */
  1060         TUint32 CommsDbSpeedL( CApAccessPointItem& aApItem );
  1061 
  1062 
  1063         /**
  1064         * Reads up common IP & PPP SERVICE data parts of an access point.
  1065         * Leaves if it is not persent in the database
  1066         * @param The table to read from
  1067         * @param The CApAccessPointItem to store into
  1068         */
  1069         void ReadServiceL( CCommsDbTableView& ispt, 
  1070                            CApAccessPointItem& aApItem );
  1071 
  1072 
  1073         /**
  1074         * Reads up CSD/GPRS IPv6 parts of an access point.
  1075         * Leaves if it is not persent in the database
  1076         * @param The table to read from
  1077         * @param The CApAccessPointItem to store into
  1078         */
  1079         void ReadServiceIp6L( CCommsDbTableView& ispt,
  1080                               CApAccessPointItem& aApItem );
  1081 
  1082 
  1083         /**
  1084         * Writes common IP & PPP SERVICE data parts of an access point.
  1085         * Leaves if it is not persent in the database
  1086         * @param The table to write into 
  1087         * @param The CApAccessPointItem holding the data to store 
  1088         */
  1089         void WriteServiceL( CCommsDbTableView& aTable,
  1090                             CApAccessPointItem& aApItem );
  1091 
  1092 
  1093         /**
  1094         * Writes the IPv6 parts of an access point.
  1095         * Leaves if it is not persent in the database
  1096         * @param The table to write to 
  1097         * @param The CApAccessPointItem to read the data from
  1098         */
  1099         void WriteServiceIp6L( CCommsDbTableView& ispt,
  1100                                CApAccessPointItem& aApItem );
  1101 
  1102 
  1103         /**
  1104         * Writes the CSD isp data to the database.
  1105         * In case of error, leaves with CommDb error codes.
  1106         * Leaves with KErrNotSupported if (HS)CSD bearer type is not supported.
  1107         * @param aIsNew A Boolean indicating whether it is a new record or it
  1108         * is an update operation.
  1109         * @param aApItem Reference to a CApAccessPointItem which holds the data
  1110         * @return No return value.
  1111         */
  1112         void WriteCsdDataL( TBool aIsNew, CApAccessPointItem& aApItem );
  1113 
  1114 
  1115         /**
  1116         * Gets the local variant value 
  1117         * @return A TInt stating the variant
  1118         */
  1119 //        TInt GetVariantL();
  1120 
  1121 
  1122         /**
  1123         * Reads up WLAN data parts of an access point.
  1124         * Leaves if it is not persent in the database
  1125         * @param The table to read from
  1126         * @param The CApAccessPointItem to store into
  1127         */
  1128         void ReadWlanL( CCommsDbTableView& lant,
  1129                         CApAccessPointItem& aApItem );
  1130 
  1131 
  1132         /**
  1133         * Writes the WLAN parts of an access point.
  1134         * Leaves if it is not persent in the database
  1135         * @param The table to write to 
  1136         * @param The CApAccessPointItem to read the data from
  1137         */
  1138         void WriteWlanL( CCommsDbTableView& aTable,
  1139                          CApAccessPointItem& aApItem );
  1140 
  1141         /**
  1142         * Creates a new record in the LANBearer table if there is none for WLAN
  1143         * @return The UID of the LANBEarer record.
  1144         */
  1145         TUint32 CreateLanBearerIfNeededL();
  1146 
  1147 
  1148 
  1149         /**
  1150         * Reads up the name of the LAN/Modem bearer record
  1151         */
  1152         void ReadModemBearerNameL( CApAccessPointItem& aApItem );
  1153         
  1154 
  1155     private:    // Data
  1156         CCommsDatabase* iDb;
  1157 //        TCommDbDatabaseType iDbType;  // deprecated and not used but kept 
  1158                                         // to maintain class size for BC
  1159         // no change in size as deprecated removed, 
  1160         // new added, with the same size...
  1161         THandlerExtra*  iExt;
  1162 
  1163 
  1164     };
  1165 
  1166 #endif      // APDATAHANDLER_H
  1167 
  1168 // End of File