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