williamr@2: /* williamr@2: * Copyright (c) 2006 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: Connection manager IF class. williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef CMMANAGER_H williamr@2: #define CMMANAGER_H williamr@2: williamr@2: // System Includes williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@4: #include williamr@2: williamr@2: // Forward Declarations williamr@2: class RCmConnectionMethod; williamr@2: class RCmDestination; williamr@2: class CCmManagerImpl; williamr@2: class TBearerPriority; williamr@2: class CGulIcon; williamr@2: williamr@2: /** williamr@2: * RCmManager gives access to network destinations and connection methods. williamr@2: * williamr@2: * @lib cmmanager.lib williamr@2: * @since S60 v3.2 williamr@2: */ williamr@2: NONSHARABLE_CLASS(RCmManager) williamr@2: { williamr@2: //===================================================================== williamr@2: // Constructors/Destructors williamr@2: // williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Default constructor. williamr@2: */ williamr@2: inline RCmManager(); williamr@2: williamr@2: //===================================================================== williamr@2: // API functions williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Symbian constructor williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void OpenL(); williamr@2: williamr@2: /** williamr@2: * Symbian constructor williamr@2: * Pushes the object on the cleanup stack williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void OpenLC(); williamr@2: williamr@2: /** williamr@2: * Secondary destructor williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void Close(); williamr@2: williamr@2: //======================================================================= williamr@2: // Getter API williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Used to query bearer information that doesn't belong williamr@2: * to a specific connection method, such as williamr@2: * ECmCoverage or ECmDefaultPriority etc. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aBearerType the bearer williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C TUint32 GetBearerInfoIntL( TUint32 aBearerType, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: williamr@2: /** williamr@2: * Used to query bearer information that doesn't belong williamr@2: * to a specific connection method, such as williamr@2: * ECmCoverage or ECmDefaultPriority etc. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aBearerType the bearer williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C TBool GetBearerInfoBoolL( TUint32 aBearerType, williamr@2: TUint32 aAttribute ) const; williamr@2: /** williamr@2: * Used to query bearer information that doesn't belong williamr@2: * to a specific connection method, such as williamr@2: * ECmCoverage or ECmDefaultPriority etc. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aBearerType the bearer williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C HBufC* GetBearerInfoStringL( TUint32 aBearerType, williamr@2: TUint32 aAttribute ) const; williamr@2: /** williamr@2: * Used to query bearer information that does not belong williamr@2: * to a specific connection method, such as williamr@2: * ECmCoverage or ECmDefaultPriority, etc. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aBearerType the bearer williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C HBufC8* GetBearerInfoString8L( TUint32 aBearerType, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Used to query any non-bearer specific information about williamr@2: * a given connection method. This can be e.g. ECmBearerType, williamr@2: * ECmName, ECmStartPage, etc. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aIapId the connection method id williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C TUint32 GetConnectionMethodInfoIntL( TUint32 aIapId, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Used to query any, non-bearer specific information about williamr@2: * a given connection method. This can be e.g. ECmBearerType, williamr@2: * ECmName, ECmStartPage, etc. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aIapId the connection method id williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C TBool GetConnectionMethodInfoBoolL( TUint32 aIapId, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Used to query any non-bearer specific information about williamr@2: * a given connection method. This can be e.g. ECmBearerType, williamr@2: * ECmName, ECmStartPage, etc. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aIapId the connection method id williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C HBufC* GetConnectionMethodInfoStringL( TUint32 aIapId, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Used to query any non-bearer specific information about williamr@2: * a given connection method. This can be e.g. ECmBearerType, williamr@2: * ECmName, ECmStartPage, etc. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aIapId the connection method id williamr@2: * @param aAttribute the setting value williamr@2: * @return the setting value williamr@2: */ williamr@2: IMPORT_C HBufC8* GetConnectionMethodInfoString8L( TUint32 aIapId, williamr@2: TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Returns the connection method queried by its ID williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aConnectionMethodId id of the connection method williamr@2: * @return RCmConnectionMethod connection method williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod ConnectionMethodL( williamr@2: TUint32 aConnectionMethodId ) const; williamr@2: williamr@2: /** williamr@2: * Returns the list of connection methods. Connection Methods are williamr@2: * filtered by the switch parameters e.g. aLegacyOnly. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aCMArray on return it is the array of IAP ids. williamr@2: * @param aCheckBearerType If ETrue only connection methods with williamr@2: * supported bearer type are returned williamr@2: * @param aLegacyOnly when set to ETrue only Legacy IAP ids will williamr@2: * be returned williamr@2: * @param aEasyWlan when set to ETrue EasyWlan id is returned, too williamr@2: */ williamr@2: IMPORT_C void ConnectionMethodL( RArray& aCMArray, williamr@2: TBool aCheckBearerType = ETrue, williamr@2: TBool aLegacyOnly = ETrue, williamr@2: TBool aEasyWlan = EFalse ) const; williamr@2: williamr@2: /** williamr@2: * Returns an array of all destination id's williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aDestArray list all available destinations' id williamr@2: */ williamr@2: IMPORT_C void AllDestinationsL( RArray& aDestArray ) const; williamr@2: williamr@2: /** williamr@2: * Returns the destination to which a specified williamr@2: * connection method belongs, search is by destination ID williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aDestinationId id of destination williamr@2: * @return RCmDestination network destination williamr@2: */ williamr@2: IMPORT_C RCmDestination DestinationL( TUint32 aDestinationId ) const; williamr@2: williamr@2: /** williamr@2: * Returns the copy of the bearer priority array. Ownership is passed. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aArray bearer priority array williamr@2: */ williamr@2: IMPORT_C void BearerPriorityArrayL( williamr@2: RArray& aArray ) const; williamr@2: williamr@2: /** williamr@2: * Clean up passed global bearer priority array. Delete williamr@2: * the elements and calls Reset and Close on the array. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aArray array to be cleaned up williamr@2: */ williamr@2: IMPORT_C void CleanupGlobalPriorityArray( williamr@2: RArray& aArray ) const; williamr@2: williamr@2: /** williamr@2: * Returns the id of the EasyWlan connection method. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @return id of the EasyWLan connection method. 0 if not found. williamr@2: */ williamr@2: IMPORT_C TUint32 EasyWlanIdL() const; williamr@2: williamr@2: /** williamr@2: * Returns the default connection method/SNAP. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void ReadDefConnL( TCmDefConnValue& aDCSetting ); williamr@2: williamr@2: /** williamr@2: * Stores the default connection method/SNAP. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void WriteDefConnL( const TCmDefConnValue& aDCSetting ); williamr@2: williamr@2: williamr@4: /** williamr@4: * Returns the general connection settings. williamr@4: * williamr@4: * @since S60 9.2 williamr@4: */ williamr@4: IMPORT_C void ReadGenConnSettingsL( TCmGenConnSettings& aGenConnSettings ); williamr@4: williamr@4: /** williamr@4: * Writes the general connection settings. williamr@4: * williamr@4: * @since S60 9.2 williamr@4: */ williamr@4: IMPORT_C void WriteGenConnSettingsL( const TCmGenConnSettings& aGenConnSettings ); williamr@4: williamr@4: williamr@2: /** Open session and create tables if they don't exist*/ williamr@2: IMPORT_C void CreateTablesAndOpenL(); williamr@2: williamr@2: /** williamr@2: * Creates a Destination with the passed name. williamr@2: * @param aName the name of the new destination. williamr@2: * @return RCmDestination new destination. ownership is passed to the williamr@2: * caller williamr@2: */ williamr@2: IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName ); williamr@2: williamr@2: /** williamr@2: * Creates a connection method does not belong to any destination williamr@2: * @param aImplementationUid - bearer type of the new connection method williamr@2: * @return RCmConnectionMethod newly created connection method. williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aBearerType ); williamr@2: williamr@2: /** williamr@2: * Copies a connection method belonging to one destination to williamr@2: * another. The connection method becomes shared. williamr@2: * Calls UpdateL on the destination williamr@2: * @param aTargetDestination williamr@2: * @param aConnectionMethodId williamr@2: * @return TInt - index in the Connection Method list williamr@2: */ williamr@2: IMPORT_C TInt CopyConnectionMethodL( RCmDestination& aTargetDestination, williamr@2: RCmConnectionMethod& aConnectionMethod ); williamr@2: williamr@2: /** williamr@2: * Moves a connection method belonging to one destination to williamr@2: * another. The connection method is removed from the source destination williamr@2: * @param aSourceDestination williamr@2: * @param aTargetDestination williamr@2: * @param aConnectionMethod williamr@2: * @return TInt - index in the Connection Method list williamr@2: */ williamr@2: IMPORT_C TInt MoveConnectionMethodL( RCmDestination& aSourceDestination, williamr@2: RCmDestination& aTargetDestination, williamr@2: RCmConnectionMethod& aConnectionMethod ); williamr@2: williamr@2: /** williamr@2: * Remove connection method from the destination williamr@2: * @param aDestination destination the connection method is attached to williamr@2: * @param aConnectionMethod connection method to be removed williamr@2: */ williamr@2: IMPORT_C void RemoveConnectionMethodL( RCmDestination& aDestination, williamr@2: RCmConnectionMethod& aConnectionMethod ); williamr@2: williamr@2: /** williamr@2: * Removes connection method from every destination and make it williamr@2: * uncategorized. williamr@2: * @param aConnectionMethod connection method to be removed williamr@2: */ williamr@2: IMPORT_C void RemoveAllReferencesL( RCmConnectionMethod& aConnectionMethod ); williamr@2: williamr@2: /** williamr@2: * Update bearer priority array williamr@2: * @param aArray array with new global bearer priority williamr@2: */ williamr@2: IMPORT_C void UpdateBearerPriorityArrayL( const RArray& aArray ); williamr@2: williamr@2: /** williamr@2: * Creates a Destination with the passed name and id. williamr@2: * @param aName the name of the new destination. williamr@2: * @param aDestId Predefined id of the destination. williamr@2: * @return RCmDestination newly created destination or leaves with williamr@2: * KErrAlreadyExists if there exists CM with the same Id. williamr@2: * Ownership is passed to the caller. williamr@2: */ williamr@2: IMPORT_C RCmDestination CreateDestinationL( const TDesC& aName, williamr@2: TUint32 aDestId ); williamr@2: williamr@2: /** williamr@2: * Creates a connection method does not belong to any destination williamr@2: * @param aImplementationUid - bearer type of the new connection williamr@2: * method williamr@2: * @param aConnMethodId Predefined id for the connection method. williamr@2: * @return RCmConnectionMethod newly created connection williamr@2: * method or leaves with KErrAlreadyExists if there exists CM williamr@2: * with the same Id. williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod CreateConnectionMethodL( TUint32 aImplementationUid, williamr@2: TUint32 aConnMethodId ); williamr@2: williamr@2: /** williamr@2: * Query all of the supported bearer types. williamr@2: * @param aArray list of all supported bearer types. williamr@2: */ williamr@2: IMPORT_C void SupportedBearersL( RArray& aArray ) const; williamr@2: williamr@2: /** williamr@2: * Returns "Uncategorized" icon. williamr@2: * This fucton leaves if the client does not have a valid UI context williamr@2: * @return CGulIcon* Icon of uncategorized connection methods. Ownership williamr@2: * is passed. williamr@2: */ williamr@2: IMPORT_C CGulIcon* UncategorizedIconL() const; williamr@2: williamr@2: private: williamr@2: /** williamr@2: * This is a private copy constructor without implementation. williamr@2: * The sole purpose of this declaration is to forbid the copying of williamr@2: * the objects of this class. williamr@2: */ williamr@2: RCmManager(RCmManager& ); williamr@2: /** williamr@2: * This is a private copy constructor without implementation. williamr@2: * The sole purpose of this declaration is to forbid the copying of williamr@2: * the objects of this class. williamr@2: */ williamr@2: RCmManager& operator=( RCmManager& ); williamr@2: //========================================================================= williamr@2: // Member data williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * the implementation class williamr@2: */ williamr@2: CCmManagerImpl* iImplementation; williamr@2: }; williamr@2: williamr@2: #include "cmmanager.inl" williamr@2: williamr@2: #endif // CMMANAGER_H