|
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 * Header file for Setting page implementations for Date, Time, duration |
|
16 * and IP addresses |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef __AKNMFNESETTINGPAGE_H__ |
|
22 #define __AKNMFNESETTINGPAGE_H__ |
|
23 |
|
24 #include <eikdef.h> |
|
25 #include <eikbtgpc.h> |
|
26 #include <eikmfne.h> |
|
27 #include <aknipfed.h> |
|
28 #include <in_sock.h> |
|
29 #include <aknsettingpage.h> |
|
30 |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CAknButton; |
|
34 |
|
35 /** |
|
36 * |
|
37 * This class is used as the base for the date, time, duration and Ip editor |
|
38 * setting page types. It performs all the layout. |
|
39 * |
|
40 */ |
|
41 class CAknMfneSettingPage : public CAknSettingPage |
|
42 { |
|
43 |
|
44 public: |
|
45 /** |
|
46 * From CCoeControl. |
|
47 * Handles pointer events |
|
48 */ |
|
49 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
50 /** |
|
51 * Destructor. |
|
52 */ |
|
53 IMPORT_C virtual ~CAknMfneSettingPage(); |
|
54 |
|
55 protected: |
|
56 /** |
|
57 * Constructor using purely Setting page resource |
|
58 * |
|
59 * @param aResourceId Setting page resource Id |
|
60 */ |
|
61 IMPORT_C CAknMfneSettingPage(TInt ResourceId ); |
|
62 /** |
|
63 * Constructor that allows separate setting page and editor resources |
|
64 * |
|
65 * @param aSettingTitleText Text at top of setting pane ; Externally owned |
|
66 * @param aSettingNumber Number at top left (if present) |
|
67 * @param aControlType Determines the type constructed and how its |
|
68 * resource is read |
|
69 * @param aEditorResourceId Editor resource to use in the setting page |
|
70 * (if present) |
|
71 */ |
|
72 IMPORT_C CAknMfneSettingPage( const TDesC* aSettingTitleText, |
|
73 TInt aSettingNumber, |
|
74 TInt aControlType, |
|
75 TInt aEditorResourceId, |
|
76 TInt aSettingPageResourceId ); |
|
77 |
|
78 /** |
|
79 * |
|
80 * Framework method called when the control needs to be re-laid out |
|
81 * |
|
82 */ |
|
83 IMPORT_C virtual void SizeChanged(); |
|
84 |
|
85 /** |
|
86 * Draws the control. Framework method |
|
87 */ |
|
88 IMPORT_C void Draw(const TRect& aRect) const; |
|
89 |
|
90 /** |
|
91 * Type-specific access to control |
|
92 */ |
|
93 IMPORT_C CEikMfne* Mfne() const; |
|
94 |
|
95 /** |
|
96 * Implementation of of validity framework method for mfnes. |
|
97 * Checks if the current focused field in the mfne is valid and sets the |
|
98 * setting page validity accordingly. |
|
99 * |
|
100 * This method is called in order for the softkeys to be updated |
|
101 */ |
|
102 IMPORT_C void CheckAndSetDataValidity(); |
|
103 |
|
104 /** |
|
105 * From MCoeControlObserver: |
|
106 * Acts upon changes in the hosted control's state. |
|
107 * |
|
108 * This observer method performs |
|
109 * - Updates the value if EUpdateWhenChanged is the setting page's update |
|
110 * mode |
|
111 * - updates CBA labels depending on the data validity |
|
112 * |
|
113 * @param aControl The control changing its state (not used) |
|
114 * @param aEventType The type of control event |
|
115 */ |
|
116 IMPORT_C virtual void HandleControlEventL(CCoeControl* aControl, |
|
117 TCoeEvent aEventType); |
|
118 |
|
119 /** |
|
120 * |
|
121 * 2nd stage construction. This creates the editing buttons in |
|
122 * touch enabled builds. |
|
123 * |
|
124 */ |
|
125 IMPORT_C virtual void ConstructL(); |
|
126 |
|
127 /** |
|
128 * Standard CCoeControl routine to return the number of componentn controls |
|
129 * |
|
130 * @param aIndex index at which to return control |
|
131 */ |
|
132 IMPORT_C TInt CountComponentControls() const; |
|
133 |
|
134 /** |
|
135 * Standard CCoeControl routine to return the control at a given index |
|
136 * |
|
137 * @param aIndex index at which to return control |
|
138 */ |
|
139 IMPORT_C CCoeControl* ComponentControl(TInt anIndex) const; |
|
140 |
|
141 protected: |
|
142 |
|
143 // Buttons for modifying the value of the active MFNE field with stylus. |
|
144 // The derived classes which require the buttons, must call this class' |
|
145 // ConstructL function in their second phase constructor. This class |
|
146 // takes care of the button positioning and functionality. |
|
147 CAknButton* iIncreaseValueButton; |
|
148 CAknButton* iDecreaseValueButton; |
|
149 |
|
150 private: |
|
151 /** |
|
152 * From CAknControl |
|
153 */ |
|
154 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
155 |
|
156 private: |
|
157 // Layout information is stored here and not in the derived classes |
|
158 TAknLayoutRect iMfneLayoutRect; |
|
159 TAknLayoutRect iHorizontalShadow; |
|
160 TAknLayoutRect iVerticalShadow; |
|
161 TAknLayoutRect iOutlineFrame; |
|
162 |
|
163 TInt iSpare_1; |
|
164 |
|
165 }; |
|
166 |
|
167 |
|
168 /** |
|
169 * |
|
170 * This class is used for entering Dates in a "Code" setting page |
|
171 * |
|
172 */ |
|
173 class CAknDateSettingPage : public CAknMfneSettingPage |
|
174 { |
|
175 public: |
|
176 |
|
177 /** |
|
178 * Constructor using purely Setting page resource |
|
179 * |
|
180 * @param aResourceId Setting page resource Id |
|
181 * @param aDateValue Reference to a date value set to the initial |
|
182 * date |
|
183 */ |
|
184 IMPORT_C CAknDateSettingPage( |
|
185 TInt aResourceID, |
|
186 TTime& aDateValue); |
|
187 |
|
188 /** |
|
189 * Constructor that allows separate setting page and editor resources |
|
190 * |
|
191 * This constructor allows the use of setting page using only the editor |
|
192 * resource. Other combinations are also possible |
|
193 * |
|
194 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
195 * |
|
196 * Editor Resource Setting Page Resource |
|
197 * present present Both are used |
|
198 * (but text |
|
199 * & number overridden) |
|
200 * = 0 present Editor resource is used |
|
201 * via SP resource |
|
202 * (Effectively like the |
|
203 * other constructor) |
|
204 * present = 0 Default Avkon SP |
|
205 * resource if used + this |
|
206 * editor resource |
|
207 * = 0 = 0 uses default resource |
|
208 * for both SP and editor. |
|
209 * This is OK if: |
|
210 * i) control type is present, |
|
211 * ii) a default resource exists ( OK for text, integer, date, time, |
|
212 * duration ) |
|
213 * |
|
214 * Note: The first argument is a TDesC* (rather than TDesC&) because the |
|
215 * other constructor cannot initialize such a member without allocation or |
|
216 * having an internal dummy buffer. |
|
217 * Note that this descriptor must be owned by the client at least until the |
|
218 * ExecuteLD(). |
|
219 * |
|
220 * Rules for text and numbers: The rules are the same for both: |
|
221 * (non-zero length) text or number other than |
|
222 * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not |
|
223 * override resource (unless that is zero length or |
|
224 * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number |
|
225 * given via the specific API for setting them, WILL override resource. |
|
226 * It is assumed that number from resource is very rare. Special text is |
|
227 * somewhat more likely. |
|
228 * |
|
229 * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY |
|
230 * @param aSettingNumber Number at top left (if present) |
|
231 * @param aControlType Determines the type constructed and how its |
|
232 * resource is read |
|
233 * @param aEditorResourceId Editor resource to use in the setting page |
|
234 * (if present) |
|
235 * @param aSettingPageResourceId Setting Page to use (if present) |
|
236 * @param aDateValue reference to date |
|
237 */ |
|
238 IMPORT_C CAknDateSettingPage( |
|
239 const TDesC* aSettingTitleText, |
|
240 TInt aSettingNumber, |
|
241 TInt aControlType, |
|
242 TInt aEditorResourceId, |
|
243 TInt aSettingPageResourceId, |
|
244 TTime& aDateValue ); |
|
245 |
|
246 |
|
247 /** |
|
248 * |
|
249 * 2nd stage construction. This uses stored values from the conststuctor |
|
250 * to allocate the required aggregate objects, and then set the Date value. |
|
251 * |
|
252 */ |
|
253 IMPORT_C virtual void ConstructL(); |
|
254 |
|
255 /** |
|
256 * Type-specific access to the editor |
|
257 * |
|
258 * @return the hosted editor |
|
259 */ |
|
260 IMPORT_C CEikDateEditor* DateEditor(); |
|
261 |
|
262 /** |
|
263 * From CCoeControl |
|
264 */ |
|
265 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
266 |
|
267 protected: |
|
268 /** |
|
269 * Destructor |
|
270 */ |
|
271 IMPORT_C virtual ~CAknDateSettingPage(); |
|
272 |
|
273 /** |
|
274 * This framework method is called when the editor changes its value and the |
|
275 * mode of execution of the setting page is a continuous update mode. |
|
276 * |
|
277 */ |
|
278 IMPORT_C virtual void UpdateSettingL(); |
|
279 |
|
280 /** |
|
281 * Called when the user has accepted the value. |
|
282 * The external value is updated once again, in case we were not in |
|
283 * continuous update mode. |
|
284 * A specific observer event is generated for the observer to say that the |
|
285 * value is accepted. |
|
286 */ |
|
287 IMPORT_C virtual void AcceptSettingL(); |
|
288 |
|
289 /** |
|
290 * The backup value, stored at construction time, is re-loaded into the |
|
291 * referenced Date. An event is sent to the observer saying that the event |
|
292 * was dismissed. |
|
293 */ |
|
294 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
295 |
|
296 // |
|
297 // CoeControl Framework and reserved methods |
|
298 // |
|
299 protected: |
|
300 |
|
301 /** |
|
302 * Writes the internal state of the control and its components to aStream. |
|
303 * Does nothing in release mode. |
|
304 * Designed to be overidden and base called by subclasses. |
|
305 * |
|
306 * @param aWriteSteam A connected write stream |
|
307 */ |
|
308 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
309 |
|
310 private: |
|
311 /** |
|
312 * Reserved method derived from CCoeControl |
|
313 */ |
|
314 IMPORT_C virtual void Reserved_2(); |
|
315 |
|
316 private: |
|
317 /** |
|
318 * From CAknControl |
|
319 */ |
|
320 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
321 |
|
322 /** |
|
323 * New reserved methods for CAknSettingPage hierarchy |
|
324 */ |
|
325 private: |
|
326 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
327 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
328 |
|
329 private: |
|
330 TTime& iDateValue; |
|
331 TTime iBackupDateValue; |
|
332 }; |
|
333 |
|
334 /** |
|
335 * |
|
336 * This class is used for entering Times in a "Code" setting page |
|
337 * |
|
338 */ |
|
339 class CAknTimeSettingPage : public CAknMfneSettingPage |
|
340 { |
|
341 public: |
|
342 /** |
|
343 * Constructor using purely Setting page resource |
|
344 * |
|
345 * @param aResourceId Setting page resource Id |
|
346 * @param aTimeValue Reference to a time value for the initial time |
|
347 */ |
|
348 IMPORT_C CAknTimeSettingPage( |
|
349 TInt aResourceID, |
|
350 TTime& aTimeValue); |
|
351 |
|
352 /** |
|
353 * Constructor that allows separate setting page and editor resources |
|
354 * |
|
355 * This constructor allows the use of setting page using only the editor |
|
356 * resource. Other combinations are also possible |
|
357 * |
|
358 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
359 * |
|
360 * Editor Resource Setting Page Resource |
|
361 * present present Both are used (but text |
|
362 * & number overridden) |
|
363 * = 0 present Editor resource is used |
|
364 * via SP resource |
|
365 * (Effectively like the |
|
366 * other constructor) |
|
367 * present = 0 Default Avkon SP |
|
368 * resource if used + this |
|
369 * editor resource |
|
370 * = 0 = 0 uses default resource |
|
371 * for both SP and editor. |
|
372 * This is OK if: |
|
373 * i) control type is present, |
|
374 * ii) a default resource exists ( OK for text, integer, |
|
375 * date, time, duration ) |
|
376 * |
|
377 * Note: The first argument is a TDesC* (rather than TDesC&) because the |
|
378 * other constructor cannot initialize such a member without allocation or |
|
379 * having an internal dummy buffer. |
|
380 * Note that this descriptor must be owned by the client at least until the |
|
381 * ExecuteLD(). |
|
382 * |
|
383 * Rules for text and numbers: The rules are the same for both: |
|
384 * (non-zero length) text or number other than |
|
385 * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not |
|
386 * override resource (unless that is zero length or |
|
387 * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number |
|
388 * given via the specific API for setting them, WILL override resource. |
|
389 * It is assumed that number from resource is very rare. Special text is |
|
390 * somewhat more likely. |
|
391 * |
|
392 * @param aSettingTitleText Text at top of setting pane |
|
393 * @param aSettingNumber Number at top left (if present) |
|
394 * @param aControlType Determines the type constructed and how its |
|
395 * resource is read |
|
396 * @param aEditorResourceId Editor resource to use in the setting page |
|
397 * (if present) |
|
398 * @param aSettingPageResourceId Setting Page to use (if present) |
|
399 * @param aTimeValue reference to a time |
|
400 */ |
|
401 IMPORT_C CAknTimeSettingPage( const TDesC* aSettingTitleText, |
|
402 TInt aSettingNumber, |
|
403 TInt aControlType, |
|
404 TInt aEditorResourceId, |
|
405 TInt aSettingPageResourceId, |
|
406 TTime& aTimeValue ); |
|
407 |
|
408 /** |
|
409 * Specific 2nd stage contructor for this type. Construction is performed |
|
410 * according to the resources and parameters set in the C++ constructors |
|
411 * |
|
412 */ |
|
413 IMPORT_C virtual void ConstructL(); |
|
414 |
|
415 /** |
|
416 * Type-specific access to the editor |
|
417 */ |
|
418 IMPORT_C CEikTimeEditor* TimeEditor(); |
|
419 |
|
420 /** |
|
421 * From CCoeControl |
|
422 */ |
|
423 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
424 |
|
425 protected: |
|
426 |
|
427 /** |
|
428 * Destructor |
|
429 */ |
|
430 IMPORT_C virtual ~CAknTimeSettingPage(); |
|
431 |
|
432 /** |
|
433 * This framework method is called when the editor changes its value and |
|
434 * the mode of execution of the setting page is a continuous update mode. |
|
435 * |
|
436 */ |
|
437 IMPORT_C virtual void UpdateSettingL(); |
|
438 |
|
439 /** |
|
440 * Called when the user has accepted the value. |
|
441 * The external value is updated once again, in case we were not in |
|
442 * continuous update mode. |
|
443 * A specific observer event is generated for the observer to say that the |
|
444 * value is accepted. |
|
445 */ |
|
446 IMPORT_C virtual void AcceptSettingL(); |
|
447 /** |
|
448 * The backup value, stored at construction time, is re-loaded into the |
|
449 * referenced Date. |
|
450 * An event is sent to the observer saying that the event was dismissed. |
|
451 */ |
|
452 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
453 |
|
454 // |
|
455 // CoeControl Framework and reserved methods |
|
456 // |
|
457 protected: |
|
458 |
|
459 /** |
|
460 * Writes the internal state of the control and its components to aStream. |
|
461 * Does nothing in release mode. |
|
462 * Designed to be overidden and base called by subclasses. |
|
463 * |
|
464 * @param aWriteSteam A connected write stream |
|
465 */ |
|
466 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
467 |
|
468 private: |
|
469 |
|
470 /** |
|
471 * Reserved method derived from CCoeControl |
|
472 */ |
|
473 IMPORT_C virtual void Reserved_2(); |
|
474 |
|
475 private: |
|
476 /** |
|
477 * From CAknControl |
|
478 */ |
|
479 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
480 |
|
481 /** |
|
482 * New reserved methods for CAknSettingPage hierarchy |
|
483 */ |
|
484 private: |
|
485 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
486 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
487 |
|
488 |
|
489 private: |
|
490 TTime& iTimeValue; |
|
491 TTime iBackupTimeValue; |
|
492 |
|
493 }; |
|
494 |
|
495 /** |
|
496 * |
|
497 * This class is used for entering duration in a "Code" setting page |
|
498 * |
|
499 */ |
|
500 class CAknDurationSettingPage : public CAknMfneSettingPage |
|
501 { |
|
502 public: |
|
503 /** |
|
504 * Constructor using purely Setting page resource |
|
505 * |
|
506 * @param aResourceId Setting page resource Id |
|
507 * @param aDurationValue Reference to the maintained duration value |
|
508 */ |
|
509 IMPORT_C CAknDurationSettingPage( |
|
510 TInt aResourceID, |
|
511 TTimeIntervalSeconds& aDurationValue); |
|
512 /** |
|
513 * Constructor that allows separate setting page and editor resources |
|
514 * |
|
515 * This constructor allows the use of setting page using only the editor |
|
516 * resource. Other combinations are also possible |
|
517 * |
|
518 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
519 * |
|
520 * Editor Resource Setting Page Resource |
|
521 * present present Both are used |
|
522 * (but text & number |
|
523 * overridden) |
|
524 * = 0 present Editor resource is used |
|
525 * via SP resource |
|
526 * (Effectively like the |
|
527 * other constructor) |
|
528 * present = 0 Default Avkon SP |
|
529 * resource if used + this |
|
530 * editor resource |
|
531 * = 0 = 0 uses default resource |
|
532 * for both SP and editor. |
|
533 * This is OK if: |
|
534 * i) control type is present, |
|
535 * ii) a default resource exists ( OK for text, integer, |
|
536 * date, time, duration ) |
|
537 * |
|
538 * Note: The first argument is a TDesC* (rather than TDesC&) because the |
|
539 * other constructor cannot initialize such a member without allocation or |
|
540 * having an internal dummy buffer. |
|
541 * Note that this descriptor must be owned by the client at least until the |
|
542 * ExecuteLD(). |
|
543 * |
|
544 * Rules for text and numbers: The rules are the same for both: |
|
545 * (non-zero length) text or number other than |
|
546 * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not |
|
547 * override resource (unless that is zero length or |
|
548 * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number |
|
549 * given via the specific API for setting them, WILL override resource. |
|
550 * It is assumed that number from resource is very rare. Special text is |
|
551 * somewhat more likely. |
|
552 * |
|
553 * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY |
|
554 * @param aSettingNumber Number at top left (if present) |
|
555 * @param aControlType Determines the type constructed and how its |
|
556 * resource is read |
|
557 * @param aEditorResourceId Editor resource to use in the setting page |
|
558 * (if present) |
|
559 * @param aSettingPageResourceId Setting Page to use (if present) |
|
560 * @param aDurationValue reference to a duration |
|
561 */ |
|
562 IMPORT_C CAknDurationSettingPage( const TDesC* aSettingTitleText, |
|
563 TInt aSettingNumber, |
|
564 TInt aControlType, |
|
565 TInt aEditorResourceId, |
|
566 TInt aSettingPageResourceId, |
|
567 TTimeIntervalSeconds& aDurationValue); |
|
568 |
|
569 /** |
|
570 * Specific 2nd stage contructor for this type. Construction is performed |
|
571 * according to the resources and parameters set in the C++ constructors |
|
572 * |
|
573 */ |
|
574 IMPORT_C virtual void ConstructL(); |
|
575 /** |
|
576 * Type-specific access to the editor |
|
577 */ |
|
578 IMPORT_C CEikDurationEditor* DurationEditor(); |
|
579 /** |
|
580 * From CCoeControl. |
|
581 * Handles pointer events |
|
582 */ |
|
583 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
584 |
|
585 protected: |
|
586 /** |
|
587 * Destructor |
|
588 */ |
|
589 IMPORT_C virtual ~CAknDurationSettingPage(); |
|
590 |
|
591 /** |
|
592 * This framework method is called when the editor changes its value and |
|
593 * the mode of execution of the setting page is a continuous update mode. |
|
594 * |
|
595 */ |
|
596 IMPORT_C virtual void UpdateSettingL(); |
|
597 |
|
598 /** |
|
599 * Called when the user has accepted the value. |
|
600 * The external value is updated once again, in case we were not in |
|
601 * continuous update mode. |
|
602 * A specific observer event is generated for the observer to say that the |
|
603 * value is accepted. |
|
604 */ |
|
605 IMPORT_C virtual void AcceptSettingL(); |
|
606 |
|
607 /** |
|
608 * The backup value, stored at construction time, is re-loaded into the |
|
609 * referenced Date. |
|
610 * An event is sent to the observer saying that the event was dismissed. |
|
611 */ |
|
612 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
613 |
|
614 // |
|
615 // CoeControl Framework and reserved methods |
|
616 // |
|
617 protected: |
|
618 |
|
619 /** |
|
620 * Writes the internal state of the control and its components to aStream. |
|
621 * Does nothing in release mode. |
|
622 * Designed to be overidden and base called by subclasses. |
|
623 * |
|
624 * @param aWriteSteam A connected write stream |
|
625 */ |
|
626 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
627 |
|
628 private: |
|
629 /** |
|
630 * Reserved method derived from CCoeControl |
|
631 */ |
|
632 IMPORT_C virtual void Reserved_2(); |
|
633 |
|
634 private: |
|
635 /** |
|
636 * From CAknControl |
|
637 */ |
|
638 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
639 |
|
640 /** |
|
641 * New reserved methods for CAknSettingPage hierarchy |
|
642 */ |
|
643 private: |
|
644 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
645 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
646 |
|
647 private: |
|
648 TTimeIntervalSeconds& iDurationValue; |
|
649 TTimeIntervalSeconds iBackupDurationValue; |
|
650 }; |
|
651 |
|
652 |
|
653 /** |
|
654 * Time offset setting page. |
|
655 * |
|
656 * @lib avkon |
|
657 * @since 2.0 |
|
658 */ |
|
659 |
|
660 class CAknTimeOffsetSettingPage : public CAknMfneSettingPage |
|
661 { |
|
662 public: |
|
663 /** |
|
664 * Constructor using purely Setting page resource |
|
665 * |
|
666 * @since 2.0 |
|
667 * @param aResourceId Setting page resource Id |
|
668 * @param aTimeOffsetValue Reference to the maintained |
|
669 * offset value |
|
670 */ |
|
671 IMPORT_C CAknTimeOffsetSettingPage( |
|
672 TInt aResourceID, |
|
673 TTimeIntervalSeconds& aTimeOffsetValue); |
|
674 /** |
|
675 * Constructor that allows separate setting page and editor resources |
|
676 * |
|
677 * This constructor allows the use of setting page using only the editor |
|
678 * resource. Other combinations are also possible |
|
679 * |
|
680 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
681 * |
|
682 * Editor Resource Setting Page Resource |
|
683 * present present Both are used |
|
684 * (but text & number |
|
685 * overridden) |
|
686 * = 0 present Editor resource is |
|
687 * used via SP resource |
|
688 * (Effectively like the |
|
689 * other constructor) |
|
690 * present = 0 Default Avkon SP |
|
691 * resource if used + |
|
692 * this editor resource |
|
693 * = 0 = 0 uses default resource |
|
694 * for both SP and editor. |
|
695 * This is OK if: |
|
696 * i) control type is present, |
|
697 * ii) a default resource exists ( OK for text, integer, |
|
698 * date, time, duration ) |
|
699 * |
|
700 * Note: The first argument is a TDesC* (rather than TDesC&) because |
|
701 * the other constructor cannot initialize such a member without allocation |
|
702 * or having an internal dummy buffer. |
|
703 * Note that this descriptor must be owned by the client at least until the |
|
704 * ExecuteLD(). |
|
705 * |
|
706 * Rules for text and numbers: The rules are the same for both: |
|
707 * (non-zero length) text or number other than |
|
708 * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not |
|
709 * override resource (unless that is zero length or |
|
710 * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number |
|
711 * given via the specific API for setting them, WILL override resource. |
|
712 * It is assumed that number from resource is very rare. Special text is |
|
713 * somewhat more likely. |
|
714 * |
|
715 * @since 2.0 |
|
716 * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY |
|
717 * @param aSettingNumber Number at top left (if present) |
|
718 * @param aControlType Determines the type constructed |
|
719 * and how its resource is read |
|
720 * @param aEditorResourceId Editor resource to use in the setting page |
|
721 * (if present) |
|
722 * @param aSettingPageResourceId Setting Page to use (if present) |
|
723 * @param aTimeOffsetValue reference to time offset |
|
724 */ |
|
725 IMPORT_C CAknTimeOffsetSettingPage( const TDesC* aSettingTitleText, |
|
726 TInt aSettingNumber, |
|
727 TInt aControlType, |
|
728 TInt aEditorResourceId, |
|
729 TInt aSettingPageResourceId, |
|
730 TTimeIntervalSeconds& aTimeOffsetValue); |
|
731 |
|
732 /** |
|
733 * Specific 2nd stage contructor for this type. Construction is performed |
|
734 * according to the resources and parameters set in the C++ constructors |
|
735 * |
|
736 */ |
|
737 IMPORT_C virtual void ConstructL(); |
|
738 /** |
|
739 * Type-specific access to the editor |
|
740 */ |
|
741 IMPORT_C CEikTimeOffsetEditor* TimeOffsetEditor(); |
|
742 /** |
|
743 * From CCoeControl |
|
744 */ |
|
745 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
746 |
|
747 protected: |
|
748 /** |
|
749 * Destructor |
|
750 */ |
|
751 IMPORT_C virtual ~CAknTimeOffsetSettingPage(); |
|
752 |
|
753 /** |
|
754 * This framework method is called when the editor changes its |
|
755 * value and the mode of execution of the setting page is a continuous |
|
756 * update mode. |
|
757 * |
|
758 * @since 2.0 |
|
759 */ |
|
760 IMPORT_C virtual void UpdateSettingL(); |
|
761 |
|
762 /** |
|
763 * Called when the user has accepted the value. |
|
764 * The external value is updated once again, in case we were not in |
|
765 * continuous update mode. |
|
766 * A specific observer event is generated for the observer to say that the |
|
767 * value is accepted. |
|
768 * |
|
769 * @since 2.0 |
|
770 */ |
|
771 IMPORT_C virtual void AcceptSettingL(); |
|
772 |
|
773 /** |
|
774 * The backup value, stored at construction time, is re-loaded into the |
|
775 * referenced Date. |
|
776 * An event is sent to the observer saying that the event was dismissed. |
|
777 * |
|
778 * @since 2.0 |
|
779 */ |
|
780 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
781 |
|
782 // |
|
783 // CoeControl Framework and reserved methods |
|
784 // |
|
785 protected: |
|
786 |
|
787 /** |
|
788 * Writes the internal state of the control and its components to aStream. |
|
789 * Does nothing in release mode. |
|
790 * Designed to be overidden and base called by subclasses. |
|
791 * |
|
792 * @since 2.0 |
|
793 * @param aWriteSteam A connected write stream |
|
794 */ |
|
795 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
796 |
|
797 private: |
|
798 /** |
|
799 * Reserved method derived from CCoeControl |
|
800 * |
|
801 * @since 2.0 |
|
802 */ |
|
803 IMPORT_C virtual void Reserved_2(); |
|
804 |
|
805 private: |
|
806 /** |
|
807 * From CAknControl |
|
808 */ |
|
809 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
810 |
|
811 /** |
|
812 * New reserved methods for CAknSettingPage hierarchy |
|
813 */ |
|
814 private: |
|
815 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
816 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
817 |
|
818 private: |
|
819 TTimeIntervalSeconds& iTimeOffsetValue; |
|
820 TTimeIntervalSeconds iBackupTimeOffsetValue; |
|
821 |
|
822 }; |
|
823 /** |
|
824 * |
|
825 * Setting page class for entering an IP Address |
|
826 * |
|
827 */ |
|
828 class CAknIpFieldSettingPage : public CAknMfneSettingPage |
|
829 { |
|
830 public: |
|
831 /** |
|
832 * Constructor using purely Setting page resource |
|
833 * |
|
834 * @param aResourceId Setting page resource Id |
|
835 * @param aIpAddress Reference to the maintained IP address |
|
836 */ |
|
837 IMPORT_C CAknIpFieldSettingPage( |
|
838 TInt aResourceID, |
|
839 TInetAddr& aIpAddress); |
|
840 /** |
|
841 * Constructor that allows separate setting page and editor resources |
|
842 * |
|
843 * This constructor allows the use of setting page using only the editor |
|
844 * resource. Other combinations are also possible |
|
845 * |
|
846 * In all cases the number (if supplied i.e. <> 0 ) is used. |
|
847 * |
|
848 * Editor Resource Setting Page Resource |
|
849 * present present Both are used (but text |
|
850 * & number overridden) |
|
851 * = 0 present Editor resource is |
|
852 * used via SP resource |
|
853 * (Effectively like the |
|
854 * other constructor) |
|
855 * present = 0 Default Avkon SP |
|
856 * resource if used + this |
|
857 * editor resource |
|
858 * = 0 = 0 uses default resource |
|
859 * for both SP and editor. |
|
860 * This is OK if: |
|
861 * i) control type is present, |
|
862 * ii) a default resource exists ( OK for text, integer, |
|
863 * date, time, duration ) |
|
864 * |
|
865 * Note: The first argument is a TDesC* (rather than TDesC&) because the |
|
866 * other constructor cannot initialize such a member without allocation |
|
867 * or having an internal dummy buffer. |
|
868 * Note that this descriptor must be owned by the client at least until |
|
869 * the ExecuteLD(). |
|
870 * |
|
871 * Rules for text and numbers: The rules are the same for both: |
|
872 * (non-zero length) text or number other than |
|
873 * EAknSettingPageNoOrdinalDisplayed if given in this constructor will not |
|
874 * override resource (unless that is zero length or |
|
875 * EAknSettingPageNoOrdinalDisplayed). Note, however, that text or number |
|
876 * given via the specific API for setting them, WILL override resource. |
|
877 * It is assumed that number from resource is very rare. Special text is |
|
878 * somewhat more likely. |
|
879 * |
|
880 * @param aSettingTitleText Text at top of setting pane; OWNED EXTERNALLY |
|
881 * @param aSettingNumber Number at top left (if present) |
|
882 * @param aControlType Determines the type constructed and how its |
|
883 * resource is read |
|
884 * @param aEditorResourceId Editor resource to use in the setting page |
|
885 * (if present) |
|
886 * @param aSettingPageResourceId Setting Page to use (if present) |
|
887 * @param aIpAddress reference to a duration |
|
888 */ |
|
889 IMPORT_C CAknIpFieldSettingPage( const TDesC* aSettingTitleText, |
|
890 TInt aSettingNumber, |
|
891 TInt aControlType, |
|
892 TInt aEditorResourceId, |
|
893 TInt aSettingPageResourceId, |
|
894 TInetAddr& aIpAddress); |
|
895 |
|
896 /** |
|
897 * Specific 2nd stage contructor for this type. Construction is performed |
|
898 * according to the resources and parameters set in the C++ constructors |
|
899 * |
|
900 */ |
|
901 IMPORT_C virtual void ConstructL(); |
|
902 /** |
|
903 * Type-specific access to the editor |
|
904 */ |
|
905 IMPORT_C CAknIpFieldEditor* IpFieldEditor(); |
|
906 |
|
907 /** |
|
908 * From CCoeControl |
|
909 */ |
|
910 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
911 |
|
912 protected: |
|
913 /** |
|
914 * Destructor |
|
915 */ |
|
916 IMPORT_C virtual ~CAknIpFieldSettingPage(); |
|
917 |
|
918 /** |
|
919 * This framework method is called when the editor changes its value and |
|
920 * the mode of execution of the setting page is a continuous update mode. |
|
921 * |
|
922 */ |
|
923 IMPORT_C virtual void UpdateSettingL(); |
|
924 |
|
925 /** |
|
926 * Called when the user has accepted the value. |
|
927 * The external value is updated once again, in case we were not in |
|
928 * continuous update mode. |
|
929 * A specific observer event is generated for the observer to say that the |
|
930 * value is accepted. |
|
931 */ |
|
932 IMPORT_C virtual void AcceptSettingL(); |
|
933 |
|
934 /** |
|
935 * The backup value, stored at construction time, is re-loaded into |
|
936 * the referenced Date. |
|
937 * An event is sent to the observer saying that the event was dismissed. |
|
938 */ |
|
939 IMPORT_C virtual void RestoreOriginalSettingL(); |
|
940 |
|
941 // |
|
942 // CoeControl Framework and reserved methods |
|
943 // |
|
944 protected: |
|
945 |
|
946 /** |
|
947 * Writes the internal state of the control and its components to aStream. |
|
948 * Does nothing in release mode. |
|
949 * Designed to be overidden and base called by subclasses. |
|
950 * |
|
951 * @param aWriteSteam A connected write stream |
|
952 */ |
|
953 IMPORT_C virtual void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
954 |
|
955 private: |
|
956 |
|
957 /** |
|
958 * Reserved method derived from CCoeControl |
|
959 */ |
|
960 IMPORT_C virtual void Reserved_2(); |
|
961 |
|
962 private: |
|
963 /** |
|
964 * From CAknControl |
|
965 */ |
|
966 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
967 |
|
968 /** |
|
969 * New reserved methods for CAknSettingPage hierarchy |
|
970 */ |
|
971 private: |
|
972 IMPORT_C virtual void CAknSettingPage_Reserved_1(); |
|
973 IMPORT_C virtual void CAknSettingPage_Reserved_2(); |
|
974 |
|
975 private: |
|
976 TInetAddr& iIpAddress; |
|
977 TInetAddr iBackupIpAddress; // Not a reference |
|
978 |
|
979 }; |
|
980 #endif |