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 Method interface class. williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef CMCONNECTIONMETHOD_H williamr@2: #define CMCONNECTIONMETHOD_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: williamr@2: // CLASS DECLARATION williamr@2: class CCmPluginBaseEng; williamr@2: class RCmDestination; williamr@2: williamr@2: /** williamr@2: * RCmConnectionMethod is for getting/setting values of a connection method. williamr@2: * @lib cmmanager.lib williamr@2: * @since S60 v3.2 williamr@2: */ williamr@2: NONSHARABLE_CLASS( RCmConnectionMethod ) 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: IMPORT_C RCmConnectionMethod(); williamr@2: williamr@2: williamr@2: /** williamr@2: * Copy constructor. williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod(const RCmConnectionMethod& aItem); williamr@2: williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~RCmConnectionMethod(); williamr@2: williamr@2: //===================================================================== williamr@2: // API functions williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Close the session williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: IMPORT_C void Close(); williamr@2: williamr@2: /** williamr@2: * Gets the value for a TInt attribute. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aAttribute Identifies the attribute to be retrieved. williamr@2: * @return contains the requested TInt attribute. williamr@2: */ williamr@2: IMPORT_C TUint32 GetIntAttributeL( TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Gets the value for a TBool attribute. williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aAttribute Identifies the attribute to be retrieved. williamr@2: * @return contains the requested TBool attribute. williamr@2: */ williamr@2: IMPORT_C TBool GetBoolAttributeL( TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Gets the value for a String16 attribute. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aAttribute Identifies the attribute to be retrieved. williamr@2: * @return copy of the requested attribute. Ownership is passed. williamr@2: */ williamr@2: IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Gets the value for a String8 attribute. williamr@2: * HBuf ownership is passed to the caller williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aAttribute Identifies the attribute to be retrieved. williamr@2: * @return copy of the requested attribute. Ownership is passed. williamr@2: */ williamr@2: IMPORT_C HBufC8* GetString8AttributeL( williamr@2: const TUint32 aAttribute ) const; williamr@2: williamr@2: /** williamr@2: * Call this function only if this CM is an embedded destination! williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @return embedded destination williamr@2: */ williamr@2: IMPORT_C RCmDestination DestinationL() const; williamr@2: williamr@2: williamr@2: /** williamr@2: * checks if connection methods are the same williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aConnMethod the connection method being compared williamr@2: * @return ETrue if the destinations are the same williamr@2: */ williamr@2: IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const; williamr@2: williamr@2: /** williamr@2: * checks if connection methods are not the same williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @param aConnMethod the connection method being compared williamr@2: * @return ETrue if the destinations are different williamr@2: */ williamr@2: IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const; williamr@2: williamr@2: williamr@2: /** williamr@2: * assignment operator williamr@2: * williamr@2: * @since S60 3.2 williamr@2: * @return RCmConnectionMethod williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod& operator=(const RCmConnectionMethod& williamr@2: aConnMethod); williamr@2: williamr@2: /** williamr@2: * Creates a copy of this connection method. UpdateL() has to be called williamr@2: * to store new connection method in database. Ownership is passed. williamr@2: */ williamr@2: IMPORT_C RCmConnectionMethod CreateCopyL(); williamr@2: williamr@2: /** williamr@2: * Sets the value for a TInt attribute. williamr@2: * @param aAttribute Identifies the attribute to be set. williamr@2: * @param aValue The value to be set. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void SetIntAttributeL( TUint32 aAttribute, TUint32 aValue ); williamr@2: williamr@2: /** williamr@2: * Sets the value for a TBool attribute. williamr@2: * @param aAttribute Identifies the attribute to be set. williamr@2: * @param aValue The value to be set. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void SetBoolAttributeL( TUint32 aAttribute, TBool aValue ); williamr@2: williamr@2: /** williamr@2: * Sets the value for a String16 attribute. williamr@2: * @param aAttribute Identifies the attribute to be set. williamr@2: * @param aValue The value to be set. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void SetStringAttributeL( TUint32 aAttribute, williamr@2: const TDesC16& aValue ); williamr@2: williamr@2: /** williamr@2: * Sets the value for a String8 attribute. williamr@2: * @param aAttribute Identifies the attribute to be set. williamr@2: * @param aValue The value to be set. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void SetString8AttributeL( TUint32 aAttribute, williamr@2: const TDesC8& aValue ); williamr@2: williamr@2: /** williamr@2: * Try to delete the connection method. If it is referenced from williamr@2: * any destination, then the references are removed and the williamr@2: * connection method is deleted. williamr@2: * Do NOT call this function if you got this williamr@2: * connection method from a destination. Call destination's williamr@2: * DeleteConnectionMethodL() function instead. williamr@2: * @return ETrue if connection method deleted. williamr@2: */ williamr@2: IMPORT_C TBool DeleteL(); williamr@2: williamr@2: /** williamr@2: * Update in the database. williamr@2: * @return None. williamr@2: */ williamr@2: IMPORT_C void UpdateL(); williamr@2: williamr@2: private: williamr@2: williamr@2: friend class RCmDestination; williamr@2: friend class RCmManager; williamr@2: williamr@2: private: williamr@2: williamr@2: /** williamr@2: * the implementation class williamr@2: */ williamr@2: CCmPluginBaseEng* iImplementation; williamr@2: }; williamr@2: williamr@2: #include williamr@2: williamr@2: #endif // CMCONNECTIONMETHOD_H