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 TWsfMainController |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef T_WSFMAINCONTROLLER_H |
|
19 #define T_WSFMAINCONTROLLER_H |
|
20 |
|
21 // EXTERNAL INCLUDES |
|
22 #include <e32def.h> |
|
23 |
|
24 // INTERNAL INCLUDES |
|
25 #include "wsfmainuiobserver.h" |
|
26 #include "wsfmodelobserver.h" |
|
27 #include "wsfmainviewpartner.h" |
|
28 #include "wsfstatechangeobserver.h" |
|
29 #include "wsfdetailsviewpartner.h" |
|
30 #include "wsfwlaninfo.h" |
|
31 |
|
32 |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CWsfAppUi; |
|
36 class CWsfModel; |
|
37 class MWsfMainViewControllerIf; |
|
38 class MWsfDetailsViewControllerIf; |
|
39 class CWsfWlanInfoArray; |
|
40 class CWsfWlanInfoArrayVisitor; |
|
41 |
|
42 // CLASS DEFINITION |
|
43 /** |
|
44 * The main control class of the component. It is responsible for all |
|
45 * the WLAN related functionalities. |
|
46 * @since S60 v5.0 |
|
47 */ |
|
48 class TWsfMainController: public MWsfMainUiObserver, |
|
49 public MWsfModelObserver, |
|
50 public MWsfMainViewPartner, |
|
51 public MWsfDetailsViewPartner, |
|
52 public MWsfStateChangeObserver |
|
53 { |
|
54 public: // New methods |
|
55 |
|
56 /** |
|
57 * PreInitialization for this class |
|
58 * @since S60 5.0 |
|
59 * @param aAppUi reference for the AppUI |
|
60 * @param aModel reference for the Model |
|
61 * @param aWlanInfoBranding reference for the WlanInfoArrayVisitor |
|
62 */ |
|
63 void Initialize( CWsfAppUi& aAppUi, |
|
64 CWsfModel& aModel, |
|
65 CWsfWlanInfoArrayVisitor& aWlanInfoBranding ); |
|
66 |
|
67 /** |
|
68 * Updating the active View |
|
69 * @since S60 5.0 |
|
70 */ |
|
71 void UpdateViewL(); |
|
72 |
|
73 /** |
|
74 * Updating the active View |
|
75 * @since S60 5.0 |
|
76 * @param aInfoArray - Current Wlan Array |
|
77 */ |
|
78 void UpdateViewL( CWsfWlanInfoArray* aInfoArray ); |
|
79 |
|
80 public: //From MWsfMainUiObserver |
|
81 |
|
82 /** |
|
83 * Activate (Switch back to) the Main View |
|
84 * @since S60 5.0 |
|
85 */ |
|
86 void ShowWlanListL(); |
|
87 |
|
88 /** |
|
89 * Incialize Main View |
|
90 * @since S60 5.0 |
|
91 */ |
|
92 void MainViewCreatedL(); |
|
93 |
|
94 /** |
|
95 * Sarts the Borwser |
|
96 * @since S60 5.0 |
|
97 */ |
|
98 void StartBrowsingL(); |
|
99 |
|
100 /** |
|
101 * Continues browsing (browser launched if needed) |
|
102 * @since S60 5.0 |
|
103 */ |
|
104 void ContinueBrowsingL(); |
|
105 |
|
106 /** |
|
107 * Connect to an IAP and create a WLAN connection |
|
108 * @since S60 5.0 |
|
109 */ |
|
110 void ConnectL(); |
|
111 |
|
112 /** |
|
113 * Disconnect a connection |
|
114 * @since S60 5.0 |
|
115 */ |
|
116 void DisconnectL(); |
|
117 |
|
118 /** |
|
119 * Start a refresh scanning |
|
120 * @since S60 5.0 |
|
121 */ |
|
122 void RefreshL(); |
|
123 |
|
124 /** |
|
125 * Start to display the diteils view of the selected connection |
|
126 * @since S60 5.0 |
|
127 */ |
|
128 void ShowDetailsL(); |
|
129 |
|
130 /** |
|
131 * Create an Access Point |
|
132 * @since S60 5.0 |
|
133 */ |
|
134 void CreateAccessPointL(); |
|
135 |
|
136 /** |
|
137 * Used in AppUi side to check if the |
|
138 * wait dialog should be shown |
|
139 * @since S60 5.0 |
|
140 * @return ETrue if first refreshing |
|
141 */ |
|
142 TBool EngineRefreshing(); |
|
143 |
|
144 /** |
|
145 * Callback function, when the Sniffer started |
|
146 * @since S60 5.0 |
|
147 */ |
|
148 void AppLaunchCompleteL(); |
|
149 |
|
150 /** |
|
151 * Enable Scanning |
|
152 * @since S60 5.0 |
|
153 */ |
|
154 void AppSwitchedForegroundL(); |
|
155 |
|
156 /** |
|
157 * Disable Scanning |
|
158 * @since S60 5.0 |
|
159 */ |
|
160 void AppSwitchedBackgroundL(); |
|
161 |
|
162 /** |
|
163 * Displays the "Filter out Wlan" dialog |
|
164 * @since S60 5.0 |
|
165 */ |
|
166 void EditBlackListItemsL(); |
|
167 |
|
168 |
|
169 public: //From MWsfModelObserver |
|
170 |
|
171 /** |
|
172 * Called if the launch has been completed successfully |
|
173 * @since S60 5.0 |
|
174 */ |
|
175 void BrowserLaunchCompleteL(); |
|
176 |
|
177 /** |
|
178 * Called if the browser launch failed for some reason |
|
179 * @since S60 5.0 |
|
180 * @param aError error code |
|
181 */ |
|
182 void BrowserLaunchFailed( TInt aError ); |
|
183 |
|
184 /** |
|
185 * Called when the previously launched browser exits |
|
186 * @since S60 5.0 |
|
187 */ |
|
188 void BrowserExitL(); |
|
189 |
|
190 /** |
|
191 * Notification that connection is going to be created |
|
192 * @since S60 5.0 |
|
193 * @param aIapId The IAP id of the connection being created |
|
194 */ |
|
195 void ConnectingL( TUint32 aIapId ); |
|
196 |
|
197 /** |
|
198 * Notification that the connection creation process ended |
|
199 * @since S60 5.0 |
|
200 * @param aResult The result of the connection creation |
|
201 */ |
|
202 void ConnectingFinishedL( TInt aResult ); |
|
203 |
|
204 |
|
205 public: //From MWsfMainViewPartner |
|
206 |
|
207 /** |
|
208 * Mainview request to show manubar |
|
209 * @since S60 5.0 |
|
210 */ |
|
211 void ShowMenuBarL(); |
|
212 |
|
213 public: //From MWsfDetailsViewPartner |
|
214 |
|
215 /** |
|
216 * Detailsview requests to close view |
|
217 * @since S60 5.0 |
|
218 */ |
|
219 void CloseDetailsViewL(); |
|
220 |
|
221 /** |
|
222 * Refresh scanning |
|
223 */ |
|
224 void DetailsScanL(); |
|
225 |
|
226 public: // From MWsfStateChangeObserver |
|
227 |
|
228 /** |
|
229 * The current wlan data has changed and it is ready to be retrieved |
|
230 * @since S60 5.0 |
|
231 */ |
|
232 void WlanListChangedL(); |
|
233 |
|
234 /** |
|
235 * Engine error occured |
|
236 * @since S60 5.0 |
|
237 * @param aError System wide error code |
|
238 */ |
|
239 void NotifyEngineError( TInt aError ); |
|
240 |
|
241 /** |
|
242 * Scanning has been disabled |
|
243 * @since S60 5.0 |
|
244 */ |
|
245 void ScanDisabledL(); |
|
246 |
|
247 /** |
|
248 * Scanning has been enabled |
|
249 * @since S60 5.0 |
|
250 */ |
|
251 void ScanEnabledL(); |
|
252 |
|
253 /** |
|
254 * A WLAN connection has been established |
|
255 * @since S60 5.0 |
|
256 */ |
|
257 void WlanConnectionActivatedL(); |
|
258 |
|
259 /** |
|
260 * A WLAN connection has been closed |
|
261 * @since S60 5.0 |
|
262 */ |
|
263 void WlanConnectionClosedL(); |
|
264 |
|
265 /** |
|
266 * Connection creation process finished |
|
267 * @since S60 5.2 |
|
268 * @param aError System wide error code |
|
269 */ |
|
270 void ConnectionCreationProcessFinishedL( TInt aError ); |
|
271 |
|
272 private: |
|
273 |
|
274 /** |
|
275 * Cleanup function to release the key events suppressing |
|
276 * @since S60 5.0 |
|
277 * @param aPtr Pointer for this class |
|
278 */ |
|
279 static void ReleaseSuppressingKeyEvents( TAny* aPtr ); |
|
280 |
|
281 /** |
|
282 * Cleanup function to restore refresh state |
|
283 * @since S60 5.2 |
|
284 * @param aPtr Pointer for this class |
|
285 */ |
|
286 static void RestoreRefreshState( TAny* aPtr ); |
|
287 |
|
288 /** |
|
289 * Updates iap id to wlan list |
|
290 * @since S60 5.2 |
|
291 * @param aInfo reference of TWsfWlanInfo class |
|
292 */ |
|
293 void UpdateIapIdToInfoArrayL( TWsfWlanInfo & aInfo ); |
|
294 |
|
295 private: // Data |
|
296 |
|
297 /** |
|
298 * Reference to AppUi |
|
299 */ |
|
300 CWsfAppUi* iAppUi; |
|
301 |
|
302 /** |
|
303 * Reference to Model |
|
304 */ |
|
305 CWsfModel* iModel; |
|
306 |
|
307 /** |
|
308 * Reference to Main View |
|
309 */ |
|
310 MWsfMainViewControllerIf* iMainView; |
|
311 |
|
312 /** |
|
313 * Reference to WlanInfoArrayVisitor |
|
314 */ |
|
315 CWsfWlanInfoArrayVisitor* iWlanInfoBranding; |
|
316 |
|
317 /** |
|
318 * Reference to Deatils View |
|
319 */ |
|
320 MWsfDetailsViewControllerIf* iDetailsView; |
|
321 |
|
322 /** |
|
323 * Reference to WlanInfoArray |
|
324 */ |
|
325 CWsfWlanInfoArray* iInfoArray; |
|
326 |
|
327 }; |
|
328 |
|
329 |
|
330 #endif // T_WSFMAINCONTROLLER_H |
|
331 |
|
332 // End of file |
|