1 /* |
|
2 * Copyright (c) 2008-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: Notifier base class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CCHUINOTIFIER_H |
|
21 #define C_CCHUINOTIFIER_H |
|
22 |
|
23 #include <eikenv.h> |
|
24 #include <eiknotapi.h> |
|
25 #include <data_caging_path_literals.hrh> |
|
26 #include <AknNotiferAppServerApplication.h> |
|
27 |
|
28 #include "cchuicommon.hrh" |
|
29 |
|
30 class CSPSettings; |
|
31 class CAknQueryDialog; |
|
32 class CAknTextQueryDialog; |
|
33 |
|
34 /** |
|
35 * Defines base class for notifier implementation(s). |
|
36 * Provides implementation that is common for all notifier |
|
37 * implementation. |
|
38 * |
|
39 * @code |
|
40 * @endcode |
|
41 * |
|
42 * @lib cchuinotif.lib |
|
43 * @since S60 5.0 |
|
44 */ |
|
45 NONSHARABLE_CLASS( CCCHUiNotifierBase ): |
|
46 public CActive, public MEikSrvNotifierBase2 |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 virtual ~CCCHUiNotifierBase(); |
|
54 |
|
55 protected: |
|
56 |
|
57 CCCHUiNotifierBase(); |
|
58 |
|
59 virtual void ConstructL(); |
|
60 |
|
61 /** |
|
62 * Complete Client/Server message and Nulled the reply slot. |
|
63 * |
|
64 * @since S60 5.0 |
|
65 * @param aErr Error code for client notification. |
|
66 */ |
|
67 void CompleteMessage( TInt aErr ); |
|
68 |
|
69 /** |
|
70 * Scans for resource file. Ownership of returned value |
|
71 * is passed. |
|
72 * |
|
73 * @since S60 5.0 |
|
74 * @param aSession file server session |
|
75 * @param aFileName file name |
|
76 * @param aFilePath file path |
|
77 * @return resource file path and name |
|
78 */ |
|
79 HBufC* ScanFileL( |
|
80 RFs& aSession, |
|
81 const TDesC& aFileName, |
|
82 const TDesC& aFilePath ); |
|
83 |
|
84 /** |
|
85 * Resolves service name. |
|
86 * |
|
87 * @since S60 5.0 |
|
88 * @param aServiceId service id |
|
89 * @param aServiceName resolved service name |
|
90 */ |
|
91 void GetServiceNameL( TUint aServiceId, TDes& aServiceName ); |
|
92 |
|
93 /** |
|
94 * Get current connections name. |
|
95 * |
|
96 * @since S60 5.0 |
|
97 * @param aServiceId service id |
|
98 * @param aIapId iap id |
|
99 * @param aIapName iap name to be stored to this |
|
100 */ |
|
101 void CurrentConnectionNameL( |
|
102 TUint aServiceId, |
|
103 TUint aIapid, |
|
104 RBuf& aIapName ); |
|
105 |
|
106 /** |
|
107 * Resolves if service is SIP/VoIP. |
|
108 * |
|
109 * @since S60 5.0 |
|
110 * @param aServiceId service id |
|
111 * @return ETrue if service is SIP/VoIP |
|
112 */ |
|
113 TBool IsSIPVoIPL( TUint aServiceId ); |
|
114 |
|
115 /** |
|
116 * Checks if phone is in offline mode. |
|
117 * |
|
118 * @since S60 5.0 |
|
119 * @return ETrue if phone is in offline mode. |
|
120 */ |
|
121 TBool IsPhoneOfflineL() const; |
|
122 |
|
123 /** |
|
124 * Checks if there is GPRS IAPs available in Internet SNAP. |
|
125 * |
|
126 * @since S60 5.0 |
|
127 * @return ETrue if phone is in offline mode. |
|
128 */ |
|
129 TBool IsGprsIapsAvailableL() const; |
|
130 |
|
131 /** |
|
132 * Checks if connection is used by other services. |
|
133 * |
|
134 * @since S60 5.0 |
|
135 * @param aServiceId service id. |
|
136 * @param aIapId access point id. |
|
137 * @return ETrue if connection used by other services. |
|
138 */ |
|
139 TBool ConnectionUsedByOthersL( TUint aServiceId, TInt aIapId ); |
|
140 |
|
141 // from base class MEikSrvNotifierBase2 |
|
142 |
|
143 /** |
|
144 * From MEikSrvNotifierBase2. |
|
145 * Called when a notifier is first loaded |
|
146 * to allow any initial construction that is required. |
|
147 * |
|
148 * @return A structure containing priority and channel info. |
|
149 */ |
|
150 virtual TNotifierInfo RegisterL() = 0; |
|
151 |
|
152 /** |
|
153 * From MEikSrvNotifierBase2. |
|
154 * The notifier has been deactivated |
|
155 * so resources can be freed and outstanding messages completed. |
|
156 */ |
|
157 virtual void Cancel(); |
|
158 |
|
159 /** |
|
160 * From MEikSrvNotifierBase2. |
|
161 * Asynchronic notifier launch. |
|
162 * |
|
163 * @param aBuffer A buffer containing received parameters |
|
164 * @param aReturnVal The return value to be passed back. |
|
165 * @param aMessage Should be completed when the notifier is deactivated. |
|
166 * @return A pointer to return value. |
|
167 */ |
|
168 virtual void StartL( |
|
169 const TDesC8& aBuffer, |
|
170 TInt aReplySlot, |
|
171 const RMessagePtr2& aMessage ); |
|
172 |
|
173 |
|
174 private: |
|
175 |
|
176 // from base class MEikSrvNotifierBase2 |
|
177 |
|
178 /** |
|
179 * From MEikSrvNotifierBase2. |
|
180 * Called when all resources allocated by notifiers should be freed. |
|
181 */ |
|
182 virtual void Release(); |
|
183 |
|
184 /** |
|
185 * From MEikSrvNotifierBase2. |
|
186 * Called when all resources allocated by notifiers should be freed. |
|
187 * |
|
188 * @return A structure containing priority and channel info. |
|
189 */ |
|
190 virtual TNotifierInfo Info() const; |
|
191 |
|
192 /** |
|
193 * From MEikSrvNotifierBase2. |
|
194 * Synchronic notifier launch. |
|
195 * |
|
196 * @param aBuffer Received parameter data. |
|
197 * @return A pointer to return value. |
|
198 */ |
|
199 virtual TPtrC8 StartL( const TDesC8& aBuffer ); |
|
200 |
|
201 /** |
|
202 * From MEikSrvNotifierBase2. |
|
203 * Updates a currently active notifier. |
|
204 * |
|
205 * @param aBuffer The updated data. |
|
206 * @return A pointer to return value. |
|
207 */ |
|
208 virtual TPtrC8 UpdateL( const TDesC8& aBuffer ); |
|
209 |
|
210 /** |
|
211 * From CActive Gets called when a request is cancelled. |
|
212 * @param None. |
|
213 * @return None. |
|
214 */ |
|
215 virtual void DoCancel(); |
|
216 |
|
217 /** |
|
218 * From CActive Gets called when a request is cancelled. |
|
219 * @param None. |
|
220 * @return None. |
|
221 */ |
|
222 virtual void RunL(); |
|
223 |
|
224 protected: // data |
|
225 |
|
226 /** |
|
227 * Pointer to service provider settings. |
|
228 * Own. |
|
229 */ |
|
230 CSPSettings* iSettings; |
|
231 |
|
232 /** |
|
233 * Local eikonenv. |
|
234 * Own. |
|
235 */ |
|
236 CEikonEnv* iEikEnv; |
|
237 |
|
238 /** |
|
239 * Received message. |
|
240 */ |
|
241 RMessagePtr2 iMessage; |
|
242 |
|
243 /** |
|
244 * Notifier parameters structure. |
|
245 */ |
|
246 TNotifierInfo iInfo; |
|
247 |
|
248 /** |
|
249 * Reply slot. |
|
250 */ |
|
251 TInt iReplySlot; |
|
252 |
|
253 /** |
|
254 * Flag for eikon env. |
|
255 */ |
|
256 TInt iResourceFileFlag; |
|
257 |
|
258 /** |
|
259 * Dialog mode. |
|
260 */ |
|
261 MCchUiObserver::TCchUiDialogType iDialogMode; |
|
262 |
|
263 /** |
|
264 * Service id. |
|
265 */ |
|
266 TUint iServiceId; |
|
267 |
|
268 CCHUI_UNIT_TEST( T_CchUiNotifierBase ) |
|
269 }; |
|
270 |
|
271 #endif // C_CCHUINOTIFIER_H |
|