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 CWsfAiPlugin |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_WSFAIPLUGIN_H |
|
20 #define C_WSFAIPLUGIN_H |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <hscontentpublisher.h> |
|
24 #include <e32cmn.h> |
|
25 #include <eikenv.h> |
|
26 |
|
27 // INTERNAL INCLUDES |
|
28 #include "wsfaicontroller.h" |
|
29 #include "wsfaipublishobserver.h" |
|
30 #include "wsfaiplugincontentmodel.h" |
|
31 |
|
32 // CONSTANTS |
|
33 LOCAL_D const TInt KDeferredWaitTime = 1000 * 1000; |
|
34 // one second in milliseconds |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 class MAiPluginSettings; |
|
38 class MAiContentObserver; |
|
39 class MAiContentItemIterator; |
|
40 |
|
41 class CWsfModel; |
|
42 class CWsfAiModel; |
|
43 class CWsfAiView; |
|
44 class CAknIconArray; |
|
45 class CGulIcon; |
|
46 class CWsfDbObserver; |
|
47 |
|
48 |
|
49 // CLASS DECLARATION |
|
50 |
|
51 /** |
|
52 * The main class, containing the plugin behavior. |
|
53 * |
|
54 * @lib wsfaiplugin.lib |
|
55 * @since S60 v5.0 |
|
56 */ |
|
57 NONSHARABLE_CLASS( CWsfAiPlugin ): public CHsContentPublisher, |
|
58 public MWsfAiPublishObserver |
|
59 { |
|
60 public: // Constructors and destructor |
|
61 |
|
62 /** |
|
63 * Two-phased constructor |
|
64 * @since S60 5.0 |
|
65 * @return instance of CWsfAiPlugin class |
|
66 */ |
|
67 static CWsfAiPlugin* NewL(); |
|
68 |
|
69 /** |
|
70 * Destructor of CWsfAiPlugin class |
|
71 * @since S60 5.0 |
|
72 */ |
|
73 virtual ~CWsfAiPlugin(); |
|
74 |
|
75 private:// Constructors |
|
76 |
|
77 /** |
|
78 * Default C++ constructor |
|
79 * @since S60 5.0 |
|
80 */ |
|
81 CWsfAiPlugin(); |
|
82 |
|
83 /** |
|
84 * 2nd phase constructor |
|
85 * @since S60 5.0 |
|
86 */ |
|
87 void ConstructL(); |
|
88 |
|
89 /** |
|
90 * Steps |
|
91 * @param ptr Pointer to an instance of this class |
|
92 */ |
|
93 static TInt DoRefreshingStepL( TAny* ptr ); |
|
94 |
|
95 /** |
|
96 * Steps the refresh animation |
|
97 */ |
|
98 void DoRefreshingStepL(); |
|
99 |
|
100 /** |
|
101 * Steps |
|
102 * @param ptr Pointer to an instance of this class |
|
103 */ |
|
104 static TInt DoConnectingStepL( TAny* ptr ); |
|
105 |
|
106 /** |
|
107 * Steps the refresh animation |
|
108 */ |
|
109 void DoConnectingStepL(); |
|
110 |
|
111 public: // from CHSContentPublisher |
|
112 |
|
113 /** |
|
114 * @see CHsContentPublisher |
|
115 */ |
|
116 void Start( TStartReason aReason ); |
|
117 |
|
118 /** |
|
119 * @see CHsContentPublisher |
|
120 */ |
|
121 void Stop( TStopReason aReason ); |
|
122 |
|
123 /** |
|
124 * @see CHsContentPublisher |
|
125 */ |
|
126 void Resume( TResumeReason aReason ); |
|
127 |
|
128 /** |
|
129 * @see CHsContentPublisher |
|
130 */ |
|
131 void Suspend( TSuspendReason aReason ); |
|
132 |
|
133 /** |
|
134 * @see CHsContentPublisher |
|
135 */ |
|
136 void SubscribeL( MAiContentObserver& aObserver ); |
|
137 |
|
138 /** |
|
139 * @see CHsContentPublisher |
|
140 */ |
|
141 void ConfigureL( RAiSettingsItemArray& aSettings ); |
|
142 |
|
143 /** |
|
144 * @see CHsContentPublisher |
|
145 */ |
|
146 TAny* GetProperty( TProperty aProperty ); |
|
147 |
|
148 /** |
|
149 * @see CHsContentPublisher |
|
150 */ |
|
151 void HandleEvent( TInt aEvent, const TDesC& aParam ); |
|
152 |
|
153 |
|
154 public: // From MWsfAiPublishObserver |
|
155 |
|
156 /** |
|
157 * Publishes images from array and text |
|
158 * @since S60 5.0 |
|
159 * @param aPublishIconArray the published icons |
|
160 * @param aText1 title text label |
|
161 */ |
|
162 void PublishContentL( CArrayFix<TInt>* aPublishIconArray, |
|
163 CEikLabel* aText1 ); |
|
164 |
|
165 /** |
|
166 * Sets Scanning status on/off. |
|
167 * @since S60 5.0 |
|
168 * @param aScanState Scanning satus flag |
|
169 */ |
|
170 void SetScanningState( TBool aScanState ); |
|
171 |
|
172 /** |
|
173 * Sets refreshing status on/off. |
|
174 * @since S60 5.0 |
|
175 * @param aScanState Refreshing status flag |
|
176 */ |
|
177 void SetRefreshingL( TBool aRefreshing ); |
|
178 |
|
179 /** |
|
180 * Set connecting status on. |
|
181 * @since S60 5.0 |
|
182 */ |
|
183 void StartConnectingL(); |
|
184 |
|
185 /** |
|
186 * Publishes just status image from array |
|
187 * @since S60 5.0 |
|
188 * @param aPublishIconArray the published icons |
|
189 * @param aText1 title text label |
|
190 */ |
|
191 void PublishStatusIconL( CArrayFix<TInt>* aPublishIconArray, |
|
192 CEikLabel* aText1 ); |
|
193 |
|
194 private: |
|
195 |
|
196 /** |
|
197 * Allocates Engine, Model and functional UI for plugin |
|
198 */ |
|
199 void AllocateResourcesL(); |
|
200 |
|
201 /** |
|
202 * Unpublishes (clears) all plugin content from AI2 view |
|
203 */ |
|
204 void ClearL(); |
|
205 |
|
206 /** |
|
207 * Launch WLAN Wizard application |
|
208 */ |
|
209 void LaunchApplicationL(); |
|
210 |
|
211 /** |
|
212 * Set the value of Middle Soft Key based on the |
|
213 * Scanning status of the WLAN Wizard |
|
214 */ |
|
215 void SetMskL(); |
|
216 |
|
217 /** |
|
218 * Publish the given text |
|
219 * @param aObserver - pointer to the observer |
|
220 * @param aContentId - content ID |
|
221 * @param aText1 - title text label |
|
222 * @return ETrue - if it can be published |
|
223 * EFalse - if it can not be published |
|
224 */ |
|
225 TBool PublishText( MAiContentObserver* aObserver, |
|
226 TWsfAiWizardContentIds aContentId, |
|
227 const TDesC16& aText ); |
|
228 |
|
229 /** |
|
230 * Publish the given icon |
|
231 * @param aObserver - pointer to the observer |
|
232 * @param aContentId - content ID |
|
233 * @param aIconId - icon ID |
|
234 * @return ETrue - if it can be published |
|
235 * EFalse - if it can not be published |
|
236 */ |
|
237 TBool PublishIconL( MAiContentObserver* aObserver, |
|
238 TWsfAiWizardContentIds aContentId, |
|
239 TInt aIconId ); |
|
240 |
|
241 /** |
|
242 * Cleanup function to to cancel publish transaction |
|
243 * @since S60 5.0 |
|
244 * @param aPtr Pointer for the observer class |
|
245 */ |
|
246 static void PublishCleanup( TAny* aPtr ); |
|
247 |
|
248 |
|
249 private: // Data |
|
250 |
|
251 /** |
|
252 * Handle to Eikon environment. |
|
253 */ |
|
254 CEikonEnv* iEnv; |
|
255 |
|
256 /** |
|
257 * Array of content observers |
|
258 */ |
|
259 RPointerArray<MAiContentObserver> iObservers; |
|
260 |
|
261 /** |
|
262 * Iterator for plugin content |
|
263 * Own. |
|
264 */ |
|
265 MAiContentItemIterator* iContent; |
|
266 |
|
267 /** |
|
268 * Iterator for plugin resources |
|
269 * Own. |
|
270 */ |
|
271 MAiContentItemIterator* iResources; |
|
272 |
|
273 /** |
|
274 * Iterator for plugin events |
|
275 * Own. |
|
276 */ |
|
277 MAiContentItemIterator* iEvents; |
|
278 |
|
279 /** |
|
280 * Pointer to CWsfModel |
|
281 * Own. |
|
282 */ |
|
283 CWsfModel* iModel; |
|
284 |
|
285 /** |
|
286 * Pointer to AI Model |
|
287 * Own. |
|
288 */ |
|
289 CWsfAiModel* iAiModel; |
|
290 |
|
291 /** |
|
292 * AI Controller |
|
293 * Own. |
|
294 */ |
|
295 TWsfAiController iController; |
|
296 |
|
297 /** |
|
298 * Pointer to CWsfAiView |
|
299 * Own. |
|
300 */ |
|
301 CWsfAiView* iUi; |
|
302 |
|
303 /** |
|
304 * The database observer observing changes in |
|
305 * show WLAN availablity |
|
306 */ |
|
307 CWsfDbObserver* iDbObserver; |
|
308 |
|
309 /** |
|
310 * The resource file offset |
|
311 */ |
|
312 TInt iResourceFileOffset; |
|
313 |
|
314 /** |
|
315 * Constants for MSK activate text |
|
316 * Own. |
|
317 */ |
|
318 HBufC* iMskActivate; |
|
319 |
|
320 /** |
|
321 * Scanning status flag |
|
322 */ |
|
323 TBool iScanState; |
|
324 |
|
325 /** |
|
326 * Flag for focus of information area |
|
327 */ |
|
328 TBool iInfoAreaFocus; |
|
329 |
|
330 /** |
|
331 * The current observer item index |
|
332 */ |
|
333 TInt iCurrentObserverIndex; |
|
334 |
|
335 /** |
|
336 * The current refreshing state |
|
337 */ |
|
338 TBool iRefreshing; |
|
339 |
|
340 /* |
|
341 * The periodic that steps the refreshing animation |
|
342 */ |
|
343 CPeriodic* iAnimationPeriodic; |
|
344 |
|
345 /** |
|
346 * Constants for 'Connected to:' text |
|
347 * Own. |
|
348 */ |
|
349 HBufC* iConnectedTo; |
|
350 |
|
351 /** |
|
352 * Constants for 'Known network found:' text |
|
353 * Own. |
|
354 */ |
|
355 HBufC* iKnownNetworkFound; |
|
356 |
|
357 /** |
|
358 * A pointer to CWsfActiveWrappers |
|
359 */ |
|
360 CWsfActiveWrappers* iActiveWrappers; |
|
361 |
|
362 /** |
|
363 * Flag to publish network status text |
|
364 */ |
|
365 TBool iPublishNetworkStatusText; |
|
366 |
|
367 }; |
|
368 |
|
369 |
|
370 #endif // C_WSFAIPLUGIN_H |
|
371 |
|
372 // End of File. |
|