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 the class CApUtils williamr@2: * Contains utility functions for access point handling williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef APUTILS_H williamr@2: #define APUTILS_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: williamr@2: williamr@2: williamr@2: // extra data holder. williamr@2: typedef struct williamr@2: { williamr@2: TInt iVariant; /// Local variant value williamr@2: TBool iWlanSupported; /// WLAN feature supported or not williamr@2: TBool iIsFeatureManagerInitialised; williamr@2: }TUtilsExtra; williamr@2: williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Representation of access point utilities. williamr@2: * Provides utilities to access points for clients. williamr@2: * Encapsulates database handling. williamr@2: * This class provides utility functions for clients that need some williamr@2: * specific information or parameters from (maybe more than one) AP. williamr@2: * It is provided for ease of use so clients do not have to work with williamr@2: * CApDataHandler's concept (one object-one Uid). williamr@2: */ williamr@2: class CApUtils :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 CApUtils. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C static CApUtils* NewLC( CCommsDatabase& aDb ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C virtual ~CApUtils(); williamr@2: williamr@2: williamr@2: protected: // Constructors williamr@2: /** williamr@2: * C++ default constructor. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C CApUtils(); 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: williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Indicates whether a given access point is in use or not. williamr@2: * If access point does not exists, return value is TRUE williamr@2: * @param aUid The UID of the access point. williamr@2: * @return Boolean indicating if it is in use (if used, TRUE) williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool IsAPInUseL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Indicates the WAP bearer type of a given access point. williamr@2: * Passed descriptor MUST be large enough to hold the new data, williamr@2: * otherwise leaves with KErrDescOverflow. williamr@2: * The maximum length is the maximum length of a 'normal' text fields williamr@2: * length in Comms DB, KCommsDbSvrMaxFieldLength, williamr@2: * which is defined in cdblen.h. williamr@2: * @param aUid The UID of the access point. williamr@2: * @param aBearer A reference to a TBearer to hold the bearer williamr@2: * type of the access point. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void WapBearerTypeL( TUint32 aUid, TDes& aBearer ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the bearer type of a given access point. Leaves on error. williamr@2: * @param aUid The UID of the access point. williamr@2: * @return The type of the bearer. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TApBearerType BearerTypeL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Indicates the ISP type of a given access point. williamr@2: * @param aUid The UID of the access point. williamr@2: * @param aIspType A reference to a TCommsDbIspType to hold the value williamr@2: * @return No return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void ISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType ); williamr@2: williamr@2: /** williamr@2: * Indicates whether a given name is valid or not. williamr@2: * @param aNameText The name to check. williamr@2: * @return Boolean indicating if it is valid or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool IsValidNameL( const TDesC& aNameText ); williamr@2: williamr@2: williamr@2: /** williamr@2: * TBool CApUtils::MakeValidNameL(TDes& aNameText); williamr@2: * Creates a valid name based on the given one. williamr@2: * @param aNameText The name to use for creating a valid name. williamr@2: * The new name is returned in it, too. williamr@2: * @return Whether the name was changed or not williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool MakeValidNameL( TDes& aNameText ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the Name of a given access point williamr@2: * @param aUid The UID of the access point. williamr@2: * @param A reference to hold the name of the access point. williamr@2: * @return no return value. williamr@2: * Passed descriptor MUST be large enough to hold the new data, williamr@2: * otherwise leaves with KErrDescOverflow. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void NameL( TUint32 aUid, TDes& aName ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the Name of a given access point williamr@2: * Name is validated and modified if needed. williamr@2: * Passed aName buffer MUST be large enough to hold the modified name. williamr@2: * @param aName A reference to the name of the access point. williamr@2: * The given name is returned in it. williamr@2: * @param aUid The UID of the access point. williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetNameL( TDes& aName, TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the ISP type for a given access point williamr@2: * @param aUid The UID of the access point williamr@2: * @param aIspType The desired Isp type of the access point williamr@2: * @return no return value. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C void SetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the Iap record ID for a given access point ID williamr@2: * @param aUid The UID of the access point williamr@2: * @return The Iap record ID. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 IapIdFromWapIdL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the Wap record ID for a given Iap record ID williamr@2: * @param aUid The UID of the Iap williamr@2: * @return The Wap access point ID. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TUint32 WapIdFromIapIdL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Returns whether the access point has the WAP-mandatory williamr@2: * fields filled or not. williamr@2: * Starts a transaction which is 'internal' to ApEngine if williamr@2: * client not started one. williamr@2: * @param aUid The UID of the access point williamr@2: * @return TBool Are the WAP-mandatory fields filled in the access point? williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool HasMandatoryFieldsFilledL( TUint32 aUid ); williamr@2: williamr@2: /** williamr@2: * Returns in a TBool whether the internet access point part williamr@2: * identified by the passed aUid exists or not. williamr@2: * param aUid the internet access point ID to check for williamr@2: * (NOT equals to Wap access point ID). williamr@2: * return TBool indicating whether an internet access point williamr@2: * with the given ID exists or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool IAPExistsL( TUint32 aUid ); williamr@2: williamr@2: /** williamr@2: * Returns in a TBool whether the access point identified williamr@2: * by the passed aUid exists or not. williamr@2: * @param aUid the access point ID to check for.(Wap access point ID). williamr@2: * @return TBool indicating whether an access point with the williamr@2: * given ID exists or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool WapApExistsL( TUint32 aUid ); williamr@2: williamr@2: /** williamr@2: * Returns whether the access point has the WAP-mandatory williamr@2: * fields filled or not. williamr@2: * @param aUid The UID of the access point williamr@2: * @return TBool Are the WAP-mandatory fields filled in the access point? williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool DoHasMandatoryFieldsFilledL( williamr@2: TUint32 aUid, williamr@2: CCommsDbTableView* aWapt = NULL, williamr@2: TApBearerType aBearertype = EApBearerTypeAllBearers ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Indicates whether a given name is valid or not. williamr@2: * The name is valid if none, or only the aAcceptUid AP has it. williamr@2: * @param aNameText The name to check. williamr@2: * @param aAcceptUid A UID to accept with this name williamr@2: * @return Boolean indicating if it is valid or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool IsValidNameL( const TDesC& aNameText, williamr@2: TUint32 aAcceptUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Determines whether a given AP is read-only or not. williamr@2: * @param aUid A UID to look for williamr@2: * @return Boolean indicating if it is read-only or not. williamr@2: * williamr@2: * @deprecated williamr@2: */ williamr@2: IMPORT_C TBool IsReadOnlyL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Determines whether a given LAN_SERVICE commsdb id williamr@2: * is linked to a WLAN data (thus is it a WLAN) or not. williamr@2: * @param aUid A UID to look for williamr@2: * @return Boolean indicating if it is WLAN or not. williamr@2: */ williamr@2: TBool IsWlanL( TUint32 aLanCommdbId ); williamr@2: williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: * Determines whether a given LAN_SERVICE commsdb id williamr@2: * which is linked to a WLAN data (thus is it a WLAN) williamr@2: * has a valid SSID or it is empty williamr@2: * @param aUid A UID to look for williamr@2: * @return Boolean indicating if it has WLAN SSID or not. williamr@2: */ williamr@2: TBool HasWlanSSIDL( TUint32 aLanCommdbId ); williamr@2: williamr@2: protected: williamr@2: williamr@2: williamr@2: /** williamr@2: * Indicates the WAP bearer type of a given access point. williamr@2: * Passed descriptor MUST be large enough to hold the new data, williamr@2: * otherwise leaves with KErrDescOverflow. williamr@2: * The maximum length is the maximum length of a 'normal' text fields williamr@2: * length in Comms DB, KCommsDbSvrMaxFieldLength, williamr@2: * which is defined in cdblen.h. williamr@2: * @param aUid The UID of the access point. williamr@2: * @param aBearer A reference to a TBearer to hold the bearer williamr@2: * type of the access point. williamr@2: * @return no return value. williamr@2: */ williamr@2: void DoWapBearerTypeL( TUint32 aUid, TDes& aBearer ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Gets the bearer type of a given access point. Leaves on error. williamr@2: * @param aUid The UID of the access point. williamr@2: * @return The type of the bearer. williamr@2: */ williamr@2: TApBearerType DoBearerTypeL( TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Indicates the ISP type of a given access point. williamr@2: * @param aUid The UID of the access point. williamr@2: * @param aIspType A reference to a TCommsDbIspType to hold the value williamr@2: * @return No return value. williamr@2: */ williamr@2: void DoISPTypeL( TUint32 aUid, TCommsDbIspType& aIspType ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Reads the Name of a given access point williamr@2: * @param aUid The UID of the access point. williamr@2: * @param A reference to hold the name of the access point. williamr@2: * @return no return value. williamr@2: * Passed descriptor MUST be large enough to hold the new data, williamr@2: * otherwise leaves with KErrDescOverflow. williamr@2: */ williamr@2: void DoNameL( TUint32 aUid, TDes& aName ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the Name of a given access point williamr@2: * Name is validated and modified if needed. williamr@2: * Passed aName buffer MUST be large enough to hold the modified name. williamr@2: * @param aName A reference to the name of the access point. williamr@2: * The given name is returned in it. williamr@2: * @param aUid The UID of the access point. williamr@2: * @return no return value. williamr@2: */ williamr@2: void DoSetNameL( TDes& aName, TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Sets the ISP type for a given access point williamr@2: * @param aUid The UID of the access point williamr@2: * @param aIspType The desired Isp type of the access point williamr@2: * @return no return value. williamr@2: */ williamr@2: void DoSetISPTypeL( TUint32 aUid, TCommsDbIspType aIspType ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Returns in a TBool whether the record williamr@2: * identified by the passed aUid exists or not williamr@2: * in the table identified by the passed table name. williamr@2: * @param aTable The name of the table to check williamr@2: * @param aUid The UID to check for williamr@2: * @return TBool indicating whether the record williamr@2: * with the given ID exists in the given table or not. williamr@2: */ williamr@2: TBool DoesExistsL( TPtrC aTable, TUint32 aUid ); williamr@2: williamr@2: williamr@2: /** williamr@2: * Wrapper for public API. williamr@2: * Determines whether a given LAN_SERVICE commsdb id williamr@2: * is linked to a WLAN data (thus is it a WLAN) or not. williamr@2: * @param aUid A UID to look for williamr@2: * @return Boolean indicating if it is WLAN or not. williamr@2: */ williamr@2: TBool DoIsWlanL( TUint32 aLanCommdbId ); 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: // Added a new iExt for expansion instead of TCommDbDatabaseType williamr@2: // same size, no BC problem... williamr@2: TUtilsExtra* iExt; williamr@2: williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // APUTILS_H williamr@2: williamr@2: // End of File