|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-E2E2FACF-5D4F-43E8-8B53-B268252CF572" xml:lang="en"><title>Defining |
|
13 Connection Management Items</title><shortdesc>Your application should define the connection management items |
|
14 (destination networks, access points, default connection, and always ask) |
|
15 it supports and show only the supported items in the UI. In this example, |
|
16 the application supports default connection, always ask, and destination networks. |
|
17 Access points (if supported) of a certain destination network can be seen |
|
18 under the Options menu when the destination network is highlighted.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
19 <context id="GUID-54907FC2-9B54-4E72-8953-461C1650560C"> <p>To define |
|
20 the connection management items:</p> </context> |
|
21 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-10-1-14-1-1-7-1-4-1-3-2"> |
|
22 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-10-1-14-1-1-7-1-4-1-3-2-1"><cmd>Request the connection |
|
23 settings dialog for supported items using the Connection Settings UI API.</cmd> |
|
24 </step> |
|
25 <step id="GUID-B9C9B9BC-5DA3-4943-9995-9975E5BBA5A7"><cmd>Show the items that your application supports in the UI using the |
|
26 Connection Settings UI API. After the user has made a selection, it is returned |
|
27 to the application.</cmd> |
|
28 </step> |
|
29 <step id="GUID-BC98D052-7D13-4641-B015-9D5A71E6179D"><cmd>Store the user selection in the application's connection setup. |
|
30 For information on how to start the connection through a destination network, |
|
31 see <xref href="GUID-DBF6760F-D209-4B8F-89D5-A7EFFF7959E2.dita">Starting the Connection |
|
32 through the Destination Network</xref>. If you want to prompt the user to |
|
33 make this selection, see Prompting the user to select a destination network.</cmd> |
|
34 </step> |
|
35 </steps> |
|
36 <example><codeblock xml:space="preserve">#include <cmapplicationsettingsui.h>TCmSettingSelection userSelection; |
|
37 |
|
38 CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL(); |
|
39 CleanupStack::PushL( settings ); |
|
40 |
|
41 TUint listedItems = EShowAlwaysAsk | EShowDefaultConnection | |
|
42 EShowDestinations | EShowConnectionMethods; |
|
43 |
|
44 TBearerFilterArray filter; |
|
45 |
|
46 settings->RunApplicationSettingsL( userSelection, |
|
47 listedItems, |
|
48 filter ); |
|
49 CleanupStack::PopAndDestroy( settings ); |
|
50 |
|
51 switch ( userSelection.iResult ) |
|
52 { |
|
53 case EDestination: |
|
54 { |
|
55 TConnSnapPref prefs; |
|
56 prefs.SetSnap( userSelection.iId ); |
|
57 |
|
58 iConnection.Start( prefs, iStatus ); |
|
59 break; |
|
60 } |
|
61 case EConnectionMethod: |
|
62 { |
|
63 TCommDbConnPref prefs; |
|
64 prefs.SetIapId( userSelection.iId ); |
|
65 prefs.SetDialogPreference( ECommDbDialogPrefDoNotPrompt ); |
|
66 |
|
67 iConnection.Start( prefs, iStatus ); |
|
68 break; |
|
69 } |
|
70 case EDefaultConnection: |
|
71 { |
|
72 iConnection.Start( iStatus ); |
|
73 break; |
|
74 } |
|
75 default: // EAlwaysAsk |
|
76 { |
|
77 TCommDbConnPref prefs; |
|
78 prefs.SetDialogPreference( ECommDbDialogPrefPrompt ); |
|
79 |
|
80 iConnection.Start( prefs, iStatus ); |
|
81 } |
|
82 } |
|
83 SetActive();</codeblock></example> |
|
84 </taskbody></task> |