|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Class header for CWsfWlanIapCreator |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_WSFWLANIAPWIZARD_H |
|
21 #define C_WSFWLANIAPWIZARD_H |
|
22 |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <e32base.h> |
|
26 #include <AknWaitDialog.h> |
|
27 |
|
28 // INTERNAL INCLUDES |
|
29 #include "wsfwlaninfo.h" |
|
30 |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CWsfWlanIapCreator; |
|
34 class CWsfWlanSsidDiscovery; |
|
35 |
|
36 |
|
37 // CLASS DEFINITION |
|
38 /** |
|
39 * Class to control the user interaction during access point creation |
|
40 * |
|
41 * @lib wsfapwizard.lib |
|
42 * @since S60 5.0 |
|
43 */ |
|
44 NONSHARABLE_CLASS( CWsfWlanIapWizard ): public CBase, |
|
45 public MProgressDialogCallback |
|
46 { |
|
47 public: |
|
48 /** |
|
49 * Factory function. |
|
50 * @since S60 5.0 |
|
51 * @return Class instance |
|
52 */ |
|
53 IMPORT_C static CWsfWlanIapWizard* NewL(); |
|
54 |
|
55 /** |
|
56 * Factory function. |
|
57 * @since S60 5.0 |
|
58 * @return Class instance |
|
59 */ |
|
60 IMPORT_C static CWsfWlanIapWizard* NewLC(); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 * @since S60 5.0 |
|
65 */ |
|
66 IMPORT_C ~CWsfWlanIapWizard(); |
|
67 |
|
68 |
|
69 private: |
|
70 /** |
|
71 * Constructor |
|
72 * @since S60 5.0 |
|
73 */ |
|
74 CWsfWlanIapWizard(); |
|
75 |
|
76 /** |
|
77 * Second-phase constructor |
|
78 * @since S60 5.0 |
|
79 */ |
|
80 void ConstructL(); |
|
81 |
|
82 |
|
83 private: // from MProgressDialogCallback |
|
84 |
|
85 /** |
|
86 * Callback method. Gets called when a dialog is dismissed. |
|
87 * @since S60 5.0 |
|
88 * @param aButtonId The button which caused the dismiss |
|
89 */ |
|
90 void DialogDismissedL( TInt aButtonId ); |
|
91 |
|
92 |
|
93 public: // new methods |
|
94 /** |
|
95 * Starts the IAP creation wizard using the given wlaninfo item |
|
96 * @since S60 5.0 |
|
97 * @param aWlanInfo The wlaninfo with the already known network details |
|
98 * @param aDefineAccessPoint If ETrue, 'Define access point' was |
|
99 * selected from 'Options' menu |
|
100 * @return ETrue on success, otherwise EFalse |
|
101 */ |
|
102 IMPORT_C TBool LaunchWizardL( TWsfWlanInfo& aWlanInfo, |
|
103 TBool aDefineAccessPoint ); |
|
104 |
|
105 /** |
|
106 * Creates the accesspoint using the entered data |
|
107 * @since S60 5.0 |
|
108 * @return ETrue on success, EFalse if IAP creation was cancelled |
|
109 */ |
|
110 IMPORT_C TBool CreateAccessPointL(); |
|
111 |
|
112 |
|
113 private: |
|
114 /** |
|
115 * Makes necessary questions when creating the IAP |
|
116 * @since S60 5.0 |
|
117 */ |
|
118 void AskNetworkDetailsL(); |
|
119 |
|
120 /** |
|
121 * Prompts for the WLAN SSID in case of hidden/unlisted networks |
|
122 * @since S60 5.0 |
|
123 * @return Buffer containing the entered SSID |
|
124 */ |
|
125 HBufC* AskSsidL(); |
|
126 |
|
127 /** |
|
128 * General purpose text query |
|
129 * @since S60 5.0 |
|
130 * @param aQueryStringResource Resource id of the caption string |
|
131 * @param aVariable The buffer to put the entered data into |
|
132 * @param aMaxLength Max length of the buffer |
|
133 * @return Id of the button which dismissed the query |
|
134 */ |
|
135 TInt QueryTextL( TInt aQueryStringResource, |
|
136 TDes& aVariable, |
|
137 const TInt& aMaxLength ); |
|
138 |
|
139 /** |
|
140 * Queries the secure key |
|
141 * @since S60 5.0 |
|
142 * @return ETrue if query was accepted, EFalse on cancel |
|
143 */ |
|
144 TBool QuerySecureKeyL(); |
|
145 |
|
146 /** |
|
147 * Cleanup function for the searching for wlan waitnote |
|
148 * @since S60 5.0 |
|
149 * @param aPtr Pointer to this class |
|
150 */ |
|
151 static void DismissWaitNote( TAny* aPtr ); |
|
152 |
|
153 |
|
154 /** |
|
155 * Initializes the resource file in the given UI context |
|
156 * @since S60 5.0 |
|
157 * @param aEnv The current UI environment |
|
158 * @return Resource file offset |
|
159 */ |
|
160 static TInt InitResourcesL( CEikonEnv& aEnv ); |
|
161 |
|
162 /** |
|
163 * Frees the given resource in the current UI context |
|
164 * @since S60 5.0 |
|
165 * @param aEnv The current UI environment |
|
166 * @param aResOffset The resource to release |
|
167 */ |
|
168 static void ReleaseResources( CEikonEnv& aEnv, TInt aResOffset ); |
|
169 |
|
170 |
|
171 private: // data |
|
172 /** |
|
173 * Reference to the Eikon environment (not owned) |
|
174 */ |
|
175 CEikonEnv& iEnv; |
|
176 |
|
177 /** |
|
178 * Password for the current network (owned) |
|
179 */ |
|
180 HBufC* iUsedPassword; |
|
181 |
|
182 /** |
|
183 * In case of WEP networks it indicates whether the password is given |
|
184 * in hexadecimal format |
|
185 */ |
|
186 TBool iIsHexWep; |
|
187 |
|
188 /** |
|
189 * IAP creator object (owned) |
|
190 */ |
|
191 CWsfWlanIapCreator* iCreator; |
|
192 |
|
193 /** |
|
194 * Resource file offset |
|
195 */ |
|
196 TInt iResourceFileOffset; |
|
197 |
|
198 /** |
|
199 * Pointer to the wlaninfo of the current network (not owned) |
|
200 */ |
|
201 TWsfWlanInfo* iWlanInfo; |
|
202 |
|
203 /** |
|
204 * If ETrue, 'Define access point' was selected |
|
205 */ |
|
206 TBool iDefineNewAccessPoint; |
|
207 |
|
208 /** |
|
209 * "Searching WLAN networks" wait dialog (owned) |
|
210 */ |
|
211 CAknWaitDialog* iWaitDialog; |
|
212 |
|
213 /** |
|
214 * WLAN discovery object (owned) |
|
215 */ |
|
216 CWsfWlanSsidDiscovery* iSsidDiscovery; |
|
217 |
|
218 }; |
|
219 |
|
220 |
|
221 #endif // C_WSFWLANIAPWIZARD_H |