|
1 /* |
|
2 * Copyright (c) 2006-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: cchwakeupeventnotifier declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CCHWAKEUPEVENTNOTIFIER_H |
|
20 #define C_CCHWAKEUPEVENTNOTIFIER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include <mspnotifychangeobserver.h> |
|
26 #include "cchetelnetworkstatusobserver.h" |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // Security Policy |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FUNCTION PROTOTYPES |
|
39 // None |
|
40 |
|
41 // FORWARD DECLARATIONS |
|
42 class CSPNotifyChange; |
|
43 class CCchEtelNetworkStatusNotifier; |
|
44 class MCchWakeUpEventObserver; |
|
45 class CRepository; |
|
46 // CLASS DECLARATION |
|
47 |
|
48 /** |
|
49 * CCchWakeUpEventNotifier declaration |
|
50 * The server of CCH services. |
|
51 * @lib cchserver.exe |
|
52 * @since S60 3.2 |
|
53 */ |
|
54 NONSHARABLE_CLASS( CCchWakeUpEventNotifier ) : public CActive, |
|
55 public MCchEtelNetworkStatusObserver, |
|
56 public MSPNotifyChangeObserver |
|
57 { |
|
58 public: // Constructors and destructor |
|
59 |
|
60 /** |
|
61 * Two-phased constructor. |
|
62 */ |
|
63 static CCchWakeUpEventNotifier* NewL( |
|
64 MCchWakeUpEventObserver& aWakeUpEventObserver ); |
|
65 |
|
66 /** |
|
67 * Two-phased constructor. |
|
68 */ |
|
69 static CCchWakeUpEventNotifier* NewLC( |
|
70 MCchWakeUpEventObserver& aWakeUpEventObserver ); |
|
71 |
|
72 /** |
|
73 * Destructor. |
|
74 */ |
|
75 virtual ~CCchWakeUpEventNotifier(); |
|
76 |
|
77 public: // New functions |
|
78 |
|
79 /** |
|
80 * Starts observering change events. |
|
81 */ |
|
82 void StartL(); |
|
83 |
|
84 /** |
|
85 * Stops observering change events. |
|
86 */ |
|
87 void Stop(); |
|
88 |
|
89 private: |
|
90 |
|
91 /** |
|
92 * Starts offline timer |
|
93 * @param aFunction The function to call after the time out |
|
94 */ |
|
95 void StartOfflineTimer( TInt (*aFunction)(TAny* aPtr) ); |
|
96 |
|
97 /** |
|
98 * Cancels the offline timer |
|
99 */ |
|
100 void CancelOfflineTimer(); |
|
101 |
|
102 /** |
|
103 * Offline tiemout callback |
|
104 * @param aSelf this object |
|
105 */ |
|
106 static TInt OfflineTimeout( TAny* aSelf ); |
|
107 |
|
108 /** |
|
109 * Handles offline timeout |
|
110 */ |
|
111 void HandleOfflineTimeout(); |
|
112 |
|
113 public: // From CActive |
|
114 |
|
115 /** |
|
116 * Implements cancellation of an outstanding request. |
|
117 * @see CActive::Cancel |
|
118 */ |
|
119 virtual void DoCancel(); |
|
120 |
|
121 |
|
122 /** |
|
123 * Handles an active object's request completion event. |
|
124 */ |
|
125 virtual void RunL(); |
|
126 |
|
127 /** |
|
128 * Handles leaving of RunL. |
|
129 */ |
|
130 virtual TInt RunError( TInt aError ); |
|
131 |
|
132 |
|
133 public: // From MCchEtelNetworkStatusObserver |
|
134 |
|
135 /** |
|
136 * This is a callback function which is called when CS |
|
137 * has gone out of coverage |
|
138 */ |
|
139 virtual void MobileNetworkNoService( ); |
|
140 |
|
141 public: // From MSPNotifyChangeObserver |
|
142 |
|
143 /** |
|
144 * Handle notify change event |
|
145 * |
|
146 * @param aServiceId the service ID of added/changed/deleted service |
|
147 * @since S60 3.2 |
|
148 */ |
|
149 virtual void HandleNotifyChange( TServiceId aServiceId ); |
|
150 |
|
151 /** |
|
152 * Handle error |
|
153 * |
|
154 * @param aError error code |
|
155 * @since S60 3.2 |
|
156 */ |
|
157 virtual void HandleError( TInt aError ); |
|
158 |
|
159 private: |
|
160 |
|
161 /** |
|
162 * C++ default constructor. |
|
163 */ |
|
164 CCchWakeUpEventNotifier( MCchWakeUpEventObserver& aWakeUpEventObserver ); |
|
165 |
|
166 /** |
|
167 * By default Symbian 2nd phase constructor is private. |
|
168 */ |
|
169 void ConstructL(); |
|
170 |
|
171 |
|
172 private: // data |
|
173 |
|
174 // Observer of wake up events |
|
175 MCchWakeUpEventObserver& iWakeUpEventObserver; |
|
176 |
|
177 // Change notifer of spsettings |
|
178 CSPNotifyChange* iSPSNotifier; |
|
179 |
|
180 // Mobile network notifer |
|
181 CCchEtelNetworkStatusNotifier* iCchEtelNetworkNotifier; |
|
182 |
|
183 // Repository for monitoring offline mode |
|
184 CRepository* iOfflineRepository; |
|
185 |
|
186 // Are we in state that network connection is allowed |
|
187 TInt iNetworkConnectionAllowed; |
|
188 |
|
189 // Indicates is change events observation started. |
|
190 TBool iObservationOngoing; |
|
191 |
|
192 // Offline timer. Owned. |
|
193 CPeriodic* iOfflineTimer; |
|
194 }; |
|
195 |
|
196 #endif // C_CCHWAKEUPEVENTNOTIFIER_H |
|
197 |
|
198 // End of file |