williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Declaration of class CApDataHandler williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef APDATAHANDLER_H williamr@2: #define APDATAHANDLER_H williamr@2: williamr@2: // Deprecation warning williamr@2: #warning This header file has been deprecated. Will be removed in one of the next SDK releases. williamr@2: williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CApAccessPointItem; williamr@2: class CApNetworkItem; williamr@2: williamr@2: // extra data holder. williamr@2: typedef struct williamr@2: { williamr@2: TInt iIsIpv6Supported; // Is Ipv6 Supported? williamr@2: TBool iIsFeatureManagerInitialised;// Is FeatureManager Initialised? williamr@2: williamr@2: /** williamr@2: * Indicates if HSCSD Access point is supported or not. williamr@2: */ williamr@2: TBool iIsAppHscsdSupport; williamr@2: williamr@2: TInt iVariant; /// Local variant value williamr@2: williamr@2: williamr@2: }THandlerExtra; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Representation of the access point handler. williamr@2: * Encapsulates a session with the CommsDB williamr@2: * Provides a way to access the database and manipulate its data. williamr@2: */ williamr@2: class CApDataHandler :public CBase williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Two-phased constructor. Leaves on failure, places instance williamr@2: * on cleanup stack. williamr@2: * @param aDb a reference to a CCommsDataBase object. williamr@2: * @return The constructed CApDataHandler. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C static CApDataHandler* NewLC( CCommsDatabase& aDb ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C virtual ~CApDataHandler(); williamr@2: williamr@2: williamr@2: protected: // Constructors williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CApDataHandler(); williamr@2: williamr@2: /** williamr@2: * Second-phase constructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void ConstructL( CCommsDatabase& aDb ); williamr@2: williamr@2: williamr@2: private: williamr@2: williamr@2: williamr@2: public: // New functions williamr@2: // query williamr@2: /** williamr@2: * Reads up one access point's data from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, function leaves with error code. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - AP does not exists, williamr@2: * - Server connection failure. williamr@2: * williamr@2: * @param aUid The Uid of the access point to be read williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void AccessPointDataL( TUint32 aUid, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: // update williamr@2: /** williamr@2: * Updates data stored in an existing access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, no data is stored. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory williamr@2: * - Server connection failure williamr@2: * - Lock already present by other task williamr@2: * - Uid does not exists. williamr@2: * - Attempting to update read-only records will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aApItem A reference to a CApAccessPointItem holding the data williamr@2: * @param aNameChanged a reference to a TBool that will indicate williamr@2: * whether the name has changed or not. williamr@2: * @return No return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void UpdateAccessPointDataL( CApAccessPointItem& aApItem, williamr@2: TBool& aNameChanged ); williamr@2: williamr@2: williamr@2: // Creating new AP williamr@2: /** williamr@2: * Creates a copy of a previously existing access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, no access point will be created. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - Access point does not exist. williamr@2: * - Attempting to create new in protected tables will results williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aBaseId The UID of the existing access point to copy from. williamr@2: * @return The Uid of the newly constructed and saved access point. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 CreateCopyFromL( TUint32 aBaseId ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Create a new access point from supplied data williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * The name of the AP will be corrected to be unique if necessary and williamr@2: * returned in the passed aApItem. williamr@2: * In case of error, no access point will be created and the passed williamr@2: * one will remain intact. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - Attempting to create new in protected tables will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aApItem Reference to a CApAccessPointItem holding the data williamr@2: * @return The UID of the newly created and saved access point. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 CreateFromDataL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: // Remove williamr@2: /** williamr@2: * Removes the given access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - Access point does not exist. williamr@2: * - Attempting to remove read-only records will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aUid The UID of the access point to remove. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void RemoveAPL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: // Getting default access point williamr@2: /** williamr@2: * Reads the UID of the default access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * - Access point does not exists. williamr@2: * williamr@2: * @param aIsWAP A boolean indicating whether to read the default williamr@2: * WAP or the default IAP/ISP (dep. on the database type) access point. williamr@2: * @return The UID of the default access point. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 DefaultL( TBool aIsWap ) const; williamr@2: williamr@2: williamr@2: // Setting as default williamr@2: /** williamr@2: * Sets the default access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * - Access point does not exists. williamr@2: * - Given Access Point is not of the desired type. williamr@2: * williamr@2: * @param aUid The UID of the access point to be set as default. williamr@2: * @param aIntendedType The default type ( IAP, WAP, Both). williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetAsDefaultL(TUint32 aUid, williamr@2: TCommsDbIspType aIntendedType ); williamr@2: williamr@2: williamr@2: williamr@2: // Setting preferences williamr@2: /** williamr@2: * Sets the access point preference. Can be used only if the williamr@2: * database type is IAP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ). williamr@2: * @param aRank The ranking of the connection preference. williamr@2: * @param aDircetion Specifies the direction of this connection williamr@2: * preference williamr@2: * @param aBearers The bearer set being valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aIAP The identifier of the preferred IAP for this connection. williamr@2: * @param aOverwrite Boolean value indicating that if a same record williamr@2: * present, overwrite it or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetPreferredIfDbIapTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32 aBearers, williamr@2: TCommDbDialogPref aPrompt, williamr@2: TUint32 aIAP, williamr@2: TBool aOverwrite williamr@2: ); williamr@2: williamr@2: /** williamr@2: * Sets the access point preference. Can be used only if the williamr@2: * database type is ISP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ). williamr@2: * @param aRank The ranking of the connection preference. williamr@2: * @param aDircetion Specifies the direction of this connection williamr@2: * preference williamr@2: * @param aBearers The bearer set beeing valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aISP The identifier of the preferred ISP for this connection. williamr@2: * @param aChargeCard Identifier of the preferred chargecard for williamr@2: * this connection. williamr@2: * @param aServiceType The type of the service. williamr@2: * @param aOverwrite Boolean value indicating that if a same record is williamr@2: * present, overwrite it or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetPreferredIfDbIspTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32 aBearers, williamr@2: TCommDbDialogPref aPrompt, williamr@2: TUint32 aISP, williamr@2: TUint32 aChargeCard, williamr@2: const TDesC& aServiceType, williamr@2: TBool aOverwrite williamr@2: ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the access point preference. Can be used only if the williamr@2: * database type is IAP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * @param aRank The ranking of the desired connection preference. williamr@2: * @param aDircetion Specifies the direction of the desired connection williamr@2: * preference williamr@2: * @param aBearers The bearer set beeing valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aIAP The identifier of the preferred IAP for this williamr@2: * connection preference. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void GetPreferredIfDbIapTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32& aBearers, williamr@2: TUint32& aPrompt, williamr@2: TUint32& aIAP williamr@2: ); williamr@2: williamr@2: /** williamr@2: * Gets the access point preference. Can be used only if the williamr@2: * database type is ISP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * @param aRank The ranking of the desired connection preference. williamr@2: * @param aDircetion Specifies the direction of the desired connection williamr@2: * preference williamr@2: * @param aBearers The bearer set beeing valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aISP The identifier of the preferred ISP for this williamr@2: * connection preference. williamr@2: * @param aChargeCard Identifier of the preferred chargecard for williamr@2: * this connection preference. williamr@2: * @return The type of the service. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C const TDesC& GetPreferredIfDbIspTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32& aBearers, williamr@2: TUint32& aPrompt, williamr@2: TUint32& aISP, williamr@2: TUint32& aChargeCard williamr@2: ); williamr@2: williamr@2: williamr@2: // Getting default access point williamr@2: /** williamr@2: * Reads the UID of the default access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * - Access point does not exists. williamr@2: * williamr@2: * @param aIsWAP A boolean indicating whether to read the default williamr@2: * WAP or the default IAP/ISP (dep. on the database type) access point. williamr@2: * @param aReadOnly A TBool passed by reference to hold whether the williamr@2: * the default access point record is read-only or not. williamr@2: * @return The UID of the default access point. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 DefaultL( TBool aIsWap, TBool& aReadOnly )const; williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: // Remove williamr@2: /** williamr@2: * Removes the given network group from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, network group will not be removed. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - network group does not exist. williamr@2: * - Attempting to remove read-only records will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aUid The UID of the network group to remove. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void RemoveNetworkL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Creates a network group from the data. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, network group will not be created. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - network group does not exist. williamr@2: * - Attempting to remove read-only records will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aNetwork The network item to create/write into db. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void CreateNetworkL( CApNetworkItem& aNetwork ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up a network part of the access point williamr@2: * Network is identified by the iNetworkId of the passed access point williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void ReadNetworkPartL( CApAccessPointItem& aItem ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up a network williamr@2: * Network is identified by passed uid williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void ReadNetworkL( TUint32 aUid, CApNetworkItem& aNetwork ); williamr@2: williamr@2: williamr@2: protected: // New functions williamr@2: /** williamr@2: * Reads the WAP part of the data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aWapId The UID of the Access Point to read the data from. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadWapDataL( TUint32 aWapId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the IAP part of the data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIapId The UID of the record in the IAP table to read williamr@2: * the data. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadIapDataL( TUint32 aIapId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the ISP part of the data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIspId The UID of the record in the ISP table to williamr@2: * read the data. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadIspDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the GPRS data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIspId The UID of the record in the GPRS table to williamr@2: * read the data from. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadGprsDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the LAN data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIspId The UID of the record in the LAN table to williamr@2: * read the data from. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadLanDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the DialIn/Out ISP data from the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIspId The UID of the record in the Dialup table to williamr@2: * read the data from. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadDialInOutDataL( TUint32 aIspId, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up the VPN bearer type info in case of a VPN access point williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIspId The UID of the record in the VPN table to williamr@2: * read the data from. williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void ReadVpnInfoL( TUint32 aIspId, CApAccessPointItem& aApItem); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the WAP bearer part of the data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aWapId The UID of the WAP Access Point record to update. williamr@2: * Used only if aIsNew EFalse. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteWapBearerDataL williamr@2: ( williamr@2: TBool aIsNew, williamr@2: TUint32 aWapId, williamr@2: CApAccessPointItem& aApItem williamr@2: ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the WAP AP part of the data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aWapId The UID of the WAP Access Point record to update. williamr@2: * Used only if aIsNew EFalse. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteWapApDataL williamr@2: ( williamr@2: TBool aIsNew, williamr@2: TUint32 aWapId, williamr@2: CApAccessPointItem& aApItem williamr@2: ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the IAP part of the data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aIapId The UID of the IAP Access Point record to update. williamr@2: * Used only if aIsNew EFalse. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteIapDataL williamr@2: ( williamr@2: TBool aIsNew, williamr@2: TUint32 aIapId, williamr@2: CApAccessPointItem& aApItem williamr@2: ); williamr@2: williamr@2: /** williamr@2: * Writes the ISP part of the data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aIspId The UID of the ISP Access Point record to update. williamr@2: * Used only if aIsNew EFalse. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteIspDataL( TBool aIsNew, TUint32 aIspId, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: /** williamr@2: * Writes the Gprs data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteGprsDataL( TBool aIsNew, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: /** williamr@2: * Writes the LAN data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteLanDataL( TBool aIsNew, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @return No return value. williamr@2: */ williamr@2: TUint32 DoUpdateAccessPointDataL( CApAccessPointItem& aApItem, williamr@2: TBool aIsNew, TBool& aNameChanged ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the default IAP & ISP records in Global Settings. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * @param aApItem A UID to the WAP Access Point record to williamr@2: * be used as a default. williamr@2: * @return No return value. williamr@2: */ williamr@2: void SetDefaultIapIspL( TUint32 aUid ); williamr@2: williamr@2: // Remove williamr@2: /** williamr@2: * Removes the WAP_BEARER table part of the access point from williamr@2: * the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveWapBearerApL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the WAP_ACCESS_POINT table part of the access point from williamr@2: * the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveWapApL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the IAP part of the access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the IAP part of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveIapL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the ISP part of the access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the ISP part of the access point to remove. williamr@2: * @param aOut TBool indicating whether Dial out or dial in ISP. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveIspL( TUint32 aUid, TBool aOut ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the GPRS part of the access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the GPRS part of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveGprsL( TUint32 aUid, TBool aOut ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the LAN part of the access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the LAN part of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveLanL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the WLAN part of the access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: * @param aUid The UID of the LAN part of the access point to remove. williamr@2: * @return No return value. williamr@2: */ williamr@2: void RemoveWlanL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Handles the bearer change related things (deleting old links, williamr@2: * inserting new ones if needed in the database). williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point data will not be changed. williamr@2: * @param aApItem A reference to a CApAccessPointItem holding the williamr@2: * CHANGED data. williamr@2: * @return Boolean indicating whether bearer has changed or not. williamr@2: */ williamr@2: TBool HandleBearerChangeIfNeededL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up one access point's data from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, function leaves with error code. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - AP does not exists, williamr@2: * - Server connection failure. williamr@2: * williamr@2: * @param aUid The Uid of the access point to be read williamr@2: * @param aApItem A reference to a CApAccessPointItem to hold the data. williamr@2: * @return no return value. williamr@2: */ williamr@2: void DoAccessPointDataL( TUint32 aUid, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the given access point from the database. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, access point will not be removed. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory, williamr@2: * - Server connection failure. williamr@2: * - Lock already present by other task. williamr@2: * - Access point does not exist. williamr@2: * - Attempting to remove read-only records will result williamr@2: * in KErrAccessDenied williamr@2: * williamr@2: * @param aUid The UID of the access point to remove. williamr@2: * @return no return value. williamr@2: */ williamr@2: void DoRemoveAPL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the default access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * - Access point does not exists. williamr@2: * - Given Access Point is not of the desired type. williamr@2: * williamr@2: * @param aUid The UID of the access point to be set as default. williamr@2: * @param aIntendedType The default type ( IAP, WAP, Both). williamr@2: */ williamr@2: void DoSetAsDefaultL(TUint32 aUid, TCommsDbIspType aIntendedType ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the access point preference. Can be used only if the williamr@2: * database type is IAP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ). williamr@2: * @param aRank The ranking of the connection preference. williamr@2: * @param aDircetion Specifies the direction of this connection williamr@2: * preference williamr@2: * @param aBearers The bearer set beeing valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aIAP The identifier of the preferred IAP for this connection. williamr@2: * @param aOverwrite Boolean value indicating that if a same record williamr@2: * present, overwrite it or not. williamr@2: */ williamr@2: void DoSetPreferredIfDbIapTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32 aBearers, williamr@2: TCommDbDialogPref aPrompt, williamr@2: TUint32 aIAP, williamr@2: TBool aOverwrite williamr@2: ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the access point preference. Can be used only if the williamr@2: * database type is ISP. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * Can also leave with KErrAlreadyExists (if aOverWrite is EFalse ). williamr@2: * @param aRank The ranking of the connection preference. williamr@2: * @param aDircetion Specifies the direction of this connection williamr@2: * preference williamr@2: * @param aBearers The bearer set beeing valid for this connection williamr@2: * preference williamr@2: * @param aPrompt Enum value indicating whether or not the user williamr@2: * should be prompted or warned on connection williamr@2: * @param aISP The identifier of the preferred ISP for this connection. williamr@2: * @param aChargeCard Identifier of the preferred chargecard for williamr@2: * this connection. williamr@2: * @param aServiceType The type of the service. williamr@2: * @param aOverwrite Boolean value indicating that if a same record williamr@2: * present, overwrite it or not. williamr@2: */ williamr@2: void DoSetPreferredIfDbIspTypeL williamr@2: ( williamr@2: TUint32 aRank, williamr@2: TCommDbConnectionDirection aDirection, williamr@2: TUint32 aBearers, williamr@2: TCommDbDialogPref aPrompt, williamr@2: TUint32 aISP, williamr@2: TUint32 aChargeCard, williamr@2: const TDesC& aServiceType, williamr@2: TBool aOverwrite williamr@2: ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Converts setted AP speed from TApCallSpeed to commsdb values williamr@2: * @param The access point item whose speed needs to be converted williamr@2: * @return no return value williamr@2: */ williamr@2: /***************************************************** williamr@2: * Series 60 Customer / ETel williamr@2: * Series 60 ETel API williamr@2: *****************************************************/ williamr@2: void ApSpeed2EtelL( CApAccessPointItem* aItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Converts commsdb speed values to TApCallSpeed williamr@2: * @param The access point item whose speed needs to be converted williamr@2: * @return no return value williamr@2: */ williamr@2: /***************************************************** williamr@2: * Series 60 Customer / ETel williamr@2: * Series 60 ETel API williamr@2: *****************************************************/ williamr@2: void EtelSpeed2ApL( CApAccessPointItem& aItem ); williamr@2: williamr@2: williamr@2: // Getting default access point williamr@2: /** williamr@2: * Reads the UID of the default access point. williamr@2: * Expects that CApDataHandler has been created and the database had williamr@2: * been opened. williamr@2: * In case of error, leaves with CommsDb or system error codes. williamr@2: *
Error conditions: williamr@2: * - Insufficient memory; williamr@2: * - Server connection failure; williamr@2: * - Lock already present; williamr@2: * - Access point does not exists. williamr@2: * williamr@2: * @param aIsWAP A boolean indicating whether to read the default williamr@2: * WAP or the default IAP/ISP (dep. on the database type) access point. williamr@2: * @param TBool*: if not NULL, a holder for the read-only flag of williamr@2: * the default access point. Prepared for future products but also used williamr@2: * here through passing NULL ptr. williamr@2: * @return The UID of the default access point. williamr@2: */ williamr@2: TUint32 DoGetDefaultL( TBool aIsWap, TBool* aReadOnly ) const; williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the proxy data of an access point williamr@2: * @param aIsNew Boolean stating whether the access point is new williamr@2: * @param aApItem A CApAccessPointItem passed by reference williamr@2: * holding the current access point data. It's record ID's will be williamr@2: * updated if needed (in case it is a new item ) williamr@2: */ williamr@2: void WriteProxyDataL( TBool aIsNew, williamr@2: const CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up the proxy data of an access point williamr@2: * @param aApItem A CApAccessPointItem passed by reference williamr@2: * holding the current access point data. williamr@2: */ williamr@2: void ReadProxyDataL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes a proxy data williamr@2: * @param aServiceType The service type to remove for williamr@2: * @param aIspId The service record ID williamr@2: */ williamr@2: void RemoveProxyDataL( HBufC* aServiceType, TUint32 aIspId ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the network data of an access point williamr@2: * @param aIsNew Boolean stating whether the access point is new williamr@2: * @param aApItem A CApAccessPointItem passed by reference williamr@2: * holding the current access point data. It's record ID's will be williamr@2: * updated if needed (in case it is a new item ) williamr@2: */ williamr@2: void WriteNetworkDataL( TBool aIsNew, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up the network data of an access point williamr@2: * @param aApItem A CApAccessPointItem passed by reference williamr@2: * holding the current access point data. williamr@2: */ williamr@2: void ReadNetworkDataL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Removes the network data williamr@2: * @param aIspId The record ID to remove williamr@2: */ williamr@2: void RemoveNetworkDataL( TUint32 aIspId ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the location record ID williamr@2: * @return The UID of the location. williamr@2: */ williamr@2: TUint32 GetLocationIdL(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the modem record ID williamr@2: * @return The UID of the modem record. williamr@2: */ williamr@2: TUint32 GetModemBearerIDL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Returns the protocol for the passed item williamr@2: * @param aApItem An access point item williamr@2: * @return The protocol of the passed item. williamr@2: */ williamr@2: TUint32 ProtocolL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: /** williamr@2: * Returns the commsdb speed for the passed item williamr@2: * @param aApItem An access point item williamr@2: * @return The speed of the passed item. williamr@2: */ williamr@2: TUint32 CommsDbSpeedL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up common IP & PPP SERVICE data parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to read from williamr@2: * @param The CApAccessPointItem to store into williamr@2: */ williamr@2: void ReadServiceL( CCommsDbTableView& ispt, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up CSD/GPRS IPv6 parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to read from williamr@2: * @param The CApAccessPointItem to store into williamr@2: */ williamr@2: void ReadServiceIp6L( CCommsDbTableView& ispt, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes common IP & PPP SERVICE data parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to write into williamr@2: * @param The CApAccessPointItem holding the data to store williamr@2: */ williamr@2: void WriteServiceL( CCommsDbTableView& aTable, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the IPv6 parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to write to williamr@2: * @param The CApAccessPointItem to read the data from williamr@2: */ williamr@2: void WriteServiceIp6L( CCommsDbTableView& ispt, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the CSD isp data to the database. williamr@2: * In case of error, leaves with CommDb error codes. williamr@2: * Leaves with KErrNotSupported if (HS)CSD bearer type is not supported. williamr@2: * @param aIsNew A Boolean indicating whether it is a new record or it williamr@2: * is an update operation. williamr@2: * @param aApItem Reference to a CApAccessPointItem which holds the data williamr@2: * @return No return value. williamr@2: */ williamr@2: void WriteCsdDataL( TBool aIsNew, CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the local variant value williamr@2: * @return A TInt stating the variant williamr@2: */ williamr@2: // TInt GetVariantL(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up WLAN data parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to read from williamr@2: * @param The CApAccessPointItem to store into williamr@2: */ williamr@2: void ReadWlanL( CCommsDbTableView& lant, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Writes the WLAN parts of an access point. williamr@2: * Leaves if it is not persent in the database williamr@2: * @param The table to write to williamr@2: * @param The CApAccessPointItem to read the data from williamr@2: */ williamr@2: void WriteWlanL( CCommsDbTableView& aTable, williamr@2: CApAccessPointItem& aApItem ); williamr@2: williamr@2: /** williamr@2: * Creates a new record in the LANBearer table if there is none for WLAN williamr@2: * @return The UID of the LANBEarer record. williamr@2: */ williamr@2: TUint32 CreateLanBearerIfNeededL(); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads up the name of the LAN/Modem bearer record williamr@2: */ williamr@2: void ReadModemBearerNameL( CApAccessPointItem& aApItem ); williamr@2: williamr@2: williamr@2: private: // Data williamr@2: CCommsDatabase* iDb; williamr@2: // TCommDbDatabaseType iDbType; // deprecated and not used but kept williamr@2: // to maintain class size for BC williamr@2: // no change in size as deprecated removed, williamr@2: // new added, with the same size... williamr@2: THandlerExtra* iExt; williamr@2: williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // APDATAHANDLER_H williamr@2: williamr@2: // End of File