2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Implementation of Extended Connection Preferences API.
16 * This API defines extended connection parameters as a part of
17 * custom preferences mechanism making possible for Symbian
18 * licensees to define their own parameter extensions.
22 #if !(defined __EXTENDEDCONNPREF_H__)
23 #define __EXTENDEDCONNPREF_H__
26 #include <comms-infras/metadata.h>
28 #include <cmmanagerdef.h>
31 class TExtendedConnPref : public Meta::SMetaDataECom
33 User of this API must remember to link against extendedconnpref.lib and
34 netmeta.lib and add #include <extendedconnpref.h>.
36 Set methods for the extended connection preference. This preference cannot be
37 used with RConnection::Start as a TConnPref. It must be part of a
38 TConnPrefList. The extented connection preference can be appeded to connection
39 setup parameters before RConnection::Start() dispatch. Appending is carried
42 See connpref.h for more details.
50 User::LeaveIfError(conn.Open(sockSvr));
51 CleanupClosePushL(conn);
53 TConnPrefList prefList;
54 TExtendedConnPref extPrefs;
56 extPrefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
57 extPrefs.SetNoteBehaviour( ENoteBehaviourConnSilent );
59 prefList.AppendL(&extPrefs);
61 TInt error = conn.Start(prefList);
63 CleanupStack::PopAndDestroy(&conn);
67 @see RConnection::Start
70 @released since S60 5.2
77 /** UID for Extended Connection Preference API implementation. */
84 * ExtendedConnBearer enables application to request a specific bearer for
87 enum TExtendedConnBearer
89 /** Bearer support unknown. */
90 EExtendedConnBearerUnknown = 0x00000000,
91 /** Support GPRS, 3G and Cdma2000 bearers. CSD not supported. */
92 EExtendedConnBearerCellular = 0x00000001,
93 /** WLAN bearer support. */
94 EExtendedConnBearerWLAN = 0x00000002
98 * TNoteBehaviour enables application to request a specific behaviour from
99 * the middleware regarding displaying of dialogs, notes and queries.
103 /** Displays notes and queries according to default settings. */
104 ENoteBehaviourDefault = 0x00000000,
106 * Starts connection and roams between different bearers without any
107 * notes, i.e., notes about connection state are not shown to the user.
109 ENoteBehaviourConnDisableNotes = 0x00000001,
111 * Roams between different bearers without displaying any queries to
112 * the user but informs the user on the events with dialogs or notes.
113 * User is able to see only notes about connection state but not any
114 * queries which would need user's confirmation.
116 ENoteBehaviourConnDisableQueries = 0x00000002
120 * Starts connection and roams between different bearers without any
121 * queries, dialogs or notes, i.e., nothing about connection is shown
124 static const TUint32 ENoteBehaviourConnSilent =
125 ENoteBehaviourConnDisableNotes | ENoteBehaviourConnDisableQueries;
130 IMPORT_C TExtendedConnPref();
133 * Sets the purpose of the SNAP identifying where the connection is
134 * requested to. This function enables applications to start a connection
135 * to, e.g., Internet SNAP or intranet SNAP without iterating through all
136 * SNAPs to find the ID of the right one.
137 * Default value is ESnapPurposeUnknown meaning that any SNAP is fine.
139 * If SNAP purpose is set, IAP id shall be zero.
140 * If SNAP purpose is set, SNAP id shall be zero.
141 * If SNAP purpose is set, Connection selection dialog shall be disabled.
142 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
143 * selection dialog shall be enabled.
145 * @param aSnapPurpose SNAP Purpose.
147 IMPORT_C void SetSnapPurpose( CMManager::TSnapPurpose aSnapPurpose );
152 * @return SNAP purpose.
154 IMPORT_C CMManager::TSnapPurpose SnapPurpose() const;
157 * Sets SNAP id. If SNAP id is zero, it is interpreted as
158 * client's request for not requesting any specific SNAP.
159 * Default value is 0.
161 * If SNAP id is set, IAP id shall be zero.
162 * If SNAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown.
163 * If SNAP id is set, Connection selection dialog shall be disabled.
164 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
165 * selection dialog shall be enabled.
167 * @param aSnap SNAP id.
169 IMPORT_C void SetSnapId( TUint32 aSnapId );
176 IMPORT_C TUint32 SnapId() const;
181 * Setting IAP id means that the connection will be made utilizing given
182 * IAP id no matter what existing connections are available.
184 * If IAP id is zero, it is interpreted as
185 * client's request for not requesting any specific IAP.
186 * Default value is 0.
188 * If IAP id is set, SNAP id shall be zero.
189 * If IAP id is set, SNAP purpose shall be CMManager::ESnapPurposeUnknown.
190 * If IAP id is set, Connection selection dialog shall be disabled.
191 * If IAP id is set, bearer set shall be EExtendedConnBearerUnknown.
192 * If IAP id is set, forced roaming is disabled automatically.
193 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
194 * selection dialog shall be enabled.
196 * @param aIap IAP id.
198 IMPORT_C void SetIapId( TUint32 aIapId );
205 IMPORT_C TUint32 IapId() const;
208 * Sets bearer, use combination of TExtendedConnBearer values.
209 * Default value is KExtendedConnBearerUnknown.
211 * @param aBearerSet A set of bearers as a combination of
212 * TExtendedConnBearer values.
213 * Type is TUint32 due to bitfield character.
215 IMPORT_C void SetBearerSet( TUint32 aBearerSet );
218 * Gets set of requested bearers.
220 * @return Set of requested bearers. Type is TUint32 due to bifield
223 IMPORT_C TUint32 BearerSet() const;
226 * Sets note behaviour, use combination of TNoteBehaviour values.
227 * Default value is ENoteBehaviourDefault.
228 * This method does not control connection selection dialog or disconnect
229 * dialog. There are own methods for these purposes in this API.
231 * @param aNoteBehaviour Note behaviour as a combination of TNoteBehaviour
232 * values. Type is TUint32 due to bitfield
235 IMPORT_C void SetNoteBehaviour( TUint32 aNoteBehaviour );
238 * Gets note behaviour.
240 * @return Note behaviour as a combination of TNoteBehaviour values.
241 * Type is TUint32 due to bitfield character.
243 IMPORT_C TUint32 NoteBehaviour() const;
246 * Enables or disables Disconnect dialog.
247 * By default, Disconnect dialog is enabled.
249 * @param aEnableDisconnectDialog Indicates whether Disconnect dialog is
250 * enabled or disabled.
252 IMPORT_C void SetDisconnectDialog( TBool aEnableDisconnectDialog );
255 * Indicates whether Disconnect dialog is enabled.
257 * @return Indicates whether Disconnect dialog is enabled.
259 IMPORT_C TBool DisconnectDialog() const;
262 * Enables or disables Connection selection dialog. Only the SNAPs/IAPs
263 * matching with BearerSet are shown in the dialog.
264 * By default, Connection selection dialog is disabled.
266 * If Connection selection dialog is enabled, SNAP id shall be zero.
267 * If Connection selection dialog is enabled, IAP id shall be zero.
268 * If Connection selection dialog is enabled, SNAP purpose shall be
269 * CMManager::ESnapPurposeUnknown.
270 * Either SNAP purpose, SNAP id, or IAP id shall be given, or Connection
271 * selection dialog shall be enabled.
273 * @param aConnSelectionDialog Indicates whether Connection selection
274 * dialog is enabled or disabled.
276 IMPORT_C void SetConnSelectionDialog( TBool aConnSelectionDialog );
279 * Indicates whether Connection selection dialog is enabled.
281 * @return Indicates whether Connection selection dialog is enabled.
283 IMPORT_C TBool ConnSelectionDialog() const;
286 * Enables or disables forced roaming.
287 * By default, forced roaming is enabled.
288 * Forced roaming only applies on connections made to Internet SNAP.
290 * Forced roaming means that the connection can be torn down by the
291 * middleware when better one is available. E.g., when known WLAN IAP
292 * becomes available, 3G connection is disconnected.
294 * @param aForcedRoaming Indicates whether forced roaming is enabled or
297 IMPORT_C void SetForcedRoaming( TBool aForcedRoaming );
300 * Indicates whether forced roaming is enabled.
302 * @return Indicates whether forced roaming is enabled.
304 IMPORT_C TBool ForcedRoaming() const;
307 /** SMetaData implied functions */
308 EXPORT_DATA_VTABLE_AND_FN
313 CMManager::TSnapPurpose iSnapPurpose;
320 /** Note behaviour. */
321 TUint32 iNoteBehaviour;
322 /** Indicates whether UI disconnect dialog is shown. */
323 TBool iDisconnectDialog;
324 /** Indicates whether UI connection selection dialog is shown. */
325 TBool iConnSelectionDialog;
326 /** Indicates whether forced roaming is enabled. */
327 TBool iForcedRoaming;
331 #endif __EXTENDEDCONNPREF_H__