|
1 /* |
|
2 * Copyright (c) 2006-2009 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: CCchUIHandler declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CCHUIHANDLER_H |
|
20 #define C_CCHUIHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 #include <e32base.h> |
|
25 #include "cchetelnetworkstatusobserver.h" |
|
26 #include "cchfeaturemanager.h" |
|
27 // CONSTANTS |
|
28 // None |
|
29 |
|
30 // MACROS |
|
31 // None |
|
32 |
|
33 // DATA TYPES |
|
34 // None |
|
35 |
|
36 // FUNCTION PROTOTYPES |
|
37 // None |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CCCHServiceHandler; |
|
41 class CCCHServerBase; |
|
42 class CRepository; |
|
43 class CCchNoteHandler; |
|
44 class CCchEtelNetworkStatusNotifier; |
|
45 class MCchEtelNetworkStatusObserver; |
|
46 |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * CCchUIHandler declaration |
|
51 * Displays handles CCH's UI, emergency notes, small icons |
|
52 * @lib cchserver.exe |
|
53 * @since S60 3.2 |
|
54 */ |
|
55 class CCchUIHandler : public CActive, |
|
56 public MCchEtelNetworkStatusObserver |
|
57 { |
|
58 |
|
59 public: // Constructors and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 */ |
|
64 static CCchUIHandler* NewL( |
|
65 CCCHServerBase& aServer, |
|
66 CCCHServiceHandler& aCCchServiceHandler ); |
|
67 |
|
68 /** |
|
69 * Two-phased constructor. |
|
70 */ |
|
71 static CCchUIHandler* NewLC( |
|
72 CCCHServerBase& aServer, |
|
73 CCCHServiceHandler& aCCchServiceHandler ); |
|
74 |
|
75 /** |
|
76 * Destructor. |
|
77 */ |
|
78 virtual ~CCchUIHandler(); |
|
79 |
|
80 public: // New functions |
|
81 |
|
82 /** |
|
83 * shows emergency warning note. |
|
84 * @param: TInt |
|
85 * @return void |
|
86 */ |
|
87 void ShowEmergencyWarningNoteL( TBool aVoIPEnabledFirstTime ); |
|
88 |
|
89 /** |
|
90 * Updates the user interface (e.g. voip small icon) |
|
91 * @param: TInt |
|
92 * @return void |
|
93 */ |
|
94 void UpdateUI( ); |
|
95 |
|
96 /** |
|
97 * Checks gprs first usage. If used first time shows |
|
98 * gprs roaming cost warning note. |
|
99 * @return void |
|
100 */ |
|
101 void CheckGprsFirstUsageL(); |
|
102 |
|
103 /** |
|
104 * Return network connections allowed status. |
|
105 * @return ETrue if network connections are allowed |
|
106 */ |
|
107 TBool NetworkConnectionsAllowed() const; |
|
108 |
|
109 /** |
|
110 * Waits one second to give enought time to end async requests |
|
111 */ |
|
112 void Destroy(); |
|
113 |
|
114 public: // From MCchEtelNetworkStatusObserver |
|
115 |
|
116 /** |
|
117 * This is a callback function which is called when CS |
|
118 * has gone out of coverage |
|
119 */ |
|
120 void MobileNetworkNoService( ); |
|
121 |
|
122 /** |
|
123 Implements cancellation of an outstanding request. |
|
124 @see CActive::Cancel |
|
125 */ |
|
126 virtual void DoCancel(); |
|
127 |
|
128 |
|
129 /** |
|
130 Handles an active object's request completion event. |
|
131 */ |
|
132 virtual void RunL(); |
|
133 |
|
134 /** |
|
135 Handles leaving of RunL. |
|
136 */ |
|
137 virtual TInt RunError(TInt aError); |
|
138 |
|
139 private: |
|
140 |
|
141 /** |
|
142 * By default Symbian 2nd phase constructor is private. |
|
143 */ |
|
144 void ConstructL(); |
|
145 |
|
146 /** |
|
147 * C++ default constructor. |
|
148 */ |
|
149 CCchUIHandler( |
|
150 CCCHServerBase& aServer, |
|
151 CCCHServiceHandler& aCCchServiceHandler ); |
|
152 |
|
153 /** |
|
154 * Sets the indicator's aIndicator state to state aState. |
|
155 * @param TInt aIndicator |
|
156 * @param TInt aState |
|
157 * @return void |
|
158 */ |
|
159 void SetIndicatorStateL( TInt aIndicator, TInt aState ) const; |
|
160 |
|
161 /** |
|
162 * Called when VoIP status is changed |
|
163 * @param aStatus for VoIP status |
|
164 */ |
|
165 void HandleVoipStateChanged( TBool aStatus ); |
|
166 |
|
167 /** |
|
168 * Called (from HandleVoipStateChanged) when VoIP status is changed |
|
169 * @param aStatus for VoIP status |
|
170 */ |
|
171 void HandleVoipStateChangedL( TBool aStatus ); |
|
172 |
|
173 /** |
|
174 * Checks offline status from KCRUidCoreApplicationUIs cenrep |
|
175 * and starts to monitor changes in offline status |
|
176 */ |
|
177 void MonitorOfflineStatusL(); |
|
178 |
|
179 private: // data |
|
180 |
|
181 /** |
|
182 * Handle to server |
|
183 */ |
|
184 CCCHServerBase& iServer; |
|
185 |
|
186 /** |
|
187 * Handle to service handler |
|
188 */ |
|
189 CCCHServiceHandler& iCCchServiceHandler; |
|
190 |
|
191 /** |
|
192 * Note handler |
|
193 */ |
|
194 CCchNoteHandler* iNoteHandler; |
|
195 |
|
196 /** |
|
197 * Are we out of cs network? |
|
198 */ |
|
199 TBool iVoIPEmergencyNoteState; |
|
200 |
|
201 /** |
|
202 * ETel observer |
|
203 */ |
|
204 CCchEtelNetworkStatusNotifier* iCchEtelNetworkStatusNotifier; |
|
205 |
|
206 /** |
|
207 * Are we showing the VoIP small indicator? |
|
208 */ |
|
209 TBool iVoIPSmallIndicatorShown; |
|
210 |
|
211 /** |
|
212 * Cch's repository |
|
213 */ |
|
214 CRepository* iCchRepository; |
|
215 |
|
216 /** |
|
217 * Repository for monitoring offline mode |
|
218 */ |
|
219 CRepository* iOfflineRepository; |
|
220 |
|
221 /** |
|
222 * is the connection allowed |
|
223 */ |
|
224 TInt iNetworkConnectionAllowed; |
|
225 |
|
226 /** |
|
227 * Reference to RTimer |
|
228 */ |
|
229 RTimer iTimer; |
|
230 |
|
231 /** |
|
232 * Should I commit suicide |
|
233 */ |
|
234 TBool iDie; |
|
235 }; |
|
236 |
|
237 #endif // C_CCHUIHANDLER_H |
|
238 |
|
239 // End of file |