ipcm_pub/connection_settings_api/inc/cmconnectionmethod.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 57 05bc53fe583b
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
     1 /*
     1 /*
     2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:  Connection Method interface class.
    15 * Connection Method interface class.
       
    16 *
    15 *
    17 */
    16 */
    18 
       
    19 
    17 
    20 #ifndef CMCONNECTIONMETHOD_H
    18 #ifndef CMCONNECTIONMETHOD_H
    21 #define CMCONNECTIONMETHOD_H
    19 #define CMCONNECTIONMETHOD_H
    22 
    20 
       
    21 // INCLUDES
    23 #include <e32base.h>
    22 #include <e32base.h>
    24 #include <cmconnectionmethoddef.h>
    23 #include <cmconnectionmethoddef.h>
    25 
    24 
    26 // Forward declarations
    25 // CLASS DECLARATION
       
    26 class CCmPluginBaseEng;
    27 class RCmDestination;
    27 class RCmDestination;
    28 class CCmConnectionMethodWrapper;
       
    29 
       
    30 
    28 
    31 /**
    29 /**
    32  *  RCmConnectionMethod is for getting/setting values of a connection method.
    30  *  RCmConnectionMethod is for getting/setting values of a connection method.
    33  *  @lib cmmanager.lib
    31  *  @lib cmmanager.lib
    34  *  @since S60 v3.2
    32  *  @since S60 v3.2
    35  */
    33  */
    36 NONSHARABLE_CLASS( RCmConnectionMethod )
    34 NONSHARABLE_CLASS( RCmConnectionMethod )
    37     {
    35     {
       
    36     //=====================================================================
       
    37     // Constructors/Destructors
       
    38     // 
    38     public:
    39     public:
    39         /**
    40     
    40         * Default constructor.
    41         /**
       
    42         * Default constructor. 
    41         */
    43         */
    42         IMPORT_C RCmConnectionMethod();
    44         IMPORT_C RCmConnectionMethod();
    43 
    45 
    44         /**
    46 
    45         * Copy constructor.
    47         /**
    46         */
    48         * Copy constructor. 
    47         IMPORT_C RCmConnectionMethod( const RCmConnectionMethod& aConnMethod );
    49         */
    48 
    50         IMPORT_C RCmConnectionMethod(const RCmConnectionMethod& aItem);
    49         /**
    51 
    50         * Destructor.
    52 
       
    53         /**
       
    54         * Destructor. 
    51         */
    55         */
    52         IMPORT_C ~RCmConnectionMethod();
    56         IMPORT_C ~RCmConnectionMethod();
    53 
    57 
       
    58     //=====================================================================
       
    59     // API functions
    54     public:
    60     public:
       
    61     
    55         /**
    62         /**
    56         * Close the session
    63         * Close the session
    57         *
    64         *
    58         * @since S60 3.2
    65         * @since S60 3.2
    59         */
    66         */
    60         IMPORT_C void Close();
    67         IMPORT_C void Close();
    61 
    68         
    62         /**
    69         /**
    63         * Gets the value for a TInt attribute.
    70         * Gets the value for a TInt attribute.
    64         *
    71         *
    65         * @since S60 3.2
    72         * @since S60 3.2
    66         * @param aAttribute Identifies the attribute to be retrieved.
    73         * @param aAttribute Identifies the attribute to be retrieved.
    84         * @since S60 3.2
    91         * @since S60 3.2
    85         * @param aAttribute Identifies the attribute to be retrieved.
    92         * @param aAttribute Identifies the attribute to be retrieved.
    86         * @return copy of the requested attribute. Ownership is passed.
    93         * @return copy of the requested attribute. Ownership is passed.
    87         */
    94         */
    88         IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const;
    95         IMPORT_C HBufC* GetStringAttributeL( TUint32 aAttribute ) const;
    89 
    96         
    90         /**
    97         /**
    91         * Gets the value for a String8 attribute.
    98         * Gets the value for a String8 attribute.
    92         * HBuf ownership is passed to the caller
    99         * HBuf ownership is passed to the caller
    93         *
   100         *
    94         * @since S60 3.2
   101         * @since S60 3.2
    95         * @param aAttribute Identifies the attribute to be retrieved.
   102         * @param aAttribute Identifies the attribute to be retrieved.
    96         * @return copy of the requested attribute. Ownership is passed.
   103         * @return copy of the requested attribute. Ownership is passed.
    97         */
   104         */
    98         IMPORT_C HBufC8* GetString8AttributeL(
   105         IMPORT_C HBufC8* GetString8AttributeL( 
    99                 const TUint32 aAttribute ) const;
   106                                         const TUint32 aAttribute ) const;
   100 
   107 
   101         /**
   108         /**
   102         * Call this function only if this CM is an embedded destination!
   109         * Call this function only if this CM is an embedded destination!
   103         *
   110         *
   104         * @since S60 3.2
   111         * @since S60 3.2
   105         * @return embedded destination
   112         * @return embedded destination
   106         */
   113         */
   107         IMPORT_C RCmDestination DestinationL() const;
   114         IMPORT_C RCmDestination DestinationL() const;
   108 
   115 
   109 
   116         
   110         /**
   117         /**
   111         * checks if connection methods are the same
   118         * checks if connection methods are the same 
   112         *
   119         * 
   113         * @since S60 3.2
   120         * @since S60 3.2
   114         * @param aConnMethod the connection method being compared
   121         * @param aConnMethod the connection method being compared
   115         * @return ETrue if the destinations are the same
   122         * @return ETrue if the destinations are the same
   116         */
   123         */
   117         IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const;
   124         IMPORT_C TBool operator==( RCmConnectionMethod& aConnMethod ) const;
   118 
   125         
   119         /**
   126         /**
   120         * checks if connection methods are not the same
   127         * checks if connection methods are not the same 
   121         *
   128         * 
   122         * @since S60 3.2
   129         * @since S60 3.2
   123         * @param aConnMethod the connection method being compared
   130         * @param aConnMethod the connection method being compared
   124         * @return ETrue if the destinations are different
   131         * @return ETrue if the destinations are different
   125         */
   132         */
   126         IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const;
   133         IMPORT_C TBool operator!=( RCmConnectionMethod& aConnMethod ) const;
   127 
   134         
   128 
   135 
   129         /**
   136         /**
   130         * assignment operator
   137         * assignment operator 
   131         *
   138         * 
   132         * @since S60 3.2
   139         * @since S60 3.2
   133         * @return RCmConnectionMethod
   140         * @return RCmConnectionMethod
   134         */
   141         */
   135         IMPORT_C RCmConnectionMethod& operator=(
   142         IMPORT_C RCmConnectionMethod& operator=(const RCmConnectionMethod& 
   136                 const RCmConnectionMethod& aConnMethod );
   143                                                     aConnMethod);
   137 
   144 
   138         /**
   145         /**
   139         * Creates a copy of this connection method. UpdateL() has to be called
   146         * Creates a copy of this connection method. UpdateL() has to be called 
   140         * to store new connection method in database. Ownership is passed.
   147         * to store new connection method in database. Ownership is passed.
   141         */
   148         */
   142         IMPORT_C RCmConnectionMethod CreateCopyL();
   149         IMPORT_C RCmConnectionMethod CreateCopyL();
   143 
   150 
   144         /**
   151                 /**
   145         * Sets the value for a TInt attribute.
   152         * Sets the value for a TInt attribute.
   146         * @param aAttribute Identifies the attribute to be set.
   153         * @param aAttribute Identifies the attribute to be set.
   147         * @param aValue The value to be set.
   154         * @param aValue The value to be set.
   148         * @return None.
   155         * @return None.
   149         */
   156         */
   161         * Sets the value for a String16 attribute.
   168         * Sets the value for a String16 attribute.
   162         * @param aAttribute Identifies the attribute to be set.
   169         * @param aAttribute Identifies the attribute to be set.
   163         * @param aValue The value to be set.
   170         * @param aValue The value to be set.
   164         * @return None.
   171         * @return None.
   165         */
   172         */
   166         IMPORT_C void SetStringAttributeL(
   173         IMPORT_C void SetStringAttributeL( TUint32 aAttribute, 
   167                 TUint32 aAttribute,
   174                                            const TDesC16& aValue );
   168                 const TDesC16& aValue );
       
   169 
   175 
   170         /**
   176         /**
   171         * Sets the value for a String8 attribute.
   177         * Sets the value for a String8 attribute.
   172         * @param aAttribute Identifies the attribute to be set.
   178         * @param aAttribute Identifies the attribute to be set.
   173         * @param aValue The value to be set.
   179         * @param aValue The value to be set.
   174         * @return None.
   180         * @return None.
   175         */
   181         */
   176         IMPORT_C void SetString8AttributeL(
   182         IMPORT_C void SetString8AttributeL( TUint32 aAttribute, 
   177                 TUint32 aAttribute,
   183                                             const TDesC8& aValue );
   178                 const TDesC8& aValue );
   184 
   179 
   185         /**
   180         /**
   186         * Try to delete the connection method. If it is referenced from 
   181         * Try to delete the connection method. If it is referenced from
   187         * any destination, then the references are removed and the 
   182         * any destination, then the references are removed and the
       
   183         * connection method is deleted.
   188         * connection method is deleted.
   184         * Do NOT call this function if you got this
   189         * Do NOT call this function if you got this
   185         * connection method from a destination. Call destination's
   190         * connection method from a destination. Call destination's
   186         * DeleteConnectionMethodL() function instead.
   191         * DeleteConnectionMethodL() function instead.
   187         * @return ETrue if connection method deleted.
   192         * @return ETrue if connection method deleted.
   189         IMPORT_C TBool DeleteL();
   194         IMPORT_C TBool DeleteL();
   190 
   195 
   191         /**
   196         /**
   192         * Update in the database.
   197         * Update in the database.
   193         * @return None.
   198         * @return None.
   194         */
   199         */        
   195         IMPORT_C void UpdateL();
   200         IMPORT_C void UpdateL();
   196 
   201 
   197         /**
       
   198          * Gets the icon identifier(name) of the connection method. It can
       
   199          * contain path information. HBufC* ownership is passed to the caller.
       
   200          * @return Returns pointer to a buffer which identifies the requested
       
   201          * icon.
       
   202          */
       
   203         IMPORT_C HBufC* GetIconL() const;
       
   204 
       
   205         /**
       
   206          * Sets the icon identifier(name) of the connection method. It can
       
   207          * contain path information.
       
   208          * @param aIcon Identifier of the connection method icon.
       
   209          */
       
   210         IMPORT_C void SetIconL( const TDesC& aIcon );
       
   211 
       
   212         /**
       
   213         * Reload the contents of the connection method from database.
       
   214         * Any current changes made to the connection method are lost.
       
   215         * @return None.
       
   216         */
       
   217         IMPORT_C void RefreshL();
       
   218 
       
   219 
       
   220     private:
   202     private:
       
   203     
   221         friend class RCmDestination;
   204         friend class RCmDestination;
   222         friend class RCmManager;
   205         friend class RCmManager;
   223 
   206         
   224     private:
   207     private:
   225         CCmConnectionMethodWrapper* iCmConnectionMethodWrapper;
   208         
       
   209         /**
       
   210          * the implementation class
       
   211          */
       
   212         CCmPluginBaseEng* iImplementation;
   226     };
   213     };
   227 
   214 
   228 #endif // CMCONNECTIONMETHOD_H
   215 #include <cmconnectionmethod.inl>
   229 
   216     
   230 // End of file
   217 #endif      // CMCONNECTIONMETHOD_H