|
1 /* |
|
2 * Copyright (c) 2002 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: |
|
15 * Wrappers for standard note types |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __AknNoteWrappers_H__ |
|
22 #define __AknNoteWrappers_H__ |
|
23 |
|
24 |
|
25 #include <aknnotedialog.h> |
|
26 #include <AknQueryDialog.h> |
|
27 |
|
28 |
|
29 class TResourceReader; |
|
30 |
|
31 |
|
32 class TAknNoteResData |
|
33 { |
|
34 public: |
|
35 void ReadFromResource(TResourceReader& aResReader); |
|
36 public: |
|
37 TInt iResId; |
|
38 CAknNoteDialog::TTimeout iTimeout; |
|
39 CAknNoteDialog::TTone iTone; |
|
40 TBuf<256> iText; |
|
41 }; |
|
42 |
|
43 /** |
|
44 * Base class for implementing commonly used notes. |
|
45 */ |
|
46 class CAknNoteWrapper : public CAknNoteDialog |
|
47 { |
|
48 public: |
|
49 /** |
|
50 * Class default constructor. |
|
51 * |
|
52 * Does not do anything |
|
53 */ |
|
54 IMPORT_C CAknNoteWrapper(); |
|
55 /** |
|
56 * Another class constructor |
|
57 * |
|
58 * Accept self pointer to CEikDialog* in order to NULL |
|
59 * client pointer when a non modal note is dismissed. |
|
60 * |
|
61 * @param aSelfPtr Address of the dialog pointer |
|
62 */ |
|
63 IMPORT_C CAknNoteWrapper(CAknNoteWrapper** aSelfPtr); |
|
64 /** |
|
65 * Construct and display the dialog. |
|
66 * |
|
67 * Create a TAknNoteResData object by reading from resource file. |
|
68 * Set the timeout, set the tone (unless they have already been set) |
|
69 * and call RunLD. |
|
70 * |
|
71 * @see SetTimeout, SetTone |
|
72 * |
|
73 * @param aResId Resource file ID |
|
74 */ |
|
75 IMPORT_C TInt ExecuteLD(TInt aResId); |
|
76 /** |
|
77 * Construct and display the dialog |
|
78 * |
|
79 * Construct a TAknNoteResData object by reading from resource file. |
|
80 * Set the prompt calling SetTextL. Set the timeout, set the |
|
81 * tone (unless they have already been set) and call RunLD. |
|
82 * |
|
83 * @see SetTimeout, SetTone |
|
84 * |
|
85 * @param aResId Resource file ID |
|
86 * @param aPrompt Note text |
|
87 */ |
|
88 IMPORT_C TInt ExecuteLD(TInt aResId, const TDesC& aPrompt); |
|
89 |
|
90 /** |
|
91 * From CCoeControl |
|
92 * HandlePointerEventL Processes the pointer event directed at any note dialogs. |
|
93 * @param aPointerEvent the pointer event to be processed. |
|
94 */ |
|
95 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
96 private: |
|
97 /** |
|
98 * From CAknControl |
|
99 */ |
|
100 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
101 private: |
|
102 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
103 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
104 private: |
|
105 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
106 private: |
|
107 TAknNoteResData ReadResDataAndPrepareL(TInt aResId); |
|
108 |
|
109 public: |
|
110 |
|
111 /** |
|
112 * HandleDialogPageEventL is the interface method used by CEikDialogPage to |
|
113 * signal the note that the some event happened on dialog page |
|
114 * |
|
115 * @param aEventID event to be handled |
|
116 */ |
|
117 IMPORT_C virtual void HandleDialogPageEventL( TInt aEventID ); |
|
118 private: |
|
119 IMPORT_C virtual void Reserved1(); |
|
120 }; |
|
121 |
|
122 /** |
|
123 * Helper base class for implementing specialised note classes. |
|
124 * Using this class makes it unneccessary to overload ExecuteLD |
|
125 * in the specialised classes. |
|
126 */ |
|
127 class CAknResourceNoteDialog : public CAknNoteWrapper |
|
128 { |
|
129 public: |
|
130 /** |
|
131 * Construct and display the dialog. |
|
132 * |
|
133 * Using the resource ID stored in the constructor call the |
|
134 * corresponding ExecuteLD method in CAknNoteWrapper. |
|
135 * |
|
136 * @see CAknNoteWrapper::ExecuteLD |
|
137 * |
|
138 */ |
|
139 IMPORT_C TInt ExecuteLD(); |
|
140 /** |
|
141 * Construct, set the prompt and display the dialog. |
|
142 * |
|
143 * Using the resource ID stored in the constructor call the |
|
144 * corresponding ExecuteLD method in CAknNoteWrapper. |
|
145 * |
|
146 * @see CAknNoteWrapper::ExecuteLD |
|
147 * |
|
148 */ |
|
149 IMPORT_C TInt ExecuteLD(const TDesC& aPrompt); |
|
150 /** |
|
151 * From CCoeControl. |
|
152 * Handles pointer events |
|
153 */ |
|
154 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
155 |
|
156 protected: |
|
157 /** |
|
158 * Constructor. |
|
159 * |
|
160 * Store resource ID. |
|
161 * |
|
162 * @param aResId The resource ID |
|
163 */ |
|
164 inline CAknResourceNoteDialog(TInt aResId) |
|
165 : iResId(aResId) |
|
166 { |
|
167 } |
|
168 |
|
169 /** |
|
170 * Another class constructor. |
|
171 * |
|
172 * Store resource ID. Accept self pointer to CEikDialog* in order |
|
173 * to NULL the dialog client pointer when a non modal note is |
|
174 * dismissed. |
|
175 * |
|
176 * @param aResId The resource ID |
|
177 * @param aSelfPtr Address to itself. The pointer must be valid when the |
|
178 * dialog is dismissed and must not be on the stack. |
|
179 */ |
|
180 inline CAknResourceNoteDialog(TInt aResId, CAknNoteWrapper** aSelfPtr) |
|
181 : CAknNoteWrapper(aSelfPtr), iResId(aResId) |
|
182 { |
|
183 } |
|
184 private: |
|
185 /** |
|
186 * From CAknControl |
|
187 */ |
|
188 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
189 private: |
|
190 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
191 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
192 private: |
|
193 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
194 private: // new virtual function |
|
195 IMPORT_C virtual void CAknResourceNoteDialog_Reserved(); |
|
196 private: |
|
197 TInt iResId; |
|
198 TInt iSpare; |
|
199 }; |
|
200 |
|
201 /** |
|
202 * Wrapper for CAknNoteDialog implementing a Confirmation Note as |
|
203 * from S60 specifications. |
|
204 */ |
|
205 class CAknConfirmationNote : public CAknResourceNoteDialog |
|
206 { |
|
207 public: |
|
208 /** |
|
209 * Default constructor. |
|
210 * |
|
211 * Create a CAknResourceNoteDialog using |
|
212 * R_AKN_CONFIRMATION_NOTE |
|
213 */ |
|
214 IMPORT_C CAknConfirmationNote(); |
|
215 /** |
|
216 * Another class constructor. |
|
217 * |
|
218 * Create a CAknResourceNoteDialog using |
|
219 * R_AKN_CONFIRMATION_NOTE_WAIT or R_AKN_CONFIRMATION_NOTE |
|
220 * depending on the specified parameter |
|
221 * |
|
222 * @param aWaitingDialog If true use R_AKN_CONFIRMATION_NOTE_WAIT, |
|
223 * else use R_AKN_CONFIRMATION_NOTE |
|
224 */ |
|
225 IMPORT_C CAknConfirmationNote( TBool aWaitingDialog ); |
|
226 /** |
|
227 * Another class constructor. |
|
228 * |
|
229 * Create a CAknResourceNoteDialog using |
|
230 * R_AKN_CONFIRMATION_NOTE. Accept self pointer to CEikDialog* |
|
231 * in order to NULL client pointer when a non modal note is dismissed. |
|
232 * |
|
233 * @param aSelfPtr Address of the dialog pointer |
|
234 */ |
|
235 IMPORT_C CAknConfirmationNote(CAknConfirmationNote** aSelfPtr); |
|
236 /** |
|
237 * From CCoeControl. |
|
238 * Handles pointer events |
|
239 */ |
|
240 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
241 private: |
|
242 /** |
|
243 * From CAknControl |
|
244 */ |
|
245 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
246 private: |
|
247 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
248 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
249 private: |
|
250 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
251 private: |
|
252 IMPORT_C virtual void CAknResourceNoteDialog_Reserved(); |
|
253 }; |
|
254 |
|
255 /** |
|
256 * Wrapper for CAknNoteDialog implementing an Information Note as |
|
257 * from S60 specifications. |
|
258 */ |
|
259 class CAknInformationNote : public CAknResourceNoteDialog |
|
260 { |
|
261 public: |
|
262 /** |
|
263 * Default constructor. |
|
264 * |
|
265 * Create a CAknResourceNoteDialog using |
|
266 * R_AKN_INFORMATION_NOTE |
|
267 */ |
|
268 IMPORT_C CAknInformationNote(); |
|
269 /** |
|
270 * Another class constructor. |
|
271 * |
|
272 * Create a CAknResourceNoteDialog using |
|
273 * R_AKN_INFORMATION_NOTE_WAIT or R_AKN_INFORMATION_NOTE |
|
274 * depending on the specified parameter |
|
275 * |
|
276 * @param aWaitingDialog If true use R_AKN_INFORMATION_NOTE_WAIT, |
|
277 * else use R_AKN_INFORMATION_NOTE |
|
278 */ |
|
279 IMPORT_C CAknInformationNote( TBool aWaitingDialog ); |
|
280 /** |
|
281 * Another class constructor. |
|
282 * |
|
283 * Create a CAknResourceNoteDialog using |
|
284 * R_AKN_INFORMATION_NOTE. Accept self pointer to CEikDialog* |
|
285 * in order to NULL client pointer when a non modal note is dismissed. |
|
286 * |
|
287 * @param aSelfPtr Address of the dialog pointer |
|
288 */ |
|
289 IMPORT_C CAknInformationNote(CAknInformationNote** aSelfPtr); |
|
290 /** |
|
291 * From CCoeControl. |
|
292 * Handles pointer events |
|
293 */ |
|
294 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
295 private: |
|
296 /** |
|
297 * From CAknControl |
|
298 */ |
|
299 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
300 private: |
|
301 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
302 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
303 private: |
|
304 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
305 private: |
|
306 IMPORT_C virtual void CAknResourceNoteDialog_Reserved(); |
|
307 }; |
|
308 |
|
309 /** |
|
310 * Wrapper for CAknNoteDialog implementing an Error Note as |
|
311 * from S60 specifications. |
|
312 */ |
|
313 class CAknErrorNote : public CAknResourceNoteDialog |
|
314 { |
|
315 public: |
|
316 /** |
|
317 * Default constructor. |
|
318 * |
|
319 * Create a CAknResourceNoteDialog using |
|
320 * R_AKN_ERROR_NOTE |
|
321 */ |
|
322 IMPORT_C CAknErrorNote(); |
|
323 /** |
|
324 * Another class constructor. |
|
325 * |
|
326 * Create a CAknResourceNoteDialog using |
|
327 * R_AKN_ERROR_NOTE_WAIT or R_AKN_ERROR_NOTE |
|
328 * depending on the specified parameter |
|
329 * |
|
330 * @param aWaitingDialog If true use R_AKN_ERROR_NOTE_WAIT, |
|
331 * else use R_AKN_ERROR_NOTE |
|
332 */ |
|
333 IMPORT_C CAknErrorNote( TBool aWaitingDialog ); |
|
334 /** |
|
335 * Another class constructor. |
|
336 * |
|
337 * Create a CAknResourceNoteDialog using |
|
338 * R_AKN_ERROR_NOTE. Accept self pointer to CEikDialog* |
|
339 * in order to NULL client pointer when a non modal note is dismissed. |
|
340 * |
|
341 * @param aSelfPtr Address of the dialog pointer |
|
342 */ |
|
343 IMPORT_C CAknErrorNote(CAknErrorNote** aSelfPtr); |
|
344 /** |
|
345 * From CCoeControl. Handles pointer event |
|
346 * @param aPointerEvent Pointer event to be handled |
|
347 */ |
|
348 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
349 private: |
|
350 /** |
|
351 * From CAknControl |
|
352 */ |
|
353 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
354 private: |
|
355 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
356 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
357 private: |
|
358 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
359 private: |
|
360 IMPORT_C virtual void CAknResourceNoteDialog_Reserved(); |
|
361 }; |
|
362 |
|
363 /** |
|
364 * Wrapper for CAknNoteDialog implementing a Warning Note as |
|
365 * from S60 specifications. |
|
366 */ |
|
367 class CAknWarningNote : public CAknResourceNoteDialog |
|
368 { |
|
369 public: |
|
370 /** |
|
371 * Default constructor. |
|
372 * |
|
373 * Create a CAknResourceNoteDialog using |
|
374 * R_AKN_WARNING_NOTE |
|
375 */ |
|
376 IMPORT_C CAknWarningNote(); |
|
377 /** |
|
378 * Another class constructor. |
|
379 * |
|
380 * Create a CAknResourceNoteDialog using |
|
381 * R_AKN_WARNING_NOTE_WAIT or R_AKN_WARNING_NOTE |
|
382 * depending on the specified parameter |
|
383 * |
|
384 * @param aWaitingDialog If true use R_AKN_WARNING_NOTE_WAIT, |
|
385 * else use R_AKN_WARNING_NOTE |
|
386 */ |
|
387 IMPORT_C CAknWarningNote( TBool aWaitingDialog ); |
|
388 /** |
|
389 * Another class constructor. |
|
390 * |
|
391 * Create a CAknResourceNoteDialog using |
|
392 * R_AKN_WARNING_NOTE. Accept self pointer to CEikDialog* |
|
393 * in order to NULL client pointer when a non modal note is dismissed. |
|
394 * |
|
395 * @param aSelfPtr Address of the dialog pointer |
|
396 */ |
|
397 IMPORT_C CAknWarningNote(CAknWarningNote** aSelfPtr); |
|
398 /** |
|
399 * From CCoeControl. |
|
400 * Handles pointer events |
|
401 */ |
|
402 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
403 private: |
|
404 /** |
|
405 * From CAknControl |
|
406 */ |
|
407 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
408 private: |
|
409 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
410 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
411 private: |
|
412 IMPORT_C virtual void CAknNoteDialog_Reserved(); |
|
413 private: |
|
414 IMPORT_C virtual void CAknResourceNoteDialog_Reserved(); |
|
415 }; |
|
416 |
|
417 #endif |
|
418 |