epoc32/include/mw/cmconnectionmethod.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) 2006 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:  Connection Method interface class.
    15 *
    16 */
    17 
    18 #ifndef CMCONNECTIONMETHOD_H
    19 #define CMCONNECTIONMETHOD_H
    20 
    21 // INCLUDES
    22 #include <e32base.h>
    23 #include <cmconnectionmethoddef.h>
    24 
    25 // CLASS DECLARATION
    26 class CCmPluginBaseEng;
    27 class RCmDestination;
    28 
    29 /**
    30  *  RCmConnectionMethod is for getting/setting values of a connection method.
    31  *  @lib cmmanager.lib
    32  *  @since S60 v3.2
    33  */
    34 NONSHARABLE_CLASS( RCmConnectionMethod )
    35     {
    36     //=====================================================================
    37     // Constructors/Destructors
    38     // 
    39     public:
    40     
    41         /**
    42         * Default constructor. 
    43         */
    44         IMPORT_C RCmConnectionMethod();
    45 
    46 
    47         /**
    48         * Copy constructor. 
    49         */
    50         IMPORT_C RCmConnectionMethod(const RCmConnectionMethod& aItem);
    51 
    52 
    53         /**
    54         * Destructor. 
    55         */
    56         IMPORT_C ~RCmConnectionMethod();
    57 
    58     //=====================================================================
    59     // API functions
    60     public:
    61     
    62         /**
    63         * Close the session
    64         *
    65         * @since S60 3.2
    66         */
    67         IMPORT_C void Close();
    68         
    69         /**
    70         * Gets the value for a TInt attribute.
    71         *
    72         * @since S60 3.2
    73         * @param aAttribute Identifies the attribute to be retrieved.
    74         * @return contains the requested TInt attribute.
    75         */
    76         IMPORT_C TUint32 GetIntAttributeL( TUint32 aAttribute ) const;
    77 
    78         /**
    79         * Gets the value for a TBool attribute.
    80         *
    81         * @since S60 3.2
    82         * @param aAttribute Identifies the attribute to be retrieved.
    83         * @return contains the requested TBool attribute.
    84         */
    85         IMPORT_C TBool GetBoolAttributeL( TUint32 aAttribute ) const;
    86 
    87         /**
    88         * Gets the value for a String16 attribute.
    89         * HBuf ownership is passed to the caller
    90         *
    91         * @since S60 3.2
    92         * @param aAttribute Identifies the attribute to be retrieved.
    93         * @return copy of the requested attribute. Ownership is passed.
    94         */
    95         IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const;
    96         
    97         /**
    98         * Gets the value for a String8 attribute.
    99         * HBuf ownership is passed to the caller
   100         *
   101         * @since S60 3.2
   102         * @param aAttribute Identifies the attribute to be retrieved.
   103         * @return copy of the requested attribute. Ownership is passed.
   104         */
   105         IMPORT_C HBufC8* GetString8AttributeL( 
   106                                         const TUint32 aAttribute ) const;
   107 
   108         /**
   109         * Call this function only if this CM is an embedded destination!
   110         *
   111         * @since S60 3.2
   112         * @return embedded destination
   113         */
   114         IMPORT_C RCmDestination DestinationL() const;
   115 
   116         
   117         /**
   118         * checks if connection methods are the same 
   119         * 
   120         * @since S60 3.2
   121         * @param aConnMethod the connection method being compared
   122         * @return ETrue if the destinations are the same
   123         */
   124         IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const;
   125         
   126         /**
   127         * checks if connection methods are not the same 
   128         * 
   129         * @since S60 3.2
   130         * @param aConnMethod the connection method being compared
   131         * @return ETrue if the destinations are different
   132         */
   133         IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const;
   134         
   135 
   136         /**
   137         * assignment operator 
   138         * 
   139         * @since S60 3.2
   140         * @return RCmConnectionMethod
   141         */
   142         IMPORT_C RCmConnectionMethod& operator=(const RCmConnectionMethod& 
   143                                                     aConnMethod);
   144 
   145         /**
   146         * Creates a copy of this connection method. UpdateL() has to be called 
   147         * to store new connection method in database. Ownership is passed.
   148         */
   149         IMPORT_C RCmConnectionMethod CreateCopyL();
   150 
   151                 /**
   152         * Sets the value for a TInt attribute.
   153         * @param aAttribute Identifies the attribute to be set.
   154         * @param aValue The value to be set.
   155         * @return None.
   156         */
   157         IMPORT_C void SetIntAttributeL( TUint32 aAttribute, TUint32 aValue );
   158 
   159         /**
   160         * Sets the value for a TBool attribute.
   161         * @param aAttribute Identifies the attribute to be set.
   162         * @param aValue The value to be set.
   163         * @return None.
   164         */
   165         IMPORT_C void SetBoolAttributeL( TUint32 aAttribute, TBool aValue );
   166 
   167         /**
   168         * Sets the value for a String16 attribute.
   169         * @param aAttribute Identifies the attribute to be set.
   170         * @param aValue The value to be set.
   171         * @return None.
   172         */
   173         IMPORT_C void SetStringAttributeL( TUint32 aAttribute, 
   174                                            const TDesC16& aValue );
   175 
   176         /**
   177         * Sets the value for a String8 attribute.
   178         * @param aAttribute Identifies the attribute to be set.
   179         * @param aValue The value to be set.
   180         * @return None.
   181         */
   182         IMPORT_C void SetString8AttributeL( TUint32 aAttribute, 
   183                                             const TDesC8& aValue );
   184 
   185         /**
   186         * Try to delete the connection method. If it is referenced from 
   187         * any destination, then the references are removed and the 
   188         * connection method is deleted.
   189         * Do NOT call this function if you got this
   190         * connection method from a destination. Call destination's
   191         * DeleteConnectionMethodL() function instead.
   192         * @return ETrue if connection method deleted.
   193         */
   194         IMPORT_C TBool DeleteL();
   195 
   196         /**
   197         * Update in the database.
   198         * @return None.
   199         */        
   200         IMPORT_C void UpdateL();
   201 
   202     private:
   203     
   204         friend class RCmDestination;
   205         friend class RCmManager;
   206         
   207     private:
   208         
   209         /**
   210          * the implementation class
   211          */
   212         CCmPluginBaseEng* iImplementation;
   213     };
   214 
   215 #include <cmconnectionmethod.inl>
   216     
   217 #endif      // CMCONNECTIONMETHOD_H