epoc32/include/mw/extendedconnpref.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description: Implementation of Extended Connection Preferences API.
williamr@4
    15
*              
williamr@4
    16
*              This API defines extended connection parameters as a part of
williamr@4
    17
*              custom preferences mechanism making possible for Symbian 
williamr@4
    18
*              licensees to define their own parameter extensions.
williamr@4
    19
*
williamr@4
    20
*/
williamr@4
    21
williamr@4
    22
#if !(defined __EXTENDEDCONNPREF_H__)
williamr@4
    23
#define __EXTENDEDCONNPREF_H__
williamr@4
    24
williamr@4
    25
#include <e32base.h>
williamr@4
    26
#include <comms-infras/metadata.h>
williamr@4
    27
#include <connpref.h>
williamr@4
    28
#include <cmmanagerdef.h>
williamr@4
    29
williamr@4
    30
williamr@4
    31
class TExtendedConnPref : public Meta::SMetaDataECom
williamr@4
    32
/**
williamr@4
    33
User of this API must remember to link against extendedconnpref.lib and 
williamr@4
    34
netmeta.lib and add #include <extendedconnpref.h>.
williamr@4
    35
williamr@4
    36
Set methods for the extended connection preference. This preference cannot be
williamr@4
    37
used with RConnection::Start as a TConnPref. It must be part of a 
williamr@4
    38
TConnPrefList. The extented connection preference can be appeded to connection
williamr@4
    39
setup parameters before RConnection::Start() dispatch. Appending is carried 
williamr@4
    40
out as follows. 
williamr@4
    41
williamr@4
    42
See connpref.h for more details.
williamr@4
    43
williamr@4
    44
@code
williamr@4
    45
williamr@4
    46
RSocketServ sockSvr;
williamr@4
    47
RConnection conn;
williamr@4
    48
williamr@4
    49
sockSvr.Connect();
williamr@4
    50
User::LeaveIfError(conn.Open(sockSvr));
williamr@4
    51
CleanupClosePushL(conn);
williamr@4
    52
williamr@4
    53
TConnPrefList prefList;
williamr@4
    54
TExtendedConnPref extPrefs;
williamr@4
    55
williamr@4
    56
extPrefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
williamr@4
    57
extPrefs.SetNoteBehaviour( ENoteBehaviourConnSilent );
williamr@4
    58
williamr@4
    59
prefList.AppendL(&extPrefs);
williamr@4
    60
williamr@4
    61
TInt error = conn.Start(prefList);
williamr@4
    62
williamr@4
    63
CleanupStack::PopAndDestroy(&conn);
williamr@4
    64
@endcode
williamr@4
    65
williamr@4
    66
@see TConnPrefList
williamr@4
    67
@see RConnection::Start
williamr@4
    68
williamr@4
    69
@publishedAll
williamr@4
    70
@released since S60 5.2
williamr@4
    71
*/
williamr@4
    72
    {
williamr@4
    73
public:
williamr@4
    74
 
williamr@4
    75
    enum
williamr@4
    76
        {
williamr@4
    77
        /** UID for Extended Connection Preference API implementation. */
williamr@4
    78
        EUid = 0x20016A82, 
williamr@4
    79
        /** Subidentifier. */
williamr@4
    80
        ETypeId = 1
williamr@4
    81
        };
williamr@4
    82
williamr@4
    83
    /**
williamr@4
    84
    * ExtendedConnBearer enables application to request a specific bearer for
williamr@4
    85
    * a connection.
williamr@4
    86
    */
williamr@4
    87
    enum TExtendedConnBearer
williamr@4
    88
        {
williamr@4
    89
        /** Bearer support unknown. */
williamr@4
    90
        EExtendedConnBearerUnknown  = 0x00000000,
williamr@4
    91
        /** Support GPRS, 3G and Cdma2000 bearers. CSD not supported. */
williamr@4
    92
        EExtendedConnBearerCellular = 0x00000001,
williamr@4
    93
        /** WLAN bearer support. */
williamr@4
    94
        EExtendedConnBearerWLAN     = 0x00000002
williamr@4
    95
        };
williamr@4
    96
williamr@4
    97
    /**
williamr@4
    98
    * TNoteBehaviour enables application to request a specific behaviour from
williamr@4
    99
    * the middleware regarding displaying of dialogs, notes and queries.
williamr@4
   100
    */
williamr@4
   101
    enum TNoteBehaviour
williamr@4
   102
        {
williamr@4
   103
        /** Displays notes and queries according to default settings. */
williamr@4
   104
        ENoteBehaviourDefault            = 0x00000000,
williamr@4
   105
        /**
williamr@4
   106
        * Starts connection and roams between different bearers without any 
williamr@4
   107
        * notes, i.e., notes about connection state are not shown to the user.
williamr@4
   108
        */
williamr@4
   109
        ENoteBehaviourConnDisableNotes   = 0x00000001,
williamr@4
   110
        /**
williamr@4
   111
        * Roams between different bearers without displaying any queries to
williamr@4
   112
        * the user but informs the user on the events with dialogs or notes.
williamr@4
   113
        * User is able to see only notes about connection state but not any
williamr@4
   114
        * queries which would need user's confirmation.
williamr@4
   115
        */
williamr@4
   116
        ENoteBehaviourConnDisableQueries = 0x00000002
williamr@4
   117
        };
williamr@4
   118
williamr@4
   119
    /**
williamr@4
   120
    * Starts connection and roams between different bearers without any 
williamr@4
   121
    * queries, dialogs or notes, i.e., nothing about connection is shown
williamr@4
   122
    * to the user.
williamr@4
   123
    */
williamr@4
   124
    static const TUint32 ENoteBehaviourConnSilent =
williamr@4
   125
        ENoteBehaviourConnDisableNotes | ENoteBehaviourConnDisableQueries;
williamr@4
   126
williamr@4
   127
    /** 
williamr@4
   128
    * Constructor.
williamr@4
   129
    */
williamr@4
   130
    IMPORT_C TExtendedConnPref();
williamr@4
   131
    
williamr@4
   132
    /**
williamr@4
   133
    * Sets the purpose of the SNAP identifying where the connection is 
williamr@4
   134
    * requested to. This function enables applications to start a connection
williamr@4
   135
    * to, e.g., Internet SNAP or intranet SNAP without iterating through all
williamr@4
   136
    * SNAPs to find the ID of the right one.
williamr@4
   137
    * Default value is ESnapPurposeUnknown meaning that any SNAP is fine.
williamr@4
   138
    * 
williamr@4
   139
    * If SNAP purpose is set, IAP id shall be zero.
williamr@4
   140
    * If SNAP purpose is set, SNAP id shall be zero.
williamr@4
   141
    * If SNAP purpose is set, Connection selection dialog shall be disabled.
williamr@4
   142
    * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
williamr@4
   143
    * selection dialog shall be enabled.
williamr@4
   144
    * 
williamr@4
   145
    * @param aSnapPurpose SNAP Purpose.
williamr@4
   146
    */
williamr@4
   147
    IMPORT_C void SetSnapPurpose( CMManager::TSnapPurpose aSnapPurpose );
williamr@4
   148
williamr@4
   149
    /**
williamr@4
   150
    * Gets SNAP purpose.
williamr@4
   151
    *
williamr@4
   152
    * @return SNAP purpose.
williamr@4
   153
    */
williamr@4
   154
    IMPORT_C CMManager::TSnapPurpose SnapPurpose() const;
williamr@4
   155
williamr@4
   156
    /**
williamr@4
   157
    * Sets SNAP id. If SNAP id is zero, it is interpreted as 
williamr@4
   158
    * client's request for not requesting any specific SNAP.
williamr@4
   159
    * Default value is 0.
williamr@4
   160
    *
williamr@4
   161
    * If SNAP id is set, IAP id shall be zero.
williamr@4
   162
    * If SNAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown.
williamr@4
   163
    * If SNAP id is set, Connection selection dialog shall be disabled.
williamr@4
   164
    * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
williamr@4
   165
    * selection dialog shall be enabled.
williamr@4
   166
    *
williamr@4
   167
    * @param aSnap SNAP id.
williamr@4
   168
    */
williamr@4
   169
    IMPORT_C void SetSnapId( TUint32 aSnapId );
williamr@4
   170
williamr@4
   171
    /**
williamr@4
   172
    * Gets SNAP id.
williamr@4
   173
    *
williamr@4
   174
    * @return SNAP id.
williamr@4
   175
    */
williamr@4
   176
    IMPORT_C TUint32 SnapId() const;
williamr@4
   177
williamr@4
   178
    /**
williamr@4
   179
    * Sets IAP id.
williamr@4
   180
    * 
williamr@4
   181
    * Setting IAP id means that the connection will be made utilizing given
williamr@4
   182
    * IAP id no matter what existing connections are available.
williamr@4
   183
    * 
williamr@4
   184
    * If IAP id is zero, it is interpreted as
williamr@4
   185
    * client's request for not requesting any specific IAP.
williamr@4
   186
    * Default value is 0.
williamr@4
   187
    * 
williamr@4
   188
    * If IAP id is set, SNAP id shall be zero.
williamr@4
   189
    * If IAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown.
williamr@4
   190
    * If IAP id is set, Connection selection dialog shall be disabled.
williamr@4
   191
    * If IAP id is set, bearer set shall be EExtendedConnBearerUnknown.
williamr@4
   192
    * If IAP id is set, forced roaming is disabled automatically.
williamr@4
   193
    * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
williamr@4
   194
    * selection dialog shall be enabled.
williamr@4
   195
    * 
williamr@4
   196
    * @param aIap IAP id.
williamr@4
   197
    */
williamr@4
   198
    IMPORT_C void SetIapId( TUint32 aIapId );
williamr@4
   199
williamr@4
   200
    /**
williamr@4
   201
    * Gets IAP id.
williamr@4
   202
    *
williamr@4
   203
    * @return IAP id.
williamr@4
   204
    */
williamr@4
   205
    IMPORT_C TUint32 IapId() const;
williamr@4
   206
williamr@4
   207
    /**
williamr@4
   208
    * Sets bearer, use combination of TExtendedConnBearer values.
williamr@4
   209
    * Default value is KExtendedConnBearerUnknown.
williamr@4
   210
    *
williamr@4
   211
    * @param aBearerSet A set of bearers as a combination of
williamr@4
   212
    *                   TExtendedConnBearer values.
williamr@4
   213
    *                   Type is TUint32 due to bitfield character.
williamr@4
   214
    */
williamr@4
   215
    IMPORT_C void SetBearerSet( TUint32 aBearerSet );
williamr@4
   216
williamr@4
   217
    /**
williamr@4
   218
    * Gets set of requested bearers.
williamr@4
   219
    *
williamr@4
   220
    * @return Set of requested bearers. Type is TUint32 due to bifield
williamr@4
   221
    *         character.
williamr@4
   222
    */
williamr@4
   223
    IMPORT_C TUint32 BearerSet() const;
williamr@4
   224
williamr@4
   225
    /**
williamr@4
   226
    * Sets note behaviour, use combination of TNoteBehaviour values.
williamr@4
   227
    * Default value is ENoteBehaviourDefault.
williamr@4
   228
    * This method does not control connection selection dialog or disconnect
williamr@4
   229
    * dialog. There are own methods for these purposes in this API.
williamr@4
   230
    *
williamr@4
   231
    * @param aNoteBehaviour Note behaviour as a combination of TNoteBehaviour
williamr@4
   232
    *                       values. Type is TUint32 due to bitfield
williamr@4
   233
    *                       character.
williamr@4
   234
    */ 
williamr@4
   235
    IMPORT_C void SetNoteBehaviour( TUint32 aNoteBehaviour );
williamr@4
   236
williamr@4
   237
    /**
williamr@4
   238
    * Gets note behaviour.
williamr@4
   239
    *
williamr@4
   240
    * @return Note behaviour as a combination of TNoteBehaviour values.
williamr@4
   241
    *         Type is TUint32 due to bitfield character.
williamr@4
   242
    */
williamr@4
   243
    IMPORT_C TUint32 NoteBehaviour() const;
williamr@4
   244
williamr@4
   245
    /**
williamr@4
   246
    * Enables or disables Disconnect dialog.
williamr@4
   247
    * By default, Disconnect dialog is enabled.
williamr@4
   248
    *
williamr@4
   249
    * @param aEnableDisconnectDialog Indicates whether Disconnect dialog is
williamr@4
   250
    *                                enabled or disabled.
williamr@4
   251
    */
williamr@4
   252
    IMPORT_C void SetDisconnectDialog( TBool aEnableDisconnectDialog );
williamr@4
   253
williamr@4
   254
    /**
williamr@4
   255
    * Indicates whether Disconnect dialog is enabled.
williamr@4
   256
    *
williamr@4
   257
    * @return Indicates whether Disconnect dialog is enabled.
williamr@4
   258
    */
williamr@4
   259
    IMPORT_C TBool DisconnectDialog() const;
williamr@4
   260
williamr@4
   261
    /**
williamr@4
   262
    * Enables or disables Connection selection dialog. Only the SNAPs/IAPs
williamr@4
   263
    * matching with BearerSet are shown in the dialog.
williamr@4
   264
    * By default, Connection selection dialog is disabled.
williamr@4
   265
    *
williamr@4
   266
    * If Connection selection dialog is enabled, SNAP id shall be zero.
williamr@4
   267
    * If Connection selection dialog is enabled, IAP id shall be zero.
williamr@4
   268
    * If Connection selection dialog is enabled, SNAP purpose shall be
williamr@4
   269
    * CMManager::ESnapPurposeUnknown.
williamr@4
   270
    * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
williamr@4
   271
    * selection dialog shall be enabled.
williamr@4
   272
    *
williamr@4
   273
    * @param aConnSelectionDialog Indicates whether Connection selection
williamr@4
   274
    *                             dialog is enabled or disabled.
williamr@4
   275
    */
williamr@4
   276
    IMPORT_C void SetConnSelectionDialog( TBool aConnSelectionDialog );
williamr@4
   277
williamr@4
   278
    /**
williamr@4
   279
    * Indicates whether Connection selection dialog is enabled.
williamr@4
   280
    *
williamr@4
   281
    * @return Indicates whether Connection selection dialog is enabled.
williamr@4
   282
    */
williamr@4
   283
    IMPORT_C TBool ConnSelectionDialog() const;
williamr@4
   284
williamr@4
   285
    /**
williamr@4
   286
    * Enables or disables forced roaming.
williamr@4
   287
    * By default, forced roaming is enabled.
williamr@4
   288
    * Forced roaming only applies on connections made to Internet SNAP.
williamr@4
   289
    * 
williamr@4
   290
    * Forced roaming means that the connection can be torn down by the
williamr@4
   291
    * middleware when better one is available. E.g., when known WLAN IAP
williamr@4
   292
    * becomes available, 3G connection is disconnected.
williamr@4
   293
    * 
williamr@4
   294
    * @param aForcedRoaming Indicates whether forced roaming is enabled or
williamr@4
   295
    *                       disabled.
williamr@4
   296
    */
williamr@4
   297
    IMPORT_C void SetForcedRoaming( TBool aForcedRoaming );
williamr@4
   298
williamr@4
   299
    /**
williamr@4
   300
    * Indicates whether forced roaming is enabled.
williamr@4
   301
    *
williamr@4
   302
    * @return Indicates whether forced roaming is enabled.
williamr@4
   303
    */
williamr@4
   304
    IMPORT_C TBool ForcedRoaming() const;
williamr@4
   305
williamr@4
   306
protected:
williamr@4
   307
    /** SMetaData implied functions */
williamr@4
   308
    EXPORT_DATA_VTABLE_AND_FN
williamr@4
   309
williamr@4
   310
private:
williamr@4
   311
williamr@4
   312
    /** SNAP purpose. */
williamr@4
   313
    CMManager::TSnapPurpose iSnapPurpose;
williamr@4
   314
    /** SNAP id. */
williamr@4
   315
    TUint32 iSnapId;
williamr@4
   316
    /** IAP id. */
williamr@4
   317
    TUint32 iIapId;
williamr@4
   318
    /** Bearer set. */
williamr@4
   319
    TUint32 iBearerSet;
williamr@4
   320
    /** Note behaviour. */
williamr@4
   321
    TUint32 iNoteBehaviour;
williamr@4
   322
    /** Indicates whether UI disconnect dialog is shown. */
williamr@4
   323
    TBool iDisconnectDialog;
williamr@4
   324
    /** Indicates whether UI connection selection dialog is shown. */    
williamr@4
   325
    TBool iConnSelectionDialog;
williamr@4
   326
    /** Indicates whether forced roaming is enabled. */
williamr@4
   327
    TBool iForcedRoaming;
williamr@4
   328
    };
williamr@4
   329
williamr@4
   330
williamr@4
   331
#endif __EXTENDEDCONNPREF_H__