|
1 /* |
|
2 * Copyright (c) 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 the License "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WLANOBSERVER_H |
|
20 #define WLANOBSERVER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32property.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MApiProvider; |
|
28 |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // State enum and member variable |
|
33 |
|
34 // CLASS DECLARATIONS |
|
35 /** |
|
36 * CWlanObserver. |
|
37 * Observer class for handling wlan status requests |
|
38 * @since S60 v5.0 |
|
39 */ |
|
40 class CWlanObserver : public CActive |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 |
|
44 /** |
|
45 * Constructor. |
|
46 * @param aApiProvider Reference to API provider |
|
47 */ |
|
48 CWlanObserver(MApiProvider& aApiProvider); |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CWlanObserver(); |
|
54 |
|
55 /** |
|
56 * Retrieves current state of wireless lan connection |
|
57 * @param aWlanStateValue reference to current Wlan state value which is updated here |
|
58 * @return: EFalse if error condition (ignore aWlanStateValue in this case) |
|
59 * Etrue if no error (get updated value from aWlanStateValue) |
|
60 */ |
|
61 TBool GetCurrentState(TInt &aWlanStateValue); |
|
62 |
|
63 protected: // CActive |
|
64 |
|
65 /** |
|
66 * Implements cancellation of an outstanding request. |
|
67 * @param none |
|
68 * @return void |
|
69 */ |
|
70 void DoCancel(); |
|
71 |
|
72 /** |
|
73 * Handles an active object’s request completion event. |
|
74 * @param none |
|
75 * @return void |
|
76 */ |
|
77 void RunL(); |
|
78 |
|
79 /** |
|
80 * Handles an active object’s error |
|
81 * @param error |
|
82 * @return void |
|
83 */ |
|
84 TInt RunError(TInt aError); |
|
85 |
|
86 private: // new methods |
|
87 |
|
88 MApiProvider& iApiProvider; // Api provider |
|
89 |
|
90 RProperty iWlanProperty; |
|
91 |
|
92 |
|
93 }; |
|
94 |
|
95 #endif // WLANOBSERVER_H |
|
96 |
|
97 // End of File |