|
1 /* |
|
2 * Copyright (c) 2002-2007 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: Implementation of query dialogs. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef AKNQUERYDIALOG_H |
|
20 #define AKNQUERYDIALOG_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikdialg.h> |
|
24 #include <AknForm.h> |
|
25 #include <eiklbx.h> |
|
26 #include <eiktxlbx.h> |
|
27 #include <eikcmobs.h> |
|
28 #include <aknpopuplayout.h> |
|
29 #include <aknintermediate.h> |
|
30 #include <aknQueryControl.h> |
|
31 #include <aknpopuplayout.h> |
|
32 #include <aknmultilinequerycontrol.h> |
|
33 #include <aknlistquerycontrol.h> |
|
34 #include <aknintermediate.h> |
|
35 #include <aknquerydata.h> |
|
36 #include <avkon.hrh> |
|
37 |
|
38 class CAknKeySoundSystem; |
|
39 class TInetAddr; |
|
40 class CAknQueryDialogExtension; |
|
41 class CAknMultilineQueryDialogExtension; |
|
42 |
|
43 /** |
|
44 * General query dialog |
|
45 * |
|
46 * Use for confirmation queries |
|
47 */ |
|
48 class CAknQueryDialog : public CAknDialog , public MAknQueryControlObserver |
|
49 { |
|
50 friend class CAknQueryDialogExtension; |
|
51 public: |
|
52 |
|
53 /** |
|
54 * Enumeration for tones. |
|
55 * |
|
56 * The tone played before the dialog is shown. Application specific |
|
57 * tones may be played by casting the application defined Sound ID |
|
58 * (SID), to @c TTone |
|
59 **/ |
|
60 enum TTone { |
|
61 |
|
62 /** |
|
63 * No tone is played |
|
64 */ |
|
65 ENoTone = 0, |
|
66 |
|
67 /** |
|
68 * A confirmation tone is played. |
|
69 */ |
|
70 EConfirmationTone = EAvkonSIDConfirmationTone, |
|
71 |
|
72 /** |
|
73 * A warning tone is played. |
|
74 */ |
|
75 EWarningTone = EAvkonSIDWarningTone, |
|
76 |
|
77 /** |
|
78 * An error tone is played. |
|
79 */ |
|
80 EErrorTone = EAvkonSIDErrorTone |
|
81 }; |
|
82 |
|
83 public: |
|
84 |
|
85 /** |
|
86 * Second phase construction required to align with multiline queries API |
|
87 * In future might use MAknQueryData mixin in the base class, hence requiring |
|
88 * second phase construction. |
|
89 * |
|
90 * @return pointer to CAknQueryDialog |
|
91 */ |
|
92 IMPORT_C static CAknQueryDialog* NewL(const TTone& aTone = ENoTone); |
|
93 |
|
94 /** |
|
95 * |
|
96 * @return pointer to CAknTextQueryDialog |
|
97 */ |
|
98 IMPORT_C static CAknQueryDialog* NewL(TDes& aText, const TTone& aTone = ENoTone); |
|
99 |
|
100 /** |
|
101 * |
|
102 * @return pointer to CAknNumberQueryDialog |
|
103 */ |
|
104 IMPORT_C static CAknQueryDialog* NewL(TInt& aNumber, const TTone& aTone = ENoTone); |
|
105 |
|
106 /** |
|
107 * |
|
108 * @return pointer to CAknTimeQueryDialog |
|
109 */ |
|
110 IMPORT_C static CAknQueryDialog* NewL(TTime& aTime, const TTone& aTone = ENoTone); |
|
111 |
|
112 /** |
|
113 * |
|
114 * @return pointer to CAknDurationQueryDialog |
|
115 */ |
|
116 IMPORT_C static CAknQueryDialog* NewL(TTimeIntervalSeconds& aTime, const TTone& aTone = ENoTone); |
|
117 |
|
118 /** |
|
119 * |
|
120 * @return pointer to CAknFloatQueryDialog |
|
121 */ |
|
122 IMPORT_C static CAknQueryDialog* NewL(TReal& aNumber, const TTone& aTone = ENoTone); |
|
123 |
|
124 /** |
|
125 * |
|
126 * @return pointer to CAknIpQueryDialog |
|
127 */ |
|
128 IMPORT_C static CAknQueryDialog* NewL(TInetAddr& aInetAddr, const TTone& aTone = ENoTone); |
|
129 |
|
130 /** |
|
131 * Not yet totally implemented! |
|
132 * |
|
133 * @return pointer to CAknLocationQueryDialog |
|
134 */ |
|
135 IMPORT_C static CAknQueryDialog* NewL(TPosition &aValue, const TTone &aTone = ENoTone); |
|
136 |
|
137 public: |
|
138 IMPORT_C virtual ~CAknQueryDialog(); |
|
139 |
|
140 /** |
|
141 * Construction |
|
142 * |
|
143 * @deprecated: will be made protected - use NewL |
|
144 */ |
|
145 IMPORT_C CAknQueryDialog(const TTone& aTone); |
|
146 |
|
147 public: |
|
148 |
|
149 /** |
|
150 * Return pointer to query heading or NULL |
|
151 * |
|
152 */ |
|
153 IMPORT_C virtual CAknPopupHeadingPane* QueryHeading() const; |
|
154 |
|
155 /** |
|
156 * Deprecated method to return pointer to query heading or NULL (use QueryHeading()) |
|
157 * |
|
158 * @deprecated - will be removed (use QueryHeading() method instead) |
|
159 */ |
|
160 IMPORT_C CAknPopupHeadingPane* Heading() const; |
|
161 |
|
162 /** |
|
163 * Set prompt text for query. This this will override text given in constructor. |
|
164 * |
|
165 * @param aPrompt Text for prompt |
|
166 */ |
|
167 IMPORT_C void SetPromptL(const TDesC& aPrompt); |
|
168 |
|
169 /** |
|
170 * Set visibility of the left softkey. Softkey is hidden when data in the query is not acceptable. |
|
171 * @param aVisible EFalse hides softkey label, ETrue shows it. |
|
172 */ |
|
173 IMPORT_C void MakeLeftSoftkeyVisible(TBool aVisible); |
|
174 |
|
175 /** |
|
176 * Enable or disable emergency call support. This method is only valid in |
|
177 * numeric queries (secret or normal). |
|
178 * |
|
179 * Default is Off for both. |
|
180 * |
|
181 * @param aOnOff Sets emergency call support active or inactive, if feature is available in |
|
182 * current type of control |
|
183 */ |
|
184 IMPORT_C void SetEmergencyCallSupport( TBool aOnOff ); |
|
185 |
|
186 /** |
|
187 * Removes the editor indicators for this dialog. |
|
188 * Used to ensure this dialog does not own any editor indicators. |
|
189 * before opening another dialog which outlasts this one. |
|
190 */ |
|
191 IMPORT_C void RemoveEditorIndicator(); |
|
192 |
|
193 /** |
|
194 * This method can be used to set predictive text entry permitted. The default |
|
195 * Query behaviour is to supress predictive entry (over-riding editor resource |
|
196 * flags that may indicate otherwise. |
|
197 * |
|
198 * This may be called at any time prior to activation of the query. |
|
199 * |
|
200 * @param aPermitted ETrue - allow predictive text entry |
|
201 * |
|
202 */ |
|
203 IMPORT_C void SetPredictiveTextInputPermitted( TBool aPermitted ); |
|
204 |
|
205 /** |
|
206 * Runs the querydialog and returns the ID of the button used to dismiss it. |
|
207 * The dialog is destroyed on exit. |
|
208 * |
|
209 */ |
|
210 IMPORT_C TInt RunLD(); |
|
211 |
|
212 /** |
|
213 * Call PrepareLC and display dialog. |
|
214 * |
|
215 * Identical to version in CEikDialog but need to override |
|
216 * this because of version with prompt, |
|
217 * compiler will complain if this is not implemented in |
|
218 * derived class as well |
|
219 * |
|
220 * @param aResourceId resource for query |
|
221 */ |
|
222 IMPORT_C TInt ExecuteLD(TInt aResourceId); |
|
223 |
|
224 /** |
|
225 * Call PrepareLC and display dialog. |
|
226 * |
|
227 * @param aResourceId resource for query |
|
228 * @param aPrompt text for query prompt |
|
229 */ |
|
230 IMPORT_C TInt ExecuteLD(TInt aResourceId, const TDesC& aPrompt); |
|
231 |
|
232 public:// from CCoeControl |
|
233 |
|
234 /** |
|
235 * From @c CCoeControl<p> |
|
236 * Handle key events. When a key event occurs, |
|
237 * until one of them returns EKeyWasConsumed to indicate that it processed the key event. |
|
238 * CONE calls this function for each control on the control stack, |
|
239 * @param aKeyEvent The key event. |
|
240 * @param aType The type of the event: EEventKey, EEventKeyUp or EEventKeyDown. |
|
241 * @return Indicates whether or not the key event was used by this control. |
|
242 */ |
|
243 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
244 |
|
245 /** |
|
246 * Handles pointer events |
|
247 */ |
|
248 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
249 |
|
250 public: |
|
251 |
|
252 /** |
|
253 * Return the maximum possible length of the query text |
|
254 * This is (in order of precedence, and assuming they are valid |
|
255 * i.e. less than or equal to the length of the descriptor passed to |
|
256 * return the value) dependent on:<p> |
|
257 * 1) aApiValue<p> |
|
258 * 2) Resource set value held in aControl<p> |
|
259 * 3) The MaxLength of the descriptor |
|
260 * @return maximum text length |
|
261 */ |
|
262 IMPORT_C static TInt MaxTextLength(const CAknQueryControl* aControl, const TDes& aDataText, TInt aApiValue) ; |
|
263 |
|
264 protected://from CEikdialog |
|
265 |
|
266 /** |
|
267 * From @c CEikdialog<p> |
|
268 * EIKON provides an implementation of this function, |
|
269 * which positions the dialog in the centre of the screen. |
|
270 * However, it can be overridden by derived classes. |
|
271 * @param aSize The size for the dialog. |
|
272 */ |
|
273 IMPORT_C void SetSizeAndPosition(const TSize& aSize); |
|
274 |
|
275 /** |
|
276 * From @c CEikdialog<p> |
|
277 * This function is called by the EIKON dialog framework just before the dialog is activated, but before it is sized, |
|
278 * and before PostLayoutDynInitL() is called. |
|
279 */ |
|
280 IMPORT_C void PreLayoutDynInitL(void); |
|
281 |
|
282 /** |
|
283 * From @c CEikdialog<p> |
|
284 * This function is called by the EIKON dialog framework just before the dialog is activated, |
|
285 * after it has called PreLayoutDynInitL() and the dialog has been sized. |
|
286 */ |
|
287 IMPORT_C void PostLayoutDynInitL(); |
|
288 |
|
289 /** |
|
290 * From @c CEikdialog<p> |
|
291 * This function is called by the EIKON framework |
|
292 * if the user activates a button in the button panel. |
|
293 * It is not called if the Cancel button is activated, |
|
294 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
295 * @param aButtonId The ID of the button that was activated |
|
296 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
297 */ |
|
298 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
299 |
|
300 public://from MAknQueryControlObeserver |
|
301 |
|
302 /** |
|
303 * From @c MAknQueryControlObserver<p> |
|
304 * Gets called when editor sends size event. |
|
305 * @param aQueryControl Pointer to query control which sent the event |
|
306 * @param aEventType Type of the event |
|
307 */ |
|
308 IMPORT_C TBool HandleQueryEditorSizeEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType); |
|
309 |
|
310 /** |
|
311 * From @c MAknQueryControlObserver<p> |
|
312 * Gets called when editor sends state event |
|
313 * @param aQueryControl Pointer to query control which sent the event |
|
314 * @param aEventType Type of the event |
|
315 * @param aStatus Editor validation status |
|
316 */ |
|
317 IMPORT_C TBool HandleQueryEditorStateEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType, TQueryValidationStatus aStatus); |
|
318 |
|
319 /** |
|
320 * Called by OfferkeyEventL(), gives a change to dismiss the query even with |
|
321 * keys different than Enter of Ok. |
|
322 */ |
|
323 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); |
|
324 |
|
325 /** |
|
326 * Called by NeedToDismissQueryL(), gives a change to either accept or reject |
|
327 * the query. Default implementation is to accept the query if the Left soft |
|
328 * key is displayed and reject it otherwise. Left softkey is only displayed if |
|
329 * the query has valid data into it. |
|
330 */ |
|
331 IMPORT_C virtual void DismissQueryL(); |
|
332 |
|
333 protected: |
|
334 |
|
335 /** |
|
336 * If the query text is ok (retrieved form query control) then display the |
|
337 * left soft key, otherwise hide it. |
|
338 */ |
|
339 IMPORT_C virtual void UpdateLeftSoftKeyL(); |
|
340 |
|
341 /** |
|
342 * Set the prompt inside the query control. If dialog is active redo |
|
343 * layout and draw. |
|
344 */ |
|
345 IMPORT_C virtual void DoSetPromptL(); |
|
346 |
|
347 /** |
|
348 * Return pointer to query control or NULL |
|
349 * |
|
350 */ |
|
351 IMPORT_C virtual CAknQueryControl* QueryControl() const; |
|
352 |
|
353 protected: //implementation, intended to be used but not overwritten |
|
354 |
|
355 /** |
|
356 * Plays tone |
|
357 */ |
|
358 void PlayTone(); |
|
359 |
|
360 /** |
|
361 * Resets system's inactivity timer |
|
362 */ |
|
363 void ReportUserActivity() const ; |
|
364 |
|
365 /** |
|
366 * Recreates layout and redraws the dialog |
|
367 */ |
|
368 void LayoutAndDraw(); |
|
369 |
|
370 /** |
|
371 * Returns left CBA short key press |
|
372 * @return Id of the left CBA |
|
373 */ |
|
374 TInt GetLeftCBAShortKeyPress(); |
|
375 |
|
376 /** |
|
377 * Returns right CBA short key press |
|
378 * @return Id of the right CBA |
|
379 */ |
|
380 TInt GetRightCBAShortKeyPress(); |
|
381 |
|
382 /** |
|
383 * Returns whether the left softkey is visible |
|
384 * @return ETrue is the left softkey is visible |
|
385 */ |
|
386 TBool IsLeftSoftkeyVisible(); |
|
387 |
|
388 protected: |
|
389 |
|
390 /** |
|
391 * Prompt access for derived classes |
|
392 */ |
|
393 IMPORT_C TPtrC Prompt() const; |
|
394 |
|
395 /** |
|
396 * @return query tone |
|
397 */ |
|
398 TTone& Tone() { return iTone; } |
|
399 |
|
400 /** |
|
401 * @return query tone |
|
402 */ |
|
403 const TTone& Tone() const { return iTone; } |
|
404 |
|
405 /** |
|
406 * @return query flags |
|
407 */ |
|
408 TBitFlags16& Flags() { return iFlags; } |
|
409 |
|
410 /** |
|
411 * @return query flags |
|
412 */ |
|
413 const TBitFlags16& Flags() const { return iFlags; } |
|
414 |
|
415 /** |
|
416 * @return query sound system |
|
417 */ |
|
418 CAknKeySoundSystem* SoundSystem() const { return iSoundSystem; } |
|
419 |
|
420 protected: // collected code for accessing Dialog state. |
|
421 |
|
422 /** |
|
423 * To be used to go through every control in the dialog, on every page, |
|
424 * in Dialog-internal storage order, until a control with that type is found. |
|
425 * If such a control is not found, a null pointer will be returned. |
|
426 * @param aControlType - Enum used to identify the control type on that CEikCaptionedControl Line |
|
427 * @param aLineIndex - Optional argument, if used contains reference to an int which holds the initial |
|
428 * line to start searching on, and on finding a control of that type, is |
|
429 * assigned the next position to start searching. |
|
430 * @param aPageIndex - Optional argument, if used contains reference to an int which holds the initial |
|
431 * dialog page to start searching on, and on finding a control of that type, is |
|
432 * assigned the page that the control was found on. |
|
433 * |
|
434 */ |
|
435 CCoeControl* FindControlOnAnyPageWithControlType(TInt aControlType, TInt* aLineIndex=0, TInt* aPageIndex=0) const; |
|
436 |
|
437 protected: |
|
438 |
|
439 /** |
|
440 * Tone which is played when the query is executed |
|
441 * These will be made private, use protected methods |
|
442 * |
|
443 * @deprecated. |
|
444 */ |
|
445 TTone iTone; |
|
446 |
|
447 /** Prompt text*/ |
|
448 TDesC *iPrompt; |
|
449 |
|
450 /** Caption Retriever*/ |
|
451 CAknQueryDialogExtension* iExtension; |
|
452 |
|
453 /** |
|
454 * Flags for emergency call support |
|
455 * Need these at least to store the ECS state until the control exists |
|
456 */ |
|
457 TBitFlags16 iFlags; |
|
458 |
|
459 /** Spare variable for further development */ |
|
460 TInt iSpare_1; |
|
461 |
|
462 /** Sound system*/ |
|
463 CAknKeySoundSystem* iSoundSystem; |
|
464 |
|
465 public: |
|
466 |
|
467 /** |
|
468 * @deprecated do not use |
|
469 */ |
|
470 IMPORT_C CAknQueryDialog(); |
|
471 |
|
472 /** |
|
473 * @deprecated do not use |
|
474 */ |
|
475 IMPORT_C CAknQueryDialog(TDesC& aPrompt,const TTone& aTone = ENoTone); |
|
476 |
|
477 /** |
|
478 * @deprecated - use QueryHeading() method instead |
|
479 */ |
|
480 IMPORT_C void SetHeaderTextL(const TDesC& aHeader); |
|
481 |
|
482 /** |
|
483 * @deprecated - use QueryHeading() method instead |
|
484 */ |
|
485 IMPORT_C void SetHeaderImageL(CEikImage* aImage); |
|
486 |
|
487 /** |
|
488 * @deprecated - use RunLD or ExecuteLD instead |
|
489 */ |
|
490 IMPORT_C TInt RunDlgLD(TInt aResourceId); |
|
491 |
|
492 /** |
|
493 * @deprecated - use other version of MaxTextLength |
|
494 */ |
|
495 IMPORT_C static TInt MaxTextLength(const CAknQueryControl* aControl, const TDes* aDataText, TInt aApiValue); |
|
496 |
|
497 private: |
|
498 //From CAknControl |
|
499 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
500 |
|
501 private: |
|
502 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
503 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
504 |
|
505 private: |
|
506 IMPORT_C virtual void CAknDialog_Reserved(); |
|
507 |
|
508 private:// new function |
|
509 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
510 |
|
511 public: |
|
512 /** |
|
513 * From CCoeControl. |
|
514 * Gets the control's input capabilities. |
|
515 * |
|
516 * @return The control's input capabilities. |
|
517 */ |
|
518 IMPORT_C TCoeInputCapabilities InputCapabilities() const; |
|
519 |
|
520 /** |
|
521 * Enable or disable support to change the CBA labels of the query |
|
522 * according to the current ECS state. It's necessary to enable this |
|
523 * alongside with ECS for touch and full screen queries. |
|
524 * |
|
525 * Note that if enabling this, then it's not necessary to call |
|
526 * @c SetEmergencyCallSupport( ETrue ) additionally, as when |
|
527 * enabling this, @c CAknQueryControl::EEmergencyCallsEnabledByAPI |
|
528 * will also be set. To enable the ECS via this method, it must |
|
529 * be called prior to @c PreLayoutDynamicInitL. |
|
530 * |
|
531 * If this is enabled for CAknQueryDialog-derived classes, then |
|
532 * the @c OkToExitL implementation of those should forward the |
|
533 * @c EAknSoftkeyEmergencyCall events to the base class' OkToExitL |
|
534 * for the emergency call event to be handled. |
|
535 * |
|
536 * This method is only valid in numeric queries (secret or normal), |
|
537 * default is Off for both. |
|
538 * |
|
539 * @param aOnOff @c ETrue to enable the ECS CBA support, |
|
540 * @c EFalse otherwise. |
|
541 */ |
|
542 IMPORT_C void SetEmergencyCallSupportForCBA( TBool aOnOff ); |
|
543 |
|
544 }; |
|
545 |
|
546 //------------------------------------- |
|
547 //class CAknTextQuerydialog |
|
548 //------------------------------------- |
|
549 |
|
550 //Deprecated |
|
551 #define CAknStaticSizeDataQuerydialog CAknTextQueryDialog |
|
552 |
|
553 /** |
|
554 *This class should be used when user is reguest to enter plain text, secret text, phonenumber or PIN-code |
|
555 */ |
|
556 class CAknTextQueryDialog : public CAknQueryDialog |
|
557 { |
|
558 |
|
559 public://construction and destruction |
|
560 |
|
561 /** |
|
562 * Second phase construction required to align API with multiline queries |
|
563 * and because in future MAknQueryData will be used. |
|
564 */ |
|
565 IMPORT_C static CAknTextQueryDialog* NewL(TDes& aDataText, const TTone& aTone = ENoTone); |
|
566 |
|
567 public: |
|
568 |
|
569 /** |
|
570 * C++ Constructor. |
|
571 * |
|
572 */ |
|
573 IMPORT_C CAknTextQueryDialog(TDes& aDataText, const TTone& aTone = ENoTone); |
|
574 |
|
575 /** |
|
576 * C++ Destructor. |
|
577 */ |
|
578 IMPORT_C virtual ~CAknTextQueryDialog(); |
|
579 |
|
580 public://New functions |
|
581 |
|
582 /** |
|
583 * Set max lenght for editor. This overrides the max lenght given in resource. |
|
584 * |
|
585 * @param aLength Max lenght. |
|
586 */ |
|
587 IMPORT_C void SetMaxLength(TInt aLength); |
|
588 |
|
589 /** |
|
590 * Return true if the length of the text is bigger |
|
591 * than zero and if there |
|
592 * is at least a character which is not a space |
|
593 */ |
|
594 IMPORT_C virtual TBool CheckIfEntryTextOk() const; |
|
595 |
|
596 /** |
|
597 * Changes default input mode of a secret editor. By default input mode |
|
598 * in secret editor is alpha input mode (EAknEditorSecretAlphaInputMode |
|
599 * from uikon.hrh). By using this method the default input mode can be |
|
600 * changed to numeric input mode (EAknEditorNumericInputMode). |
|
601 * |
|
602 * @since 2.1 |
|
603 * @param aInputMode Default input mode in the secret editor. |
|
604 * Only EAknEditorNumericInputMode and EAknEditorSecretAlphaInputMode |
|
605 * are supported. |
|
606 */ |
|
607 IMPORT_C void SetDefaultInputMode(TInt aInputMode); |
|
608 |
|
609 protected://from CEikDialog |
|
610 |
|
611 /** |
|
612 * From @c CEikdialog<p> |
|
613 * This function is called by the EIKON dialog framework |
|
614 * just before the dialog is activated, after it has called |
|
615 * PreLayoutDynInitL() and the dialog has been sized. |
|
616 */ |
|
617 IMPORT_C void PreLayoutDynInitL(); |
|
618 |
|
619 /** |
|
620 * From @c CEikdialog<p> |
|
621 * This function is called by the EIKON framework |
|
622 * if the user activates a button in the button panel. |
|
623 * It is not called if the Cancel button is activated, |
|
624 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
625 * @param aButtonId The ID of the button that was activated |
|
626 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
627 */ |
|
628 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
629 |
|
630 public://from MAknQueryControlObserver |
|
631 |
|
632 /** |
|
633 * From @c MAknQueryControlObserver<p> |
|
634 * Gets called when editor sends size event |
|
635 * @param aQueryControl Pointer to query control which sent the event |
|
636 * @param aEventType Type of the event |
|
637 */ |
|
638 IMPORT_C TBool HandleQueryEditorSizeEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType); |
|
639 |
|
640 public://from CCoeControl |
|
641 |
|
642 /** |
|
643 * Handles pointer events |
|
644 */ |
|
645 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
646 |
|
647 protected: |
|
648 |
|
649 /** |
|
650 * Called by PreLayoutDynInit(), set the control observer, the text and |
|
651 * the maximum length of the text |
|
652 */ |
|
653 void SetControlTextL(); |
|
654 |
|
655 /** |
|
656 * @return data |
|
657 */ |
|
658 inline TDes& Text() { return iDataText; } |
|
659 |
|
660 /** |
|
661 * @return data |
|
662 */ |
|
663 inline const TDesC& Text() const { return iDataText; } |
|
664 |
|
665 protected: |
|
666 |
|
667 /** |
|
668 * Max length for text |
|
669 * |
|
670 * @deprecated |
|
671 * This data will become private |
|
672 * Use Text() and MaxTextLength() instead |
|
673 */ |
|
674 TInt iTextMaxLength; |
|
675 |
|
676 /** |
|
677 * Text for editor. When query is approved text from editor is stored here |
|
678 */ |
|
679 TDes& iDataText; |
|
680 |
|
681 /** @deprecated - not used anymore */ |
|
682 TBool iEditorTextOk; |
|
683 |
|
684 public: |
|
685 |
|
686 /** |
|
687 * deprecated do not use |
|
688 */ |
|
689 IMPORT_C CAknTextQueryDialog(TDes& aDataText, TDesC& aPrompt,const TTone& aTone = ENoTone); |
|
690 |
|
691 private: |
|
692 /** |
|
693 * From CAknControl |
|
694 */ |
|
695 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
696 |
|
697 private: |
|
698 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
699 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
700 |
|
701 private: |
|
702 IMPORT_C virtual void CAknDialog_Reserved(); |
|
703 |
|
704 private: |
|
705 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
706 |
|
707 private: // Data |
|
708 TInt iSpare; |
|
709 }; |
|
710 |
|
711 //--------------------------------- |
|
712 //class CAknNumberQuerydialog |
|
713 //--------------------------------- |
|
714 |
|
715 /** |
|
716 *This class should be used when user is reguest to enter number |
|
717 */ |
|
718 class CAknNumberQueryDialog : public CAknQueryDialog |
|
719 { |
|
720 |
|
721 public: |
|
722 |
|
723 /** |
|
724 * Second phase construction required to align API with multiline queries |
|
725 * and because in future MAknQueryData will be used. |
|
726 */ |
|
727 IMPORT_C static CAknNumberQueryDialog* NewL(TInt& aNumber, const TTone& aTone = ENoTone); |
|
728 |
|
729 public: |
|
730 |
|
731 /** |
|
732 * C++ Constructor. |
|
733 */ |
|
734 IMPORT_C CAknNumberQueryDialog(TInt& aNumber, const TTone& aTone = ENoTone); |
|
735 |
|
736 /** |
|
737 * C++ Destructor. |
|
738 */ |
|
739 IMPORT_C virtual ~CAknNumberQueryDialog(); |
|
740 |
|
741 public: |
|
742 |
|
743 /** |
|
744 * Set maximum and minimum to editor. This override values given in resource. |
|
745 * |
|
746 * @param aMinimumValue Minimumm number |
|
747 * @param aMaximumValue Maximum number. |
|
748 */ |
|
749 IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted |
|
750 |
|
751 public://from CCoeControl |
|
752 |
|
753 /** |
|
754 * Handles pointer events |
|
755 */ |
|
756 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
757 |
|
758 protected://from CEikDialog |
|
759 |
|
760 /** |
|
761 * From @c CEikdialog<p> |
|
762 * This function is called by the EIKON dialog framework |
|
763 * just before the dialog is activated, after it has called |
|
764 * PreLayoutDynInitL() and the dialog has been sized. |
|
765 */ |
|
766 IMPORT_C void PreLayoutDynInitL(); |
|
767 |
|
768 /** |
|
769 * From @c CEikdialog<p> |
|
770 * This function is called by the EIKON framework |
|
771 * if the user activates a button in the button panel. |
|
772 * It is not called if the Cancel button is activated, |
|
773 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
774 * @param aButtonId The ID of the button that was activated |
|
775 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
776 */ |
|
777 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
778 |
|
779 /** |
|
780 * @return data |
|
781 */ |
|
782 inline TInt& Number() { return iNumber; } |
|
783 |
|
784 /** |
|
785 * @return data |
|
786 */ |
|
787 inline const TInt& Number() const { return iNumber; } |
|
788 |
|
789 private: |
|
790 /** |
|
791 * From CAknControl |
|
792 */ |
|
793 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
794 |
|
795 private: |
|
796 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
797 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
798 |
|
799 private: |
|
800 IMPORT_C virtual void CAknDialog_Reserved(); |
|
801 |
|
802 private: |
|
803 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
804 |
|
805 protected: |
|
806 |
|
807 /** |
|
808 * @deprecated - will become private - use Number() instead |
|
809 */ |
|
810 TInt& iNumber; |
|
811 |
|
812 private: // Data |
|
813 TInt iSpare; |
|
814 }; |
|
815 |
|
816 //------------------------------------- |
|
817 //class CAknTimeQueryDialog |
|
818 //------------------------------------- |
|
819 |
|
820 /** |
|
821 *This class should be used when user is reguest to enter time or date |
|
822 */ |
|
823 class CAknTimeQueryDialog : public CAknQueryDialog |
|
824 { |
|
825 |
|
826 public: |
|
827 |
|
828 /** |
|
829 * Second phase construction required to align API with multiline queries |
|
830 * and because in future MAknQueryData will be used. |
|
831 */ |
|
832 IMPORT_C static CAknTimeQueryDialog* NewL(TTime& aTime, const TTone& aTone = ENoTone); |
|
833 |
|
834 public: |
|
835 |
|
836 /** |
|
837 * C++ Constructor |
|
838 */ |
|
839 IMPORT_C CAknTimeQueryDialog(TTime& aTime, const TTone& aTone = ENoTone); |
|
840 |
|
841 /** |
|
842 * C++ Destructor. |
|
843 */ |
|
844 IMPORT_C virtual ~CAknTimeQueryDialog(); |
|
845 |
|
846 public://New functions |
|
847 |
|
848 /** |
|
849 * Set maximum and minimum times to editor. This override values given in resource. |
|
850 * Only values inside the initial minimum and maximum are permitted |
|
851 * |
|
852 * @param aMinimum Minimumm time |
|
853 * @param aMaximum Maximum time. |
|
854 */ |
|
855 IMPORT_C void SetMinimumAndMaximum(const TTime& aMinimum, const TTime& aMaximum); |
|
856 |
|
857 public://From CCoeControl |
|
858 |
|
859 /** |
|
860 * Handles pointer events |
|
861 */ |
|
862 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
863 |
|
864 protected://from CEikDialog |
|
865 |
|
866 /** |
|
867 * From @c CEikdialog<p> |
|
868 * This function is called by the EIKON dialog framework |
|
869 * just before the dialog is activated, after it has called |
|
870 * PreLayoutDynInitL() and the dialog has been sized. |
|
871 */ |
|
872 IMPORT_C void PreLayoutDynInitL(); |
|
873 |
|
874 /** |
|
875 * From @c CEikdialog<p> |
|
876 * This function is called by the EIKON framework |
|
877 * if the user activates a button in the button panel. |
|
878 * It is not called if the Cancel button is activated, |
|
879 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
880 * @param aButtonId The ID of the button that was activated |
|
881 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
882 */ |
|
883 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
884 |
|
885 /** |
|
886 * @return data |
|
887 */ |
|
888 inline TTime& Time() { return iTime; } |
|
889 |
|
890 /** |
|
891 * @return data |
|
892 */ |
|
893 inline const TTime& Time() const { return iTime; } |
|
894 |
|
895 protected: |
|
896 |
|
897 /** |
|
898 * @deprecated - will become private - use Time() instead |
|
899 */ |
|
900 TTime& iTime; |
|
901 |
|
902 public: |
|
903 |
|
904 /** |
|
905 * deprecated - do not use |
|
906 */ |
|
907 IMPORT_C CAknTimeQueryDialog(TTime& aTime,TDesC& aPrompt,const TTone& aTone = ENoTone); |
|
908 |
|
909 private: |
|
910 /** |
|
911 * From CAknControl |
|
912 */ |
|
913 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
914 |
|
915 private: |
|
916 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
917 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
918 |
|
919 private: |
|
920 IMPORT_C virtual void CAknDialog_Reserved(); |
|
921 |
|
922 private: |
|
923 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
924 |
|
925 private: // Data |
|
926 TInt iSpare; |
|
927 }; |
|
928 |
|
929 //---------------------------------- |
|
930 //class CAknDurationQuerydialog |
|
931 //---------------------------------- |
|
932 |
|
933 /** |
|
934 *This class should be used when user is reguest to enter duration |
|
935 */ |
|
936 class CAknDurationQueryDialog : public CAknQueryDialog |
|
937 { |
|
938 |
|
939 public: |
|
940 |
|
941 /** |
|
942 * Second phase construction required to align API with multiline queries |
|
943 * and because in future MAknQueryData will be used. |
|
944 */ |
|
945 IMPORT_C static CAknDurationQueryDialog* NewL(TTimeIntervalSeconds& aTime, const TTone& aTone = ENoTone); |
|
946 |
|
947 public: |
|
948 |
|
949 /** |
|
950 * - deprecated (use NewL instead) |
|
951 */ |
|
952 IMPORT_C CAknDurationQueryDialog(TTimeIntervalSeconds& aDuration, const TTone& aTone = ENoTone); |
|
953 |
|
954 /** |
|
955 * C++ Destructor. |
|
956 */ |
|
957 IMPORT_C virtual ~CAknDurationQueryDialog(); |
|
958 |
|
959 public://new |
|
960 |
|
961 /** |
|
962 * Set maximum and minimum durations to editor. This override values given in resource. |
|
963 * Only values inside the initial minimum and maximum are permitted. |
|
964 * |
|
965 * @param aMinimumDuration Minimumm duration |
|
966 * @param aMaximumDuration Maximum duration. |
|
967 */ |
|
968 IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration); |
|
969 |
|
970 public: // From CCoeControl |
|
971 |
|
972 /** |
|
973 * Handles pointer events |
|
974 */ |
|
975 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
976 |
|
977 protected://from CEikDialog |
|
978 |
|
979 /** |
|
980 * From @c CEikdialog<p> |
|
981 * This function is called by the EIKON dialog framework |
|
982 * just before the dialog is activated, after it has called |
|
983 * PreLayoutDynInitL() and the dialog has been sized. |
|
984 */ |
|
985 IMPORT_C void PreLayoutDynInitL(); |
|
986 |
|
987 /** |
|
988 * From @c CEikdialog<p> |
|
989 * This function is called by the EIKON framework |
|
990 * if the user activates a button in the button panel. |
|
991 * It is not called if the Cancel button is activated, |
|
992 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
993 * @param aButtonId The ID of the button that was activated |
|
994 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
995 */ |
|
996 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
997 |
|
998 /** |
|
999 * @return data |
|
1000 */ |
|
1001 inline TTimeIntervalSeconds& Duration() { return iDuration; } |
|
1002 |
|
1003 /** |
|
1004 * @return data |
|
1005 */ |
|
1006 inline const TTimeIntervalSeconds& Duration() const { return iDuration; } |
|
1007 |
|
1008 private: |
|
1009 /** |
|
1010 * From CAknControl |
|
1011 */ |
|
1012 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
1013 |
|
1014 private: |
|
1015 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
1016 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
1017 |
|
1018 private: |
|
1019 IMPORT_C virtual void CAknDialog_Reserved(); |
|
1020 |
|
1021 private: |
|
1022 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
1023 |
|
1024 protected: |
|
1025 /** |
|
1026 * @deprecated - will become private. Use Duration() instead. |
|
1027 */ |
|
1028 TTimeIntervalSeconds& iDuration; |
|
1029 |
|
1030 private: // Data |
|
1031 TInt iSpare; |
|
1032 }; |
|
1033 |
|
1034 //---------------------------------- |
|
1035 //class CAknFloatingPointQueryDialog |
|
1036 //---------------------------------- |
|
1037 |
|
1038 /** |
|
1039 *This class should be used when user is reguest to enter a flotaing point number |
|
1040 */ |
|
1041 class CAknFloatingPointQueryDialog : public CAknQueryDialog |
|
1042 { |
|
1043 |
|
1044 public: |
|
1045 /** |
|
1046 * Second phase construction required to align API with multiline queries |
|
1047 * and because in future MAknQueryData will be used. |
|
1048 */ |
|
1049 IMPORT_C static CAknFloatingPointQueryDialog* NewL(TReal& aNumber, const TTone& aTone = ENoTone); |
|
1050 |
|
1051 public: |
|
1052 /** |
|
1053 * deprecated (use NewL instead) |
|
1054 */ |
|
1055 IMPORT_C CAknFloatingPointQueryDialog(TReal& aNumber, const TTone& aTone = ENoTone); |
|
1056 |
|
1057 /** |
|
1058 * C++ Destructor. |
|
1059 */ |
|
1060 IMPORT_C virtual ~CAknFloatingPointQueryDialog(); |
|
1061 |
|
1062 public: |
|
1063 /** |
|
1064 * Set maximum and minimum durations to editor. This override values given in resource. |
|
1065 * only values inside the initial minimum and maximum are permitted |
|
1066 * |
|
1067 * @param aMinimumNumber Minimumm duration |
|
1068 * @param aMaximumNumber Maximum duration. |
|
1069 */ |
|
1070 IMPORT_C void SetMinimumAndMaximum(const TReal& aMinimumNumber, const TReal& aMaximumNumber); |
|
1071 |
|
1072 public://From CCoeControl |
|
1073 |
|
1074 /** |
|
1075 * Handles pointer events |
|
1076 */ |
|
1077 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
1078 |
|
1079 protected://from CEikDialog |
|
1080 |
|
1081 /** |
|
1082 * From @c CEikdialog<p> |
|
1083 * This function is called by the EIKON dialog framework |
|
1084 * just before the dialog is activated, after it has called |
|
1085 * PreLayoutDynInitL() and the dialog has been sized. |
|
1086 */ |
|
1087 IMPORT_C void PreLayoutDynInitL(); |
|
1088 |
|
1089 /** |
|
1090 * From @c CEikdialog<p> |
|
1091 * This function is called by the EIKON framework |
|
1092 * if the user activates a button in the button panel. |
|
1093 * It is not called if the Cancel button is activated, |
|
1094 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
1095 * @param aButtonId The ID of the button that was activated |
|
1096 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
1097 */ |
|
1098 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
1099 |
|
1100 /** |
|
1101 * @return data |
|
1102 */ |
|
1103 inline TReal& Number() { return iNumber; } |
|
1104 |
|
1105 /** |
|
1106 * @return data |
|
1107 */ |
|
1108 inline const TReal& Number() const { return iNumber; } |
|
1109 |
|
1110 private: |
|
1111 /** |
|
1112 * From CAknControl |
|
1113 */ |
|
1114 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
1115 |
|
1116 private: |
|
1117 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
1118 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
1119 |
|
1120 private: |
|
1121 IMPORT_C virtual void CAknDialog_Reserved(); |
|
1122 |
|
1123 private: |
|
1124 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
1125 |
|
1126 protected: |
|
1127 /** |
|
1128 * @deprecated - will become private - use Number() instead |
|
1129 */ |
|
1130 TReal& iNumber; |
|
1131 |
|
1132 private: |
|
1133 TInt iSpare; |
|
1134 }; |
|
1135 |
|
1136 |
|
1137 //-------------------------------------- |
|
1138 //class CAknMultilineDataQuerydialog |
|
1139 //-------------------------------------- |
|
1140 |
|
1141 /** |
|
1142 * Query dialog with data input on more than one line (2 lines at the moment). |
|
1143 * |
|
1144 * Object of this class is created by using NewL method and by passing |
|
1145 * parameters as appropriate. |
|
1146 * |
|
1147 * Attention: When deriving from this class, you must call @c SetDataL() during |
|
1148 * second phase construction. |
|
1149 * |
|
1150 * Enumeration for tones. The tone played before the dialog is shown. |
|
1151 * Application specific tones may be played by casting the application defined |
|
1152 * Sound ID @c (SID), to @c TTone. |
|
1153 * |
|
1154 * Enumeration values: <br> |
|
1155 * @c ENoTone No tone is played.<br> |
|
1156 * @c EConfirmationTone A confirmation tone is played. <br> |
|
1157 * @c EWarningTone A warning tone is played. <br> |
|
1158 * @c EErrorTone An error tone is played. <br> |
|
1159 */ |
|
1160 class CAknMultiLineDataQueryDialog : public CAknQueryDialog |
|
1161 { |
|
1162 friend class CAknMultilineQueryDialogExtension; |
|
1163 |
|
1164 public: |
|
1165 |
|
1166 /** |
|
1167 * Creates a new instance of a multiline dialog. |
|
1168 * |
|
1169 * @param aTime1 First line parameter. |
|
1170 * @param aTime2 Second line parameter. |
|
1171 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1172 * ENoTone. |
|
1173 * @return Pointer to a multiline dialog object. |
|
1174 */ |
|
1175 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1176 TTime& aTime1, |
|
1177 TTime& aTime2, |
|
1178 TTone aTone = ENoTone); |
|
1179 |
|
1180 /** |
|
1181 * Creates a new instance of a multiline dialog. |
|
1182 * |
|
1183 * @param aText1 First line parameter. |
|
1184 * @param aText2 Second line parameter. |
|
1185 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1186 * ENoTone. |
|
1187 * @return Pointer to a multiline dialog object. |
|
1188 */ |
|
1189 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1190 TDes& aText1, |
|
1191 TDes& aText2, |
|
1192 TTone aTone = ENoTone); |
|
1193 |
|
1194 /** |
|
1195 * Creates a new instance of a multiline dialog. |
|
1196 * |
|
1197 * @param aText1 First line parameter. |
|
1198 * @param aTime2 Second line parameter. |
|
1199 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1200 * ENoTone. |
|
1201 * @return Pointer to a multiline dialog object. |
|
1202 */ |
|
1203 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1204 TDes& aText1, |
|
1205 TTime& aTime2, |
|
1206 TTone aTone = ENoTone); |
|
1207 |
|
1208 /** |
|
1209 * Creates a new instance of a multiline dialog. |
|
1210 * |
|
1211 * @param aText1 First line parameter. |
|
1212 * @param aNum2 Second line parameter. |
|
1213 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1214 * ENoTone. |
|
1215 * @return Pointer to a multiline dialog object. |
|
1216 */ |
|
1217 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1218 TDes& aText1, |
|
1219 TInt& aNum2, |
|
1220 TTone aTone = ENoTone); |
|
1221 |
|
1222 /** |
|
1223 * Creates a new instance of a multiline dialog. |
|
1224 * |
|
1225 * @param aText1 First line parameter. |
|
1226 * @param aDur2 Second line parameter. |
|
1227 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1228 * ENoTone. |
|
1229 * @return Pointer to a multiline dialog object. |
|
1230 */ |
|
1231 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1232 TDes& aText1, |
|
1233 TTimeIntervalSeconds& aDur2, |
|
1234 TTone aTone = ENoTone); |
|
1235 |
|
1236 /** |
|
1237 * Creates a new instance of a multiline dialog. |
|
1238 * |
|
1239 * @param aTime1 First line parameter. |
|
1240 * @param aDur2 Second line parameter. |
|
1241 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1242 * ENoTone. |
|
1243 * @return Pointer to a multiline dialog object. |
|
1244 */ |
|
1245 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1246 TTime& aTime1, |
|
1247 TTimeIntervalSeconds& aDur2, |
|
1248 TTone aTone = ENoTone); |
|
1249 |
|
1250 /** |
|
1251 * Creates a new instance of a multiline dialog. |
|
1252 * |
|
1253 * @param aNum1 First line parameter. |
|
1254 * @param aNum2 Second line parameter. |
|
1255 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1256 * ENoTone. |
|
1257 * @return Pointer to multiline dialog object. |
|
1258 */ |
|
1259 IMPORT_C static CAknMultiLineDataQueryDialog* NewL( |
|
1260 TInt& aNum1, |
|
1261 TInt& aNum2, |
|
1262 TTone aTone = ENoTone); |
|
1263 |
|
1264 /** |
|
1265 * Creates a new instance of a multiline dialog. |
|
1266 * |
|
1267 * @param aPos Position parameter. |
|
1268 * @param aTone Reference to @c TTone enumeration. Default is @c |
|
1269 * ENoTone. |
|
1270 * @return Pointer to multiline dialog object. |
|
1271 */ |
|
1272 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(TPosition &aPos, TTone aTone = ENoTone); |
|
1273 |
|
1274 |
|
1275 /** |
|
1276 * Destructor. |
|
1277 */ |
|
1278 IMPORT_C virtual ~CAknMultiLineDataQueryDialog(); |
|
1279 |
|
1280 protected: |
|
1281 |
|
1282 /** |
|
1283 * Sets the query data for the first and the second line. Must be |
|
1284 * called by derived classes during second phase construction (@c |
|
1285 * NewL() method). |
|
1286 */ |
|
1287 template <class T1, class T2> void SetDataL(T1& aData1, T2& aData2) |
|
1288 { |
|
1289 /** First line data. */ |
|
1290 iFirstData = new (ELeave) TAknQueryData<T1>(aData1); |
|
1291 |
|
1292 /** Second line data. */ |
|
1293 iSecondData = new (ELeave) TAknQueryData<T2>(aData2); |
|
1294 } |
|
1295 |
|
1296 /** |
|
1297 * Utility function called by @c NewL() method - should really be |
|
1298 * private but it is left here to show to people extending this class |
|
1299 * what their @c NewL() method should do. |
|
1300 * |
|
1301 * Creates new instance of the multiline dialog. |
|
1302 * |
|
1303 * @param aData1 First line parameter. |
|
1304 * @param aData2 Second line parameter. |
|
1305 * @param aTone Reference to @c TTone enum. |
|
1306 */ |
|
1307 |
|
1308 template <class T1, class T2> static CAknMultiLineDataQueryDialog* |
|
1309 DoNewL(T1& aData1, T2& aData2, const TTone& aTone) |
|
1310 { |
|
1311 CAknMultiLineDataQueryDialog* self = |
|
1312 new (ELeave) CAknMultiLineDataQueryDialog(aTone); |
|
1313 |
|
1314 CleanupStack::PushL(self); |
|
1315 |
|
1316 self->SetDataL(aData1,aData2); |
|
1317 |
|
1318 CleanupStack::Pop(self); |
|
1319 return self; |
|
1320 } |
|
1321 |
|
1322 protected: |
|
1323 |
|
1324 /** |
|
1325 * C++ default constructor. |
|
1326 * |
|
1327 * @param aTone Reference to @c TTone enumeration. |
|
1328 */ |
|
1329 IMPORT_C CAknMultiLineDataQueryDialog(const TTone& aTone); |
|
1330 |
|
1331 public: |
|
1332 |
|
1333 /** |
|
1334 * Sets a prompt text for the query. This will override the text given |
|
1335 * in the constructor. |
|
1336 * |
|
1337 * @param aFirstPrompt Text for prompt on the first query line. |
|
1338 * @param aSecondPrompt Text for prompt on the second query line. |
|
1339 */ |
|
1340 IMPORT_C void SetPromptL(const TDesC& aFirstPrompt, |
|
1341 const TDesC& aSecondPrompt); |
|
1342 |
|
1343 public: |
|
1344 |
|
1345 /** |
|
1346 * Sets a max length for the first editor in a query. |
|
1347 * |
|
1348 * @param aFirstTextEditorMaxLength Max length for editor |
|
1349 */ |
|
1350 IMPORT_C void SetMaxLengthOfFirstEditor( |
|
1351 TInt aFirstTextEditorMaxLength); |
|
1352 |
|
1353 /** |
|
1354 * Sets a max length for the second editor in a query. |
|
1355 * |
|
1356 * @param aSecondTextEditorMaxLength Max length for editor. |
|
1357 */ |
|
1358 IMPORT_C void SetMaxLengthOfSecondEditor( |
|
1359 TInt aSecondTextEditorMaxLength); |
|
1360 |
|
1361 public: // From CCoeControl |
|
1362 |
|
1363 /** |
|
1364 * From @c CCoeControl. |
|
1365 * |
|
1366 * Handles pointer events. |
|
1367 * |
|
1368 * @param aPointerEvent The pointer event. |
|
1369 */ |
|
1370 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
1371 |
|
1372 protected://from CEikDialog |
|
1373 |
|
1374 /** |
|
1375 * From @c CEikdialog<p> |
|
1376 * This function is called by the @c EIKON framework if the user |
|
1377 * activates a button in the button panel. It is not called if the @c |
|
1378 * Cancel button is activated, unless the @c EEikDialogFlagNotifyEsc |
|
1379 * flag is set. |
|
1380 * |
|
1381 * @param aButtonId The ID of the button that was activated. |
|
1382 * @return @c ETrue if the dialog should exit and @c |
|
1383 * EFalse if it should not exit. |
|
1384 */ |
|
1385 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
1386 |
|
1387 /** |
|
1388 * From @c CEikdialog<p> |
|
1389 * This function is called by the EIKON dialog framework |
|
1390 * just before the dialog is activated, after it has called |
|
1391 * PreLayoutDynInitL() and the dialog has been sized. |
|
1392 * Note:<p> |
|
1393 * Control values that should not influence the sizing and layout are |
|
1394 * set using @c PostLayoutDynInitL(). |
|
1395 */ |
|
1396 IMPORT_C void PreLayoutDynInitL(); |
|
1397 |
|
1398 /** |
|
1399 * From @c CCoeControl. |
|
1400 * |
|
1401 * Handles a change to the control's resources. The types of resources |
|
1402 * handled are those which are shared across the environment, e.g. |
|
1403 * colours or fonts. |
|
1404 * |
|
1405 * @since Symbian 5.1. |
|
1406 * |
|
1407 * @param aType A message UID value. The most common is @c |
|
1408 * KEikMessageColorSchemeChange which controls get when the |
|
1409 * colour scheme is changed. Other examples include: @c |
|
1410 * KEikMessageFadeAllWindows, @c KEikMessageUnfadeWindows, @c |
|
1411 * KEikMessageZoomChange, @c |
|
1412 * KEikMessageVirtualCursorStateChange, @c KEikMessageCapsLock, |
|
1413 * @c KEikMessagePrepareForSave. |
|
1414 */ |
|
1415 IMPORT_C void HandleResourceChange(TInt aType); |
|
1416 |
|
1417 protected: |
|
1418 |
|
1419 /** |
|
1420 * If the query text is ok (retrieved form query controls) the left |
|
1421 * soft key is displayed, otherwise it is hidden. |
|
1422 */ |
|
1423 IMPORT_C void UpdateLeftSoftKeyL(); |
|
1424 |
|
1425 /** |
|
1426 * Sets the prompt inside the query control. |
|
1427 */ |
|
1428 IMPORT_C void DoSetPromptL(); |
|
1429 |
|
1430 protected: |
|
1431 |
|
1432 /** |
|
1433 * Allows dismissing of queries. Same as base class implementation only take into |
|
1434 * consideration both controls |
|
1435 */ |
|
1436 IMPORT_C TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); |
|
1437 |
|
1438 protected: |
|
1439 |
|
1440 /** |
|
1441 * Access to 1st query control |
|
1442 * |
|
1443 * @return Pointer to the control of the first line. |
|
1444 */ |
|
1445 IMPORT_C CAknMultilineQueryControl* FirstControl() const; |
|
1446 |
|
1447 /** |
|
1448 * Access to 2nd query control |
|
1449 * |
|
1450 * @return Pointer to the control of the second line. |
|
1451 */ |
|
1452 IMPORT_C CAknMultilineQueryControl* SecondControl() const; |
|
1453 |
|
1454 /** |
|
1455 * Gets a querycontrol. |
|
1456 * |
|
1457 * @return Pointer to the control of the first line. |
|
1458 */ |
|
1459 IMPORT_C CAknQueryControl* QueryControl() const; |
|
1460 |
|
1461 /** |
|
1462 * Not implemented. |
|
1463 * |
|
1464 * @return NULL. |
|
1465 */ |
|
1466 IMPORT_C CAknPopupHeadingPane* QueryHeading() const; |
|
1467 |
|
1468 protected: |
|
1469 |
|
1470 /** |
|
1471 * Data access. |
|
1472 * |
|
1473 * Derived class can use this method to get access to the query |
|
1474 * data. The query data is a reference stored in @c TAknQueryData, see |
|
1475 * @c aknquerydata.h |
|
1476 * |
|
1477 * The client ultimately owns the data this reference references and so |
|
1478 * it should never need to call these methods. |
|
1479 * |
|
1480 * Derived class however, might need to set or get the data and hence |
|
1481 * this method have been provided. The derived class is responsible |
|
1482 * for choosing the correct type, if not the cast will fail. |
|
1483 */ |
|
1484 template<class T> |
|
1485 T& FirstData(const T&) |
|
1486 { return STATIC_CAST(TAknQueryData<T>*,iFirstData)->iData; } |
|
1487 |
|
1488 /** |
|
1489 * Data access. |
|
1490 * |
|
1491 * Derived class can use this method to get access to the query |
|
1492 * data. The query data is a reference stored in @c TAknQueryData, see |
|
1493 * @c aknquerydata.h |
|
1494 * |
|
1495 * The client ultimately owns the data this reference references and so |
|
1496 * it should never need to call these methods. |
|
1497 * |
|
1498 * Derived class however, might need to set or get the data and hence |
|
1499 * this method have been provided. The derived class is responsible |
|
1500 * for choosing the correct type, if not the cast will fail. |
|
1501 */ |
|
1502 template<class T> |
|
1503 T& SecondData(const T&) |
|
1504 { return STATIC_CAST(TAknQueryData<T>*,iSecondData)->iData; } |
|
1505 |
|
1506 /** |
|
1507 * Data access. |
|
1508 * |
|
1509 * Derived class can use this method to get access to the query |
|
1510 * data. The query data is a reference stored in @c TAknQueryData, see |
|
1511 * @c aknquerydata.h |
|
1512 * |
|
1513 * The client ultimately owns the data this reference references and so |
|
1514 * it should never need to call these methods. |
|
1515 * |
|
1516 * Derived class however, might need to set or get the data and hence |
|
1517 * this method have been provided. The derived class is responsible |
|
1518 * for choosing the correct type, if not the cast will fail. |
|
1519 */ |
|
1520 template<class T> |
|
1521 const T& FirstData(const T&) const |
|
1522 { return STATIC_CAST(TAknQueryData<T>*,iFirstData)->iData; } |
|
1523 |
|
1524 /** |
|
1525 * Data access. |
|
1526 * |
|
1527 * Derived class can use this method to get access to the query |
|
1528 * data. The query data is a reference stored in @c TAknQueryData, see |
|
1529 * @c aknquerydata.h |
|
1530 * |
|
1531 * The client ultimately owns the data this reference references and so |
|
1532 * it should never need to call these methods. |
|
1533 * |
|
1534 * Derived class however, might need to set or get the data and hence |
|
1535 * this method have been provided. The derived class is responsible |
|
1536 * for choosing the correct type, if not the cast will fail. |
|
1537 */ |
|
1538 template<class T> |
|
1539 const T& SecondData(const T&) const |
|
1540 { return STATIC_CAST(TAknQueryData<T>*,iSecondData)->iData; } |
|
1541 |
|
1542 /** |
|
1543 * Prompts access for derived classes. |
|
1544 * |
|
1545 * @return Pointer to the data of the second line. |
|
1546 */ |
|
1547 IMPORT_C TPtrC SecondPrompt() const; |
|
1548 |
|
1549 private: |
|
1550 void HandleOrientationSwitch(); |
|
1551 TBool FirstLineEnabled() const; |
|
1552 TBool SecondLineEnabled() const; |
|
1553 TInt CurrentLine() const; |
|
1554 |
|
1555 private: |
|
1556 TDesC* iSecondPrompt; |
|
1557 MAknQueryData* iFirstData; |
|
1558 MAknQueryData* iSecondData; |
|
1559 |
|
1560 TInt iFirstEditorMaxLength; |
|
1561 TInt iSecondEditorMaxLength; |
|
1562 |
|
1563 public: |
|
1564 |
|
1565 /** |
|
1566 * Constructor. |
|
1567 * |
|
1568 * @param aTime First line parameter. |
|
1569 * @param aTime2 Second line parameter. |
|
1570 * @param aPrompt First prompt value. NULL in default. |
|
1571 * @param aPrompt2 Second prompt value. NULL in default. |
|
1572 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1573 */ |
|
1574 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1575 TTime* aTime, |
|
1576 TTime* aTime2, |
|
1577 TDesC* aPrompt=NULL, |
|
1578 TDesC* aPrompt2=NULL, |
|
1579 const TTone& aTone = ENoTone); |
|
1580 |
|
1581 /** |
|
1582 * Constructor. |
|
1583 * |
|
1584 * @param aDataText First line parameter. |
|
1585 * @param aDataText2 Second line parameter. |
|
1586 * @param aPrompt First prompt value. NULL in default. |
|
1587 * @param aPrompt2 Second prompt value. NULL in default. |
|
1588 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1589 */ |
|
1590 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1591 TDes* aDataText, |
|
1592 TDes* aDataText2, |
|
1593 TDesC* aPrompt=NULL, |
|
1594 TDesC* aPrompt2=NULL, |
|
1595 const TTone& aTone = ENoTone); |
|
1596 |
|
1597 /** |
|
1598 * Constructor. |
|
1599 * |
|
1600 * @param aDataText First line parameter. |
|
1601 * @param aTime Second line parameter. |
|
1602 * @param aPrompt First prompt value. NULL in default. |
|
1603 * @param aPrompt2 Second prompt value. NULL in default. |
|
1604 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1605 */ |
|
1606 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1607 TDes* aDataText, |
|
1608 TTime* aTime, |
|
1609 TDesC* aPrompt=NULL, |
|
1610 TDesC* aPrompt2=NULL, |
|
1611 const TTone& aTone = ENoTone); |
|
1612 |
|
1613 /** |
|
1614 * Constructor. |
|
1615 * |
|
1616 * @param aDataText First line parameter. |
|
1617 * @param aNumber Second line parameter. |
|
1618 * @param aPrompt First prompt value. NULL in default. |
|
1619 * @param aPrompt2 Second prompt value. NULL in default. |
|
1620 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1621 */ |
|
1622 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1623 TDes* aDataText, |
|
1624 TInt* aNumber, |
|
1625 TDesC* aPrompt=NULL, |
|
1626 TDesC* aPrompt2=NULL, |
|
1627 const TTone& aTone = ENoTone); |
|
1628 |
|
1629 /** |
|
1630 * Constructor. |
|
1631 * |
|
1632 * @param aDataText First line parameter. |
|
1633 * @param aDuration Second line parameter. |
|
1634 * @param aPrompt First prompt value. NULL in default. |
|
1635 * @param aPrompt2 Second prompt value. NULL in default. |
|
1636 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1637 */ |
|
1638 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1639 TDes* aDataText, |
|
1640 TTimeIntervalSeconds* aDuration, |
|
1641 TDesC* aPrompt=NULL, |
|
1642 TDesC* aPrompt2=NULL, |
|
1643 const TTone& aTone = ENoTone); |
|
1644 |
|
1645 /** |
|
1646 * Constructor. |
|
1647 * |
|
1648 * @param aTime First line parameter. |
|
1649 * @param aDuration Second line parameter. |
|
1650 * @param aPrompt First prompt value. NULL in default. |
|
1651 * @param aPrompt2 Second prompt value. NULL in default. |
|
1652 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1653 */ |
|
1654 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1655 TTime* aTime, |
|
1656 TTimeIntervalSeconds* aDuration, |
|
1657 TDesC* aPrompt=NULL, |
|
1658 TDesC* aPrompt2=NULL, |
|
1659 const TTone& aTone = ENoTone); |
|
1660 |
|
1661 /** |
|
1662 * Constructor. |
|
1663 * |
|
1664 * @param aNumber First line parameter. |
|
1665 * @param aNumber2 Second line parameter. |
|
1666 * @param aPrompt First prompt value. NULL in default. |
|
1667 * @param aPrompt2 Second prompt value. NULL in default. |
|
1668 * @param aTone Reference to @c TTone enum. Default is @c ENoTone. |
|
1669 */ |
|
1670 IMPORT_C CAknMultiLineDataQueryDialog( |
|
1671 TInt* aNumber, |
|
1672 TInt* aNumber2, |
|
1673 TDesC* aPrompt=NULL, |
|
1674 TDesC* aPrompt2=NULL, |
|
1675 const TTone& aTone = ENoTone); |
|
1676 |
|
1677 private: |
|
1678 /** |
|
1679 * From CAknControl |
|
1680 */ |
|
1681 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
1682 |
|
1683 private: |
|
1684 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
1685 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
1686 |
|
1687 private: |
|
1688 IMPORT_C virtual void CAknDialog_Reserved(); |
|
1689 |
|
1690 private: |
|
1691 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
1692 |
|
1693 protected: |
|
1694 /** |
|
1695 * Deprecated - use data access template methods instead |
|
1696 * A text of the first line. |
|
1697 * @deprecated Use data access template methods instead. |
|
1698 */ |
|
1699 TDes16* iText; |
|
1700 |
|
1701 /** |
|
1702 * Deprecated do not use |
|
1703 * A text of the secondline. |
|
1704 * @deprecated Use data access template methods instead. |
|
1705 */ |
|
1706 TDes16* iSecondText; |
|
1707 }; |
|
1708 |
|
1709 //Deprecated |
|
1710 //This one is included here for backwards compatibility |
|
1711 //and will be removed as soon as apps using listquerydialog |
|
1712 //include it directly |
|
1713 #include <aknlistquerydialog.h> |
|
1714 |
|
1715 |
|
1716 //--------------------------------- |
|
1717 //class CAknIpAddressQueryDialog |
|
1718 //--------------------------------- |
|
1719 |
|
1720 /** |
|
1721 * This class should be used when user is reguest to enter IP address |
|
1722 * |
|
1723 * @since 2.1 |
|
1724 */ |
|
1725 |
|
1726 NONSHARABLE_CLASS(CAknIpAddressQueryDialog) : public CAknQueryDialog |
|
1727 { |
|
1728 |
|
1729 public: |
|
1730 /** |
|
1731 * Second phase construction |
|
1732 * |
|
1733 */ |
|
1734 IMPORT_C static CAknIpAddressQueryDialog* NewL(TInetAddr& aInetAddr, const TTone& aTone = ENoTone); |
|
1735 |
|
1736 private: |
|
1737 CAknIpAddressQueryDialog(TInetAddr& aInetAddr, const TTone& aTone = ENoTone); |
|
1738 |
|
1739 public: |
|
1740 /** |
|
1741 * C++ Destructor. |
|
1742 */ |
|
1743 IMPORT_C virtual ~CAknIpAddressQueryDialog(); |
|
1744 |
|
1745 public: |
|
1746 /** |
|
1747 * Set maximum and minimum addresses to editor. This override values given in resource. |
|
1748 * only values inside the initial minimum and maximum are permitted |
|
1749 * |
|
1750 * @param aMinimumAddress Minimumm address |
|
1751 * @param aMaximumAddress Maximum address. |
|
1752 */ |
|
1753 IMPORT_C void SetMinimumAndMaximum(const TInetAddr& aMinimumAddress, const TInetAddr& aMaximumAddress); |
|
1754 |
|
1755 /** |
|
1756 * Allows dismissing of queries. |
|
1757 * Clients can override this and implement something different. |
|
1758 * |
|
1759 */ |
|
1760 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); |
|
1761 |
|
1762 |
|
1763 protected: |
|
1764 |
|
1765 /** |
|
1766 * @return pointer to query control or NULL |
|
1767 * |
|
1768 */ |
|
1769 IMPORT_C virtual CAknQueryControl* QueryControl() const; |
|
1770 |
|
1771 protected://from CEikDialog |
|
1772 |
|
1773 /** |
|
1774 * From CEikdialog EIKON provides an implementation of this function, |
|
1775 * which positions the dialog in the centre of the screen. |
|
1776 * However, it can be overridden by derived classes.. |
|
1777 * @param aSize The size for the dialog. |
|
1778 */ |
|
1779 IMPORT_C void SetSizeAndPosition(const TSize& aSize); |
|
1780 |
|
1781 /** |
|
1782 * From @c CEikdialog<p> |
|
1783 * This function is called by the EIKON dialog framework just before the dialog is activated, but before it is sized, |
|
1784 * and before PostLayoutDynInitL() is called. |
|
1785 */ |
|
1786 IMPORT_C void PreLayoutDynInitL(); |
|
1787 |
|
1788 /** |
|
1789 * From @c CEikdialog<p> |
|
1790 * This function is called by the EIKON dialog framework just before the dialog is activated, |
|
1791 * after it has called PreLayoutDynInitL() and the dialog has been sized. |
|
1792 */ |
|
1793 IMPORT_C void PostLayoutDynInitL(); |
|
1794 |
|
1795 /** |
|
1796 * Set the prompt inside the query control. If dialog is active redo |
|
1797 * layout and draw. |
|
1798 */ |
|
1799 IMPORT_C virtual void DoSetPromptL(); |
|
1800 |
|
1801 /** |
|
1802 * From @c CEikdialog<p> |
|
1803 * This function is called by the EIKON framework |
|
1804 * if the user activates a button in the button panel. |
|
1805 * It is not called if the Cancel button is activated, |
|
1806 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
1807 * @param aButtonId The ID of the button that was activated |
|
1808 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
1809 */ |
|
1810 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
1811 |
|
1812 /** |
|
1813 * If the query text is ok (retrieved form query control) then display the |
|
1814 * left soft key, otherwise hide it. |
|
1815 */ |
|
1816 IMPORT_C void UpdateLeftSoftKeyL(); |
|
1817 |
|
1818 /** |
|
1819 * @return data |
|
1820 */ |
|
1821 inline TInetAddr& InetAddr() { return iInetAddr; } |
|
1822 |
|
1823 /** |
|
1824 * @return data |
|
1825 */ |
|
1826 inline const TInetAddr& InetAddr() const { return iInetAddr; } |
|
1827 |
|
1828 private: |
|
1829 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
1830 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
1831 |
|
1832 private: |
|
1833 IMPORT_C virtual void CAknDialog_Reserved(); |
|
1834 |
|
1835 private: |
|
1836 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
1837 |
|
1838 protected: |
|
1839 /** |
|
1840 * data |
|
1841 */ |
|
1842 TInetAddr& iInetAddr; |
|
1843 }; |
|
1844 |
|
1845 |
|
1846 //--------------------------------- |
|
1847 //class CAknFixedPointQueryDialog |
|
1848 //--------------------------------- |
|
1849 |
|
1850 /** |
|
1851 * This class should be used when user is reguest to enter IP address |
|
1852 * |
|
1853 * @since 2.1 |
|
1854 */ |
|
1855 |
|
1856 NONSHARABLE_CLASS(CAknFixedPointQueryDialog) : public CAknQueryDialog |
|
1857 { |
|
1858 public: |
|
1859 /** |
|
1860 * Second phase construction |
|
1861 * |
|
1862 */ |
|
1863 IMPORT_C static CAknFixedPointQueryDialog* NewL(TInt& aNumber, const TTone& aTone); |
|
1864 |
|
1865 private: |
|
1866 CAknFixedPointQueryDialog(TInt& aNumber, const TTone& aTone = ENoTone); |
|
1867 |
|
1868 public: |
|
1869 |
|
1870 /** |
|
1871 * C++ Destructor. |
|
1872 */ |
|
1873 IMPORT_C virtual ~CAknFixedPointQueryDialog(); |
|
1874 |
|
1875 public: //new |
|
1876 /** |
|
1877 * Set maximum and minimum addresses to editor. This override values given in resource. |
|
1878 * |
|
1879 * @param aMinimumValue Minimumm value |
|
1880 * @param aMaximumValue Maximum value. |
|
1881 */ |
|
1882 IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted |
|
1883 |
|
1884 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); |
|
1885 |
|
1886 |
|
1887 protected: |
|
1888 |
|
1889 /** |
|
1890 * Usage: |
|
1891 * CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl()); |
|
1892 * |
|
1893 */ |
|
1894 IMPORT_C virtual CAknQueryControl* QueryControl() const; |
|
1895 |
|
1896 protected://from CEikDialog |
|
1897 |
|
1898 /** |
|
1899 * From CEikdialog EIKON provides an implementation of this function, |
|
1900 * which positions the dialog in the centre of the screen. |
|
1901 * However, it can be overridden by derived classes.. |
|
1902 * @param aSize The size for the dialog. |
|
1903 */ |
|
1904 IMPORT_C void SetSizeAndPosition(const TSize& aSize); |
|
1905 |
|
1906 /** |
|
1907 * From @c CEikdialog<p> |
|
1908 * This function is called by the EIKON dialog framework just before the dialog is activated, but before it is sized, |
|
1909 * and before PostLayoutDynInitL() is called. |
|
1910 */ |
|
1911 IMPORT_C void PreLayoutDynInitL(); |
|
1912 |
|
1913 /** |
|
1914 * From @c CEikdialog<p> |
|
1915 * This function is called by the EIKON dialog framework just before the dialog is activated, |
|
1916 * after it has called PreLayoutDynInitL() and the dialog has been sized. |
|
1917 */ |
|
1918 IMPORT_C void PostLayoutDynInitL(); |
|
1919 |
|
1920 /** |
|
1921 * Set the prompt inside the query control. If dialog is active redo |
|
1922 * layout and draw. |
|
1923 */ |
|
1924 IMPORT_C virtual void DoSetPromptL(); |
|
1925 |
|
1926 /** |
|
1927 * From @c CEikdialog<p> |
|
1928 * This function is called by the EIKON framework |
|
1929 * if the user activates a button in the button panel. |
|
1930 * It is not called if the Cancel button is activated, |
|
1931 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
1932 * @param aButtonId The ID of the button that was activated |
|
1933 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
1934 */ |
|
1935 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
1936 |
|
1937 /** |
|
1938 * If the query text is ok (retrieved form query control) then display the |
|
1939 * left soft key, otherwise hide it. |
|
1940 */ |
|
1941 IMPORT_C void UpdateLeftSoftKeyL(); |
|
1942 |
|
1943 /** |
|
1944 * @return data |
|
1945 */ |
|
1946 inline TInt& Number() { return iNumber; } |
|
1947 |
|
1948 /** |
|
1949 * @return data |
|
1950 */ |
|
1951 inline const TInt& Number() const { return iNumber; } |
|
1952 |
|
1953 private: |
|
1954 IMPORT_C virtual void CEikDialog_Reserved_1(); |
|
1955 IMPORT_C virtual void CEikDialog_Reserved_2(); |
|
1956 private: |
|
1957 IMPORT_C virtual void CAknDialog_Reserved(); |
|
1958 private: |
|
1959 IMPORT_C virtual void CAknQueryDialog_Reserved(); |
|
1960 private: |
|
1961 TInt& iNumber; |
|
1962 }; |
|
1963 |
|
1964 |
|
1965 //-------------------------------------- |
|
1966 //class CAknMultilineIpQueryDialog |
|
1967 //-------------------------------------- |
|
1968 |
|
1969 /** |
|
1970 * Query Dialog with data input on more than one line (2 lines at the moment) |
|
1971 * |
|
1972 * Create using NewL methods and passing parameters as appropriate. |
|
1973 * |
|
1974 * Attention: When deriving from this class, you must call SetDataL during |
|
1975 * second phase construction. |
|
1976 * |
|
1977 * @since 2.1 |
|
1978 * |
|
1979 */ |
|
1980 NONSHARABLE_CLASS(CAknMultiLineIpQueryDialog) : public CAknMultiLineDataQueryDialog |
|
1981 { |
|
1982 friend class CAknMultilineQueryDialogExtension; |
|
1983 public: |
|
1984 /** |
|
1985 * Second phase construction |
|
1986 * |
|
1987 */ |
|
1988 IMPORT_C static CAknMultiLineIpQueryDialog* NewL(TInetAddr& aAddress1, TInetAddr& aAddress2, TTone aTone = ENoTone); |
|
1989 |
|
1990 IMPORT_C virtual ~CAknMultiLineIpQueryDialog(); |
|
1991 |
|
1992 protected: |
|
1993 /** |
|
1994 * Set the query data for first and second line |
|
1995 * Must be called by derived classes during second phase construction |
|
1996 * (NewL method) |
|
1997 */ |
|
1998 template <class T1, class T2> void SetDataL(T1& aData1, T2& aData2) |
|
1999 { |
|
2000 iFirstData = new (ELeave) TAknQueryData<T1>(aData1); |
|
2001 iSecondData = new (ELeave) TAknQueryData<T2>(aData2); |
|
2002 } |
|
2003 |
|
2004 /** |
|
2005 * Utility function called by NewL methods - should really be private |
|
2006 * but it is left here to show to people extending this class what |
|
2007 * their NewL method should do |
|
2008 */ |
|
2009 template <class T1, class T2> static CAknMultiLineIpQueryDialog* |
|
2010 DoNewL(T1& aData1, T2& aData2, const TTone& aTone) |
|
2011 { |
|
2012 CAknMultiLineIpQueryDialog* self = new (ELeave) CAknMultiLineIpQueryDialog(aTone); |
|
2013 CleanupStack::PushL(self); |
|
2014 |
|
2015 self->SetDataL(aData1,aData2); |
|
2016 |
|
2017 CleanupStack::Pop(self); |
|
2018 return self; |
|
2019 } |
|
2020 |
|
2021 private: |
|
2022 CAknMultiLineIpQueryDialog(const TTone& aTone); |
|
2023 |
|
2024 public: |
|
2025 |
|
2026 /** |
|
2027 * Set prompt text for query. This this will override text given in constructor. |
|
2028 * |
|
2029 * @param aFirstPrompt Text for prompt on the first query line |
|
2030 * @param aSecondPrompt Text for prompt on the second query line |
|
2031 */ |
|
2032 IMPORT_C void SetPromptL(const TDesC& aFirstPrompt, const TDesC& aSecondPrompt); |
|
2033 |
|
2034 public: |
|
2035 |
|
2036 /** |
|
2037 * Sets max length for the first editor in a query |
|
2038 * @param aFirstTextEditorMaxLength Max length for editor |
|
2039 */ |
|
2040 IMPORT_C void SetMaxLengthOfFirstEditor(TInt aFirstTextEditorMaxLength); |
|
2041 |
|
2042 /** |
|
2043 * Sets max length for the second editor in a query |
|
2044 * @param aSecondTextEditorMaxLength Max length for editor |
|
2045 */ |
|
2046 IMPORT_C void SetMaxLengthOfSecondEditor(TInt aSecondTextEditorMaxLength); |
|
2047 |
|
2048 protected://from CEikDialog |
|
2049 |
|
2050 /** |
|
2051 * From @c CEikdialog<p> |
|
2052 * This function is called by the EIKON framework |
|
2053 * if the user activates a button in the button panel. |
|
2054 * It is not called if the Cancel button is activated, |
|
2055 * unless the EEikDialogFlagNotifyEsc flag is set. |
|
2056 * @param aButtonId The ID of the button that was activated |
|
2057 * @return Should return ETrue if the dialog should exit, and EFalse if it should not. |
|
2058 */ |
|
2059 IMPORT_C virtual TBool OkToExitL(TInt aButtonId); |
|
2060 |
|
2061 /** |
|
2062 * From @c CEikdialog<p> |
|
2063 * This function is called by the EIKON dialog framework just before the dialog is activated, but before it is sized, |
|
2064 * and before PostLayoutDynInitL() is called. |
|
2065 */ |
|
2066 IMPORT_C void PreLayoutDynInitL(); |
|
2067 |
|
2068 IMPORT_C void HandleResourceChange(TInt aType); |
|
2069 |
|
2070 protected: |
|
2071 /** |
|
2072 * If the query text is ok (retrieved form query controls) then display the |
|
2073 * left soft key, otherwise hide it. |
|
2074 */ |
|
2075 IMPORT_C void UpdateLeftSoftKeyL(); |
|
2076 |
|
2077 /** |
|
2078 * Set the prompt inside the query control. If dialog is active redo |
|
2079 * layout and draw. |
|
2080 */ |
|
2081 IMPORT_C void DoSetPromptL(); |
|
2082 |
|
2083 protected: |
|
2084 /** |
|
2085 * Called by OfferkeyEventL(), gives a change to dismiss the query even with |
|
2086 * keys different than Enter of Ok. |
|
2087 * |
|
2088 * @param aKeyEvent Key event which will be checked |
|
2089 * @return Should the query be dismissed |
|
2090 */ |
|
2091 IMPORT_C TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent); |
|
2092 |
|
2093 protected: |
|
2094 /** |
|
2095 * Access to 1st query control |
|
2096 * |
|
2097 * @return Pointer to the control of the first line. |
|
2098 */ |
|
2099 IMPORT_C CAknExtMultilineQueryControl* FirstControl() const; |
|
2100 |
|
2101 /** |
|
2102 * Access to 2nd query control |
|
2103 * |
|
2104 * @return Pointer to the control of the second line. |
|
2105 */ |
|
2106 IMPORT_C CAknExtMultilineQueryControl* SecondControl() const; |
|
2107 |
|
2108 /** |
|
2109 * Not implemented. |
|
2110 * |
|
2111 * @return NULL. |
|
2112 */ |
|
2113 IMPORT_C CAknQueryControl* QueryControl() const; |
|
2114 |
|
2115 protected: |
|
2116 /** |
|
2117 * Prompt access for derived classes |
|
2118 */ |
|
2119 IMPORT_C TPtrC SecondPrompt() const; |
|
2120 |
|
2121 private: |
|
2122 void HandleOrientationSwitch(); |
|
2123 TBool FirstLineEnabled() const; |
|
2124 TBool SecondLineEnabled() const; |
|
2125 TInt CurrentLine() const; |
|
2126 |
|
2127 private: |
|
2128 TDesC* iSecondPrompt; |
|
2129 |
|
2130 MAknQueryData* iFirstData; |
|
2131 MAknQueryData* iSecondData; |
|
2132 |
|
2133 TInt iFirstEditorMaxLength; |
|
2134 TInt iSecondEditorMaxLength; |
|
2135 |
|
2136 private: |
|
2137 TDes16* iText; |
|
2138 TDes16* iSecondText; |
|
2139 }; |
|
2140 |
|
2141 #endif // AKNQUERYDIALOG_H |