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