|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Contains the class for handling platform-specific functionality. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WLMPLATFORM_H |
|
20 #define WLMPLATFORM_H |
|
21 |
|
22 #include "wlmclientserver.h" |
|
23 #include "wlandevicesettings.h" |
|
24 #include "wlmsystemnotify.h" |
|
25 #include "wlansystemtimehandler.h" |
|
26 #include "am_platform_libraries.h" |
|
27 |
|
28 class CWlmPlatformData; |
|
29 |
|
30 /** |
|
31 * Possible values for scan types. |
|
32 */ |
|
33 enum TWLMScanType |
|
34 { |
|
35 EWLMScanNotAllowed, |
|
36 EWLMScanForcedPassive, |
|
37 EWLMScanForcedActive, |
|
38 EWLMScanAsRequested |
|
39 }; |
|
40 |
|
41 /** |
|
42 * Callback interface used by the platform-specific functionality. |
|
43 * These callbacks are implemented by the engine. |
|
44 * @lib wlmplatform.dll |
|
45 * @since Series 60 3.0 |
|
46 */ |
|
47 class MWlmPlatformCallback |
|
48 { |
|
49 public: // Methods |
|
50 |
|
51 /** |
|
52 * Get the current connection state. |
|
53 * @return Current driver state. |
|
54 */ |
|
55 virtual TWlanConnectionState GetCurrentState() = 0; |
|
56 |
|
57 /** |
|
58 * Send an indication to request data pipe disconnection. |
|
59 * |
|
60 * Calls ReleaseComplete() directly if data pipe isn't |
|
61 * connected. |
|
62 */ |
|
63 virtual void ReleaseRequest() = 0; |
|
64 |
|
65 /** |
|
66 * Enable WLAN after it has been disabled by a |
|
67 * system mode change. |
|
68 */ |
|
69 virtual void EnableWlan() = 0; |
|
70 |
|
71 /** |
|
72 * BT connection has been established. |
|
73 */ |
|
74 virtual void BtConnectionEstablished() = 0; |
|
75 |
|
76 /** |
|
77 * BT connection has been disconnected. |
|
78 */ |
|
79 virtual void BtConnectionDisabled() = 0; |
|
80 |
|
81 /** |
|
82 * System startup has been completed. |
|
83 */ |
|
84 virtual void StartupComplete() = 0; |
|
85 |
|
86 /** |
|
87 * Emergency call was done during startup and now it has completed. |
|
88 * @param aStartupCompleted Is the startup already completed |
|
89 */ |
|
90 virtual void EmergencyCallComplete( TBool aStartupCompleted ) = 0; |
|
91 |
|
92 /** |
|
93 * User has changed the time and therefore WLAN region cache information |
|
94 * is not valid anymore. |
|
95 */ |
|
96 virtual void SystemTimeChanged() = 0; |
|
97 |
|
98 /** |
|
99 * WLAN region cache is always cleared after defined time. |
|
100 */ |
|
101 virtual void ClearRegionCache() = 0; |
|
102 |
|
103 }; |
|
104 |
|
105 /** |
|
106 * Class for handling platform specific functionality. |
|
107 * @lib wlmplatform.dll |
|
108 * @since Series 60 3.0 |
|
109 */ |
|
110 NONSHARABLE_CLASS( CWlmPlatform ) : public CBase, public MWlmSystemNotify, public MWlanSystemTimeCallback |
|
111 { |
|
112 public: // Methods |
|
113 |
|
114 // Constructors and destructor |
|
115 |
|
116 /** |
|
117 * Static constructor. |
|
118 * @param aCallback Reference to the platform callback object. |
|
119 * @return Pointer to created object. |
|
120 */ |
|
121 IMPORT_C static CWlmPlatform* NewL( |
|
122 MWlmPlatformCallback& aCallback ); |
|
123 |
|
124 /** |
|
125 * Destructor. |
|
126 */ |
|
127 IMPORT_C virtual ~CWlmPlatform(); |
|
128 |
|
129 // Methods from base classes |
|
130 |
|
131 /** |
|
132 * Do all initilizations that could not |
|
133 * be done in construction phase because they require callbacks. |
|
134 */ |
|
135 IMPORT_C void Initialize(); |
|
136 |
|
137 /** |
|
138 * Get the type of scan allowed. |
|
139 * @return Type of scan allowed. |
|
140 */ |
|
141 IMPORT_C TWLMScanType GetScanType(); |
|
142 |
|
143 /** |
|
144 * Check whether WLAN is disabled. |
|
145 * @return Whether WLAN is disabled. |
|
146 */ |
|
147 IMPORT_C TBool IsWlanDisabled(); |
|
148 |
|
149 /** |
|
150 * Get the current system mode. |
|
151 * @return Current system mode. |
|
152 */ |
|
153 IMPORT_C TWlanSystemMode GetCurrentSystemMode(); |
|
154 |
|
155 /** |
|
156 * Set the status of WLAN icon on cover display. |
|
157 * @param aStatus The WLAN icon status. |
|
158 * @return A Symbian error code. |
|
159 */ |
|
160 IMPORT_C TInt SetIconState( TWlmIconStatus aStatus ); |
|
161 |
|
162 /** |
|
163 * Returns MCC of the current operator. |
|
164 * @param aCountryCode MCC. |
|
165 */ |
|
166 IMPORT_C void GetCurrentOperatorMccL( TUint& aCountryCode ); |
|
167 |
|
168 /** |
|
169 * Publishes the MAC address to other applications. |
|
170 * @param aMacAddr The MAC address. |
|
171 * @return A Symbian error code. |
|
172 */ |
|
173 IMPORT_C TInt PublishMacAddress( TMacAddress& aMacAddr ); |
|
174 |
|
175 /** |
|
176 * Start timer to get indication when user has changed the time. |
|
177 */ |
|
178 IMPORT_C void InitializeSystemTimeHandler(); |
|
179 |
|
180 protected: // Methods |
|
181 |
|
182 // Methods from base classes |
|
183 |
|
184 /** |
|
185 * (From MWlmSystemNotify) System Mode has changed. |
|
186 * @param aOldMode Old System Mode. |
|
187 * @param aNewMode New System Mode. |
|
188 */ |
|
189 void SystemModeChanged( |
|
190 TWlanSystemMode aOldMode, |
|
191 TWlanSystemMode aNewMode ); |
|
192 |
|
193 /** |
|
194 * (From MWlmSystemNotify) Emergency call has started, WLAN is forced to be enabled. |
|
195 */ |
|
196 void EmergencyCallEstablished(); |
|
197 |
|
198 /** |
|
199 * (From MWlmSystemNotify) Emergency call has ended, WLAN is not forced to be enabled anymore. |
|
200 * @param aNewMode New System Mode |
|
201 */ |
|
202 void EmergencyCallCompleted( TWlanSystemMode aNewMode ); |
|
203 |
|
204 /** |
|
205 * (From MWlmSystemNotify) BT connection has been established. |
|
206 */ |
|
207 void BtConnectionEstablished(); |
|
208 |
|
209 /** |
|
210 * (From MWlmSystemNotify) BT connection has been disconnected. |
|
211 */ |
|
212 void BtConnectionDisabled(); |
|
213 |
|
214 /** |
|
215 * (From MWlanSystemTimeCallback) |
|
216 * User has changed the time and therefore cached WLAN region is not valid anymore. |
|
217 */ |
|
218 void OnSystemTimeChange(); |
|
219 |
|
220 /** |
|
221 * (From MWlanSystemTimeCallback) |
|
222 * WLAN region cache is forced to be cleared after defined time. |
|
223 */ |
|
224 void OnCacheClearTimerExpiration(); |
|
225 |
|
226 private: //Methods |
|
227 |
|
228 /** |
|
229 * C++ default constructor. |
|
230 * @param aCallback Pointer the platform callback object. |
|
231 */ |
|
232 CWlmPlatform( MWlmPlatformCallback& aCallback ); |
|
233 |
|
234 /** |
|
235 * Symbian 2nd phase constructor. |
|
236 */ |
|
237 void ConstructL(); |
|
238 |
|
239 private: // Data |
|
240 |
|
241 /** Interface for callbacks to common functionality. */ |
|
242 MWlmPlatformCallback& iCallback; |
|
243 |
|
244 /** Current states of various system mode settings. */ |
|
245 TWlanSystemMode iCurrentSystemMode; |
|
246 |
|
247 /** Interface to PubSub/CenRep. */ |
|
248 CWlmPlatformData* iPlatformData; |
|
249 |
|
250 /** |
|
251 * Information whether WLAN connection existed before emergency call was made. |
|
252 * If WLAN connection did not exist before emergency call and WLAN connection was |
|
253 * established in Offline mode for the emergency call, then after the emergency call |
|
254 * the WLAN connection must be released. */ |
|
255 TBool iWlanConnectedBeforeEmergencyCall; |
|
256 |
|
257 /** Interface to monitor system time changes. */ |
|
258 CWlanSystemTimeHandler* iSystemTimeHandler; |
|
259 |
|
260 /** Interface to monitor when region cache needs to be cleared. */ |
|
261 CWlanPeriodicCacheClearingHandler* iPeriodicCacheClearingHandler; |
|
262 |
|
263 }; |
|
264 |
|
265 #endif // WLMPLATFORM_H |