2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Implementation of query dialogs.
19 #ifndef AKNQUERYDIALOG_H
20 #define AKNQUERYDIALOG_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>
38 class CAknKeySoundSystem;
40 class CAknQueryDialogExtension;
41 class CAknMultilineQueryDialogExtension;
44 * General query dialog
46 * Use for confirmation queries
48 class CAknQueryDialog : public CAknDialog , public MAknQueryControlObserver
50 friend class CAknQueryDialogExtension;
54 * Enumeration for tones.
56 * The tone played before the dialog is shown. Application specific
57 * tones may be played by casting the application defined Sound ID
68 * A confirmation tone is played.
70 EConfirmationTone = EAvkonSIDConfirmationTone,
73 * A warning tone is played.
75 EWarningTone = EAvkonSIDWarningTone,
78 * An error tone is played.
80 EErrorTone = EAvkonSIDErrorTone
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.
90 * @return pointer to CAknQueryDialog
92 IMPORT_C static CAknQueryDialog* NewL(const TTone& aTone = ENoTone);
96 * @return pointer to CAknTextQueryDialog
98 IMPORT_C static CAknQueryDialog* NewL(TDes& aText, const TTone& aTone = ENoTone);
102 * @return pointer to CAknNumberQueryDialog
104 IMPORT_C static CAknQueryDialog* NewL(TInt& aNumber, const TTone& aTone = ENoTone);
108 * @return pointer to CAknTimeQueryDialog
110 IMPORT_C static CAknQueryDialog* NewL(TTime& aTime, const TTone& aTone = ENoTone);
114 * @return pointer to CAknDurationQueryDialog
116 IMPORT_C static CAknQueryDialog* NewL(TTimeIntervalSeconds& aTime, const TTone& aTone = ENoTone);
120 * @return pointer to CAknFloatQueryDialog
122 IMPORT_C static CAknQueryDialog* NewL(TReal& aNumber, const TTone& aTone = ENoTone);
126 * @return pointer to CAknIpQueryDialog
128 IMPORT_C static CAknQueryDialog* NewL(TInetAddr& aInetAddr, const TTone& aTone = ENoTone);
131 * Not yet totally implemented!
133 * @return pointer to CAknLocationQueryDialog
135 IMPORT_C static CAknQueryDialog* NewL(TPosition &aValue, const TTone &aTone = ENoTone);
138 IMPORT_C virtual ~CAknQueryDialog();
143 * @deprecated: will be made protected - use NewL
145 IMPORT_C CAknQueryDialog(const TTone& aTone);
150 * Return pointer to query heading or NULL
153 IMPORT_C virtual CAknPopupHeadingPane* QueryHeading() const;
156 * Deprecated method to return pointer to query heading or NULL (use QueryHeading())
158 * @deprecated - will be removed (use QueryHeading() method instead)
160 IMPORT_C CAknPopupHeadingPane* Heading() const;
163 * Set prompt text for query. This this will override text given in constructor.
165 * @param aPrompt Text for prompt
167 IMPORT_C void SetPromptL(const TDesC& aPrompt);
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.
173 IMPORT_C void MakeLeftSoftkeyVisible(TBool aVisible);
176 * Enable or disable emergency call support. This method is only valid in
177 * numeric queries (secret or normal).
179 * Default is Off for both.
181 * @param aOnOff Sets emergency call support active or inactive, if feature is available in
182 * current type of control
184 IMPORT_C void SetEmergencyCallSupport( TBool aOnOff );
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.
191 IMPORT_C void RemoveEditorIndicator();
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.
198 * This may be called at any time prior to activation of the query.
200 * @param aPermitted ETrue - allow predictive text entry
203 IMPORT_C void SetPredictiveTextInputPermitted( TBool aPermitted );
206 * Runs the querydialog and returns the ID of the button used to dismiss it.
207 * The dialog is destroyed on exit.
210 IMPORT_C TInt RunLD();
213 * Call PrepareLC and display dialog.
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
220 * @param aResourceId resource for query
222 IMPORT_C TInt ExecuteLD(TInt aResourceId);
225 * Call PrepareLC and display dialog.
227 * @param aResourceId resource for query
228 * @param aPrompt text for query prompt
230 IMPORT_C TInt ExecuteLD(TInt aResourceId, const TDesC& aPrompt);
232 public:// from CCoeControl
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.
243 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
246 * Handles pointer events
248 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
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>
258 * 2) Resource set value held in aControl<p>
259 * 3) The MaxLength of the descriptor
260 * @return maximum text length
262 IMPORT_C static TInt MaxTextLength(const CAknQueryControl* aControl, const TDes& aDataText, TInt aApiValue) ;
264 protected://from CEikdialog
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.
273 IMPORT_C void SetSizeAndPosition(const TSize& aSize);
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.
280 IMPORT_C void PreLayoutDynInitL(void);
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.
287 IMPORT_C void PostLayoutDynInitL();
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.
298 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
300 public://from MAknQueryControlObeserver
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
308 IMPORT_C TBool HandleQueryEditorSizeEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType);
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
317 IMPORT_C TBool HandleQueryEditorStateEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType, TQueryValidationStatus aStatus);
320 * Called by OfferkeyEventL(), gives a change to dismiss the query even with
321 * keys different than Enter of Ok.
323 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
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.
331 IMPORT_C virtual void DismissQueryL();
336 * If the query text is ok (retrieved form query control) then display the
337 * left soft key, otherwise hide it.
339 IMPORT_C virtual void UpdateLeftSoftKeyL();
342 * Set the prompt inside the query control. If dialog is active redo
345 IMPORT_C virtual void DoSetPromptL();
348 * Return pointer to query control or NULL
351 IMPORT_C virtual CAknQueryControl* QueryControl() const;
353 protected: //implementation, intended to be used but not overwritten
361 * Resets system's inactivity timer
363 void ReportUserActivity() const ;
366 * Recreates layout and redraws the dialog
368 void LayoutAndDraw();
371 * Returns left CBA short key press
372 * @return Id of the left CBA
374 TInt GetLeftCBAShortKeyPress();
377 * Returns right CBA short key press
378 * @return Id of the right CBA
380 TInt GetRightCBAShortKeyPress();
383 * Returns whether the left softkey is visible
384 * @return ETrue is the left softkey is visible
386 TBool IsLeftSoftkeyVisible();
391 * Prompt access for derived classes
393 IMPORT_C TPtrC Prompt() const;
398 TTone& Tone() { return iTone; }
403 const TTone& Tone() const { return iTone; }
406 * @return query flags
408 TBitFlags16& Flags() { return iFlags; }
411 * @return query flags
413 const TBitFlags16& Flags() const { return iFlags; }
416 * @return query sound system
418 CAknKeySoundSystem* SoundSystem() const { return iSoundSystem; }
420 protected: // collected code for accessing Dialog state.
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.
435 CCoeControl* FindControlOnAnyPageWithControlType(TInt aControlType, TInt* aLineIndex=0, TInt* aPageIndex=0) const;
440 * Tone which is played when the query is executed
441 * These will be made private, use protected methods
450 /** Caption Retriever*/
451 CAknQueryDialogExtension* iExtension;
454 * Flags for emergency call support
455 * Need these at least to store the ECS state until the control exists
459 /** Spare variable for further development */
463 CAknKeySoundSystem* iSoundSystem;
468 * @deprecated do not use
470 IMPORT_C CAknQueryDialog();
473 * @deprecated do not use
475 IMPORT_C CAknQueryDialog(TDesC& aPrompt,const TTone& aTone = ENoTone);
478 * @deprecated - use QueryHeading() method instead
480 IMPORT_C void SetHeaderTextL(const TDesC& aHeader);
483 * @deprecated - use QueryHeading() method instead
485 IMPORT_C void SetHeaderImageL(CEikImage* aImage);
488 * @deprecated - use RunLD or ExecuteLD instead
490 IMPORT_C TInt RunDlgLD(TInt aResourceId);
493 * @deprecated - use other version of MaxTextLength
495 IMPORT_C static TInt MaxTextLength(const CAknQueryControl* aControl, const TDes* aDataText, TInt aApiValue);
499 IMPORT_C void* ExtensionInterface( TUid aInterface );
502 IMPORT_C virtual void CEikDialog_Reserved_1();
503 IMPORT_C virtual void CEikDialog_Reserved_2();
506 IMPORT_C virtual void CAknDialog_Reserved();
508 private:// new function
509 IMPORT_C virtual void CAknQueryDialog_Reserved();
514 * Gets the control's input capabilities.
516 * @return The control's input capabilities.
518 IMPORT_C TCoeInputCapabilities InputCapabilities() const;
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.
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.
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.
536 * This method is only valid in numeric queries (secret or normal),
537 * default is Off for both.
539 * @param aOnOff @c ETrue to enable the ECS CBA support,
540 * @c EFalse otherwise.
542 IMPORT_C void SetEmergencyCallSupportForCBA( TBool aOnOff );
546 //-------------------------------------
547 //class CAknTextQuerydialog
548 //-------------------------------------
551 #define CAknStaticSizeDataQuerydialog CAknTextQueryDialog
554 *This class should be used when user is reguest to enter plain text, secret text, phonenumber or PIN-code
556 class CAknTextQueryDialog : public CAknQueryDialog
559 public://construction and destruction
562 * Second phase construction required to align API with multiline queries
563 * and because in future MAknQueryData will be used.
565 IMPORT_C static CAknTextQueryDialog* NewL(TDes& aDataText, const TTone& aTone = ENoTone);
573 IMPORT_C CAknTextQueryDialog(TDes& aDataText, const TTone& aTone = ENoTone);
578 IMPORT_C virtual ~CAknTextQueryDialog();
580 public://New functions
583 * Set max lenght for editor. This overrides the max lenght given in resource.
585 * @param aLength Max lenght.
587 IMPORT_C void SetMaxLength(TInt aLength);
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
594 IMPORT_C virtual TBool CheckIfEntryTextOk() const;
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).
603 * @param aInputMode Default input mode in the secret editor.
604 * Only EAknEditorNumericInputMode and EAknEditorSecretAlphaInputMode
607 IMPORT_C void SetDefaultInputMode(TInt aInputMode);
609 protected://from CEikDialog
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.
617 IMPORT_C void PreLayoutDynInitL();
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.
628 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
630 public://from MAknQueryControlObserver
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
638 IMPORT_C TBool HandleQueryEditorSizeEventL(CAknQueryControl* aQueryControl, TQueryControlEvent aEventType);
640 public://from CCoeControl
643 * Handles pointer events
645 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
650 * Called by PreLayoutDynInit(), set the control observer, the text and
651 * the maximum length of the text
653 void SetControlTextL();
658 inline TDes& Text() { return iDataText; }
663 inline const TDesC& Text() const { return iDataText; }
668 * Max length for text
671 * This data will become private
672 * Use Text() and MaxTextLength() instead
677 * Text for editor. When query is approved text from editor is stored here
681 /** @deprecated - not used anymore */
687 * deprecated do not use
689 IMPORT_C CAknTextQueryDialog(TDes& aDataText, TDesC& aPrompt,const TTone& aTone = ENoTone);
695 IMPORT_C void* ExtensionInterface( TUid aInterface );
698 IMPORT_C virtual void CEikDialog_Reserved_1();
699 IMPORT_C virtual void CEikDialog_Reserved_2();
702 IMPORT_C virtual void CAknDialog_Reserved();
705 IMPORT_C virtual void CAknQueryDialog_Reserved();
711 //---------------------------------
712 //class CAknNumberQuerydialog
713 //---------------------------------
716 *This class should be used when user is reguest to enter number
718 class CAknNumberQueryDialog : public CAknQueryDialog
724 * Second phase construction required to align API with multiline queries
725 * and because in future MAknQueryData will be used.
727 IMPORT_C static CAknNumberQueryDialog* NewL(TInt& aNumber, const TTone& aTone = ENoTone);
734 IMPORT_C CAknNumberQueryDialog(TInt& aNumber, const TTone& aTone = ENoTone);
739 IMPORT_C virtual ~CAknNumberQueryDialog();
744 * Set maximum and minimum to editor. This override values given in resource.
746 * @param aMinimumValue Minimumm number
747 * @param aMaximumValue Maximum number.
749 IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
751 public://from CCoeControl
754 * Handles pointer events
756 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
758 protected://from CEikDialog
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.
766 IMPORT_C void PreLayoutDynInitL();
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.
777 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
782 inline TInt& Number() { return iNumber; }
787 inline const TInt& Number() const { return iNumber; }
793 IMPORT_C void* ExtensionInterface( TUid aInterface );
796 IMPORT_C virtual void CEikDialog_Reserved_1();
797 IMPORT_C virtual void CEikDialog_Reserved_2();
800 IMPORT_C virtual void CAknDialog_Reserved();
803 IMPORT_C virtual void CAknQueryDialog_Reserved();
808 * @deprecated - will become private - use Number() instead
816 //-------------------------------------
817 //class CAknTimeQueryDialog
818 //-------------------------------------
821 *This class should be used when user is reguest to enter time or date
823 class CAknTimeQueryDialog : public CAknQueryDialog
829 * Second phase construction required to align API with multiline queries
830 * and because in future MAknQueryData will be used.
832 IMPORT_C static CAknTimeQueryDialog* NewL(TTime& aTime, const TTone& aTone = ENoTone);
839 IMPORT_C CAknTimeQueryDialog(TTime& aTime, const TTone& aTone = ENoTone);
844 IMPORT_C virtual ~CAknTimeQueryDialog();
846 public://New functions
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
852 * @param aMinimum Minimumm time
853 * @param aMaximum Maximum time.
855 IMPORT_C void SetMinimumAndMaximum(const TTime& aMinimum, const TTime& aMaximum);
857 public://From CCoeControl
860 * Handles pointer events
862 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
864 protected://from CEikDialog
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.
872 IMPORT_C void PreLayoutDynInitL();
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.
883 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
888 inline TTime& Time() { return iTime; }
893 inline const TTime& Time() const { return iTime; }
898 * @deprecated - will become private - use Time() instead
905 * deprecated - do not use
907 IMPORT_C CAknTimeQueryDialog(TTime& aTime,TDesC& aPrompt,const TTone& aTone = ENoTone);
913 IMPORT_C void* ExtensionInterface( TUid aInterface );
916 IMPORT_C virtual void CEikDialog_Reserved_1();
917 IMPORT_C virtual void CEikDialog_Reserved_2();
920 IMPORT_C virtual void CAknDialog_Reserved();
923 IMPORT_C virtual void CAknQueryDialog_Reserved();
929 //----------------------------------
930 //class CAknDurationQuerydialog
931 //----------------------------------
934 *This class should be used when user is reguest to enter duration
936 class CAknDurationQueryDialog : public CAknQueryDialog
942 * Second phase construction required to align API with multiline queries
943 * and because in future MAknQueryData will be used.
945 IMPORT_C static CAknDurationQueryDialog* NewL(TTimeIntervalSeconds& aTime, const TTone& aTone = ENoTone);
950 * - deprecated (use NewL instead)
952 IMPORT_C CAknDurationQueryDialog(TTimeIntervalSeconds& aDuration, const TTone& aTone = ENoTone);
957 IMPORT_C virtual ~CAknDurationQueryDialog();
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.
965 * @param aMinimumDuration Minimumm duration
966 * @param aMaximumDuration Maximum duration.
968 IMPORT_C void SetMinimumAndMaximum(const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration);
970 public: // From CCoeControl
973 * Handles pointer events
975 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
977 protected://from CEikDialog
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.
985 IMPORT_C void PreLayoutDynInitL();
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.
996 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
1001 inline TTimeIntervalSeconds& Duration() { return iDuration; }
1006 inline const TTimeIntervalSeconds& Duration() const { return iDuration; }
1012 IMPORT_C void* ExtensionInterface( TUid aInterface );
1015 IMPORT_C virtual void CEikDialog_Reserved_1();
1016 IMPORT_C virtual void CEikDialog_Reserved_2();
1019 IMPORT_C virtual void CAknDialog_Reserved();
1022 IMPORT_C virtual void CAknQueryDialog_Reserved();
1026 * @deprecated - will become private. Use Duration() instead.
1028 TTimeIntervalSeconds& iDuration;
1034 //----------------------------------
1035 //class CAknFloatingPointQueryDialog
1036 //----------------------------------
1039 *This class should be used when user is reguest to enter a flotaing point number
1041 class CAknFloatingPointQueryDialog : public CAknQueryDialog
1046 * Second phase construction required to align API with multiline queries
1047 * and because in future MAknQueryData will be used.
1049 IMPORT_C static CAknFloatingPointQueryDialog* NewL(TReal& aNumber, const TTone& aTone = ENoTone);
1053 * deprecated (use NewL instead)
1055 IMPORT_C CAknFloatingPointQueryDialog(TReal& aNumber, const TTone& aTone = ENoTone);
1060 IMPORT_C virtual ~CAknFloatingPointQueryDialog();
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
1067 * @param aMinimumNumber Minimumm duration
1068 * @param aMaximumNumber Maximum duration.
1070 IMPORT_C void SetMinimumAndMaximum(const TReal& aMinimumNumber, const TReal& aMaximumNumber);
1072 public://From CCoeControl
1075 * Handles pointer events
1077 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1079 protected://from CEikDialog
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.
1087 IMPORT_C void PreLayoutDynInitL();
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.
1098 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
1103 inline TReal& Number() { return iNumber; }
1108 inline const TReal& Number() const { return iNumber; }
1114 IMPORT_C void* ExtensionInterface( TUid aInterface );
1117 IMPORT_C virtual void CEikDialog_Reserved_1();
1118 IMPORT_C virtual void CEikDialog_Reserved_2();
1121 IMPORT_C virtual void CAknDialog_Reserved();
1124 IMPORT_C virtual void CAknQueryDialog_Reserved();
1128 * @deprecated - will become private - use Number() instead
1137 //--------------------------------------
1138 //class CAknMultilineDataQuerydialog
1139 //--------------------------------------
1142 * Query dialog with data input on more than one line (2 lines at the moment).
1144 * Object of this class is created by using NewL method and by passing
1145 * parameters as appropriate.
1147 * Attention: When deriving from this class, you must call @c SetDataL() during
1148 * second phase construction.
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.
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>
1160 class CAknMultiLineDataQueryDialog : public CAknQueryDialog
1162 friend class CAknMultilineQueryDialogExtension;
1167 * Creates a new instance of a multiline dialog.
1169 * @param aTime1 First line parameter.
1170 * @param aTime2 Second line parameter.
1171 * @param aTone Reference to @c TTone enumeration. Default is @c
1173 * @return Pointer to a multiline dialog object.
1175 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1178 TTone aTone = ENoTone);
1181 * Creates a new instance of a multiline dialog.
1183 * @param aText1 First line parameter.
1184 * @param aText2 Second line parameter.
1185 * @param aTone Reference to @c TTone enumeration. Default is @c
1187 * @return Pointer to a multiline dialog object.
1189 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1192 TTone aTone = ENoTone);
1195 * Creates a new instance of a multiline dialog.
1197 * @param aText1 First line parameter.
1198 * @param aTime2 Second line parameter.
1199 * @param aTone Reference to @c TTone enumeration. Default is @c
1201 * @return Pointer to a multiline dialog object.
1203 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1206 TTone aTone = ENoTone);
1209 * Creates a new instance of a multiline dialog.
1211 * @param aText1 First line parameter.
1212 * @param aNum2 Second line parameter.
1213 * @param aTone Reference to @c TTone enumeration. Default is @c
1215 * @return Pointer to a multiline dialog object.
1217 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1220 TTone aTone = ENoTone);
1223 * Creates a new instance of a multiline dialog.
1225 * @param aText1 First line parameter.
1226 * @param aDur2 Second line parameter.
1227 * @param aTone Reference to @c TTone enumeration. Default is @c
1229 * @return Pointer to a multiline dialog object.
1231 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1233 TTimeIntervalSeconds& aDur2,
1234 TTone aTone = ENoTone);
1237 * Creates a new instance of a multiline dialog.
1239 * @param aTime1 First line parameter.
1240 * @param aDur2 Second line parameter.
1241 * @param aTone Reference to @c TTone enumeration. Default is @c
1243 * @return Pointer to a multiline dialog object.
1245 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1247 TTimeIntervalSeconds& aDur2,
1248 TTone aTone = ENoTone);
1251 * Creates a new instance of a multiline dialog.
1253 * @param aNum1 First line parameter.
1254 * @param aNum2 Second line parameter.
1255 * @param aTone Reference to @c TTone enumeration. Default is @c
1257 * @return Pointer to multiline dialog object.
1259 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(
1262 TTone aTone = ENoTone);
1265 * Creates a new instance of a multiline dialog.
1267 * @param aPos Position parameter.
1268 * @param aTone Reference to @c TTone enumeration. Default is @c
1270 * @return Pointer to multiline dialog object.
1272 IMPORT_C static CAknMultiLineDataQueryDialog* NewL(TPosition &aPos, TTone aTone = ENoTone);
1278 IMPORT_C virtual ~CAknMultiLineDataQueryDialog();
1283 * Sets the query data for the first and the second line. Must be
1284 * called by derived classes during second phase construction (@c
1287 template <class T1, class T2> void SetDataL(T1& aData1, T2& aData2)
1289 /** First line data. */
1290 iFirstData = new (ELeave) TAknQueryData<T1>(aData1);
1292 /** Second line data. */
1293 iSecondData = new (ELeave) TAknQueryData<T2>(aData2);
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.
1301 * Creates new instance of the multiline dialog.
1303 * @param aData1 First line parameter.
1304 * @param aData2 Second line parameter.
1305 * @param aTone Reference to @c TTone enum.
1308 template <class T1, class T2> static CAknMultiLineDataQueryDialog*
1309 DoNewL(T1& aData1, T2& aData2, const TTone& aTone)
1311 CAknMultiLineDataQueryDialog* self =
1312 new (ELeave) CAknMultiLineDataQueryDialog(aTone);
1314 CleanupStack::PushL(self);
1316 self->SetDataL(aData1,aData2);
1318 CleanupStack::Pop(self);
1325 * C++ default constructor.
1327 * @param aTone Reference to @c TTone enumeration.
1329 IMPORT_C CAknMultiLineDataQueryDialog(const TTone& aTone);
1334 * Sets a prompt text for the query. This will override the text given
1335 * in the constructor.
1337 * @param aFirstPrompt Text for prompt on the first query line.
1338 * @param aSecondPrompt Text for prompt on the second query line.
1340 IMPORT_C void SetPromptL(const TDesC& aFirstPrompt,
1341 const TDesC& aSecondPrompt);
1346 * Sets a max length for the first editor in a query.
1348 * @param aFirstTextEditorMaxLength Max length for editor
1350 IMPORT_C void SetMaxLengthOfFirstEditor(
1351 TInt aFirstTextEditorMaxLength);
1354 * Sets a max length for the second editor in a query.
1356 * @param aSecondTextEditorMaxLength Max length for editor.
1358 IMPORT_C void SetMaxLengthOfSecondEditor(
1359 TInt aSecondTextEditorMaxLength);
1361 public: // From CCoeControl
1364 * From @c CCoeControl.
1366 * Handles pointer events.
1368 * @param aPointerEvent The pointer event.
1370 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
1372 protected://from CEikDialog
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
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.
1385 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
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.
1393 * Control values that should not influence the sizing and layout are
1394 * set using @c PostLayoutDynInitL().
1396 IMPORT_C void PreLayoutDynInitL();
1399 * From @c CCoeControl.
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.
1405 * @since Symbian 5.1.
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.
1415 IMPORT_C void HandleResourceChange(TInt aType);
1420 * If the query text is ok (retrieved form query controls) the left
1421 * soft key is displayed, otherwise it is hidden.
1423 IMPORT_C void UpdateLeftSoftKeyL();
1426 * Sets the prompt inside the query control.
1428 IMPORT_C void DoSetPromptL();
1433 * Allows dismissing of queries. Same as base class implementation only take into
1434 * consideration both controls
1436 IMPORT_C TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
1441 * Access to 1st query control
1443 * @return Pointer to the control of the first line.
1445 IMPORT_C CAknMultilineQueryControl* FirstControl() const;
1448 * Access to 2nd query control
1450 * @return Pointer to the control of the second line.
1452 IMPORT_C CAknMultilineQueryControl* SecondControl() const;
1455 * Gets a querycontrol.
1457 * @return Pointer to the control of the first line.
1459 IMPORT_C CAknQueryControl* QueryControl() const;
1466 IMPORT_C CAknPopupHeadingPane* QueryHeading() const;
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
1477 * The client ultimately owns the data this reference references and so
1478 * it should never need to call these methods.
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.
1485 T& FirstData(const T&)
1486 { return STATIC_CAST(TAknQueryData<T>*,iFirstData)->iData; }
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
1495 * The client ultimately owns the data this reference references and so
1496 * it should never need to call these methods.
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.
1503 T& SecondData(const T&)
1504 { return STATIC_CAST(TAknQueryData<T>*,iSecondData)->iData; }
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
1513 * The client ultimately owns the data this reference references and so
1514 * it should never need to call these methods.
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.
1521 const T& FirstData(const T&) const
1522 { return STATIC_CAST(TAknQueryData<T>*,iFirstData)->iData; }
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
1531 * The client ultimately owns the data this reference references and so
1532 * it should never need to call these methods.
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.
1539 const T& SecondData(const T&) const
1540 { return STATIC_CAST(TAknQueryData<T>*,iSecondData)->iData; }
1543 * Prompts access for derived classes.
1545 * @return Pointer to the data of the second line.
1547 IMPORT_C TPtrC SecondPrompt() const;
1550 void HandleOrientationSwitch();
1551 TBool FirstLineEnabled() const;
1552 TBool SecondLineEnabled() const;
1553 TInt CurrentLine() const;
1556 TDesC* iSecondPrompt;
1557 MAknQueryData* iFirstData;
1558 MAknQueryData* iSecondData;
1560 TInt iFirstEditorMaxLength;
1561 TInt iSecondEditorMaxLength;
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.
1574 IMPORT_C CAknMultiLineDataQueryDialog(
1577 TDesC* aPrompt=NULL,
1578 TDesC* aPrompt2=NULL,
1579 const TTone& aTone = ENoTone);
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.
1590 IMPORT_C CAknMultiLineDataQueryDialog(
1593 TDesC* aPrompt=NULL,
1594 TDesC* aPrompt2=NULL,
1595 const TTone& aTone = ENoTone);
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.
1606 IMPORT_C CAknMultiLineDataQueryDialog(
1609 TDesC* aPrompt=NULL,
1610 TDesC* aPrompt2=NULL,
1611 const TTone& aTone = ENoTone);
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.
1622 IMPORT_C CAknMultiLineDataQueryDialog(
1625 TDesC* aPrompt=NULL,
1626 TDesC* aPrompt2=NULL,
1627 const TTone& aTone = ENoTone);
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.
1638 IMPORT_C CAknMultiLineDataQueryDialog(
1640 TTimeIntervalSeconds* aDuration,
1641 TDesC* aPrompt=NULL,
1642 TDesC* aPrompt2=NULL,
1643 const TTone& aTone = ENoTone);
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.
1654 IMPORT_C CAknMultiLineDataQueryDialog(
1656 TTimeIntervalSeconds* aDuration,
1657 TDesC* aPrompt=NULL,
1658 TDesC* aPrompt2=NULL,
1659 const TTone& aTone = ENoTone);
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.
1670 IMPORT_C CAknMultiLineDataQueryDialog(
1673 TDesC* aPrompt=NULL,
1674 TDesC* aPrompt2=NULL,
1675 const TTone& aTone = ENoTone);
1681 IMPORT_C void* ExtensionInterface( TUid aInterface );
1684 IMPORT_C virtual void CEikDialog_Reserved_1();
1685 IMPORT_C virtual void CEikDialog_Reserved_2();
1688 IMPORT_C virtual void CAknDialog_Reserved();
1691 IMPORT_C virtual void CAknQueryDialog_Reserved();
1695 * Deprecated - use data access template methods instead
1696 * A text of the first line.
1697 * @deprecated Use data access template methods instead.
1702 * Deprecated do not use
1703 * A text of the secondline.
1704 * @deprecated Use data access template methods instead.
1706 TDes16* iSecondText;
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>
1716 //---------------------------------
1717 //class CAknIpAddressQueryDialog
1718 //---------------------------------
1721 * This class should be used when user is reguest to enter IP address
1726 NONSHARABLE_CLASS(CAknIpAddressQueryDialog) : public CAknQueryDialog
1731 * Second phase construction
1734 IMPORT_C static CAknIpAddressQueryDialog* NewL(TInetAddr& aInetAddr, const TTone& aTone = ENoTone);
1737 CAknIpAddressQueryDialog(TInetAddr& aInetAddr, const TTone& aTone = ENoTone);
1743 IMPORT_C virtual ~CAknIpAddressQueryDialog();
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
1750 * @param aMinimumAddress Minimumm address
1751 * @param aMaximumAddress Maximum address.
1753 IMPORT_C void SetMinimumAndMaximum(const TInetAddr& aMinimumAddress, const TInetAddr& aMaximumAddress);
1756 * Allows dismissing of queries.
1757 * Clients can override this and implement something different.
1760 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
1766 * @return pointer to query control or NULL
1769 IMPORT_C virtual CAknQueryControl* QueryControl() const;
1771 protected://from CEikDialog
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.
1779 IMPORT_C void SetSizeAndPosition(const TSize& aSize);
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.
1786 IMPORT_C void PreLayoutDynInitL();
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.
1793 IMPORT_C void PostLayoutDynInitL();
1796 * Set the prompt inside the query control. If dialog is active redo
1799 IMPORT_C virtual void DoSetPromptL();
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.
1810 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
1813 * If the query text is ok (retrieved form query control) then display the
1814 * left soft key, otherwise hide it.
1816 IMPORT_C void UpdateLeftSoftKeyL();
1821 inline TInetAddr& InetAddr() { return iInetAddr; }
1826 inline const TInetAddr& InetAddr() const { return iInetAddr; }
1829 IMPORT_C virtual void CEikDialog_Reserved_1();
1830 IMPORT_C virtual void CEikDialog_Reserved_2();
1833 IMPORT_C virtual void CAknDialog_Reserved();
1836 IMPORT_C virtual void CAknQueryDialog_Reserved();
1842 TInetAddr& iInetAddr;
1846 //---------------------------------
1847 //class CAknFixedPointQueryDialog
1848 //---------------------------------
1851 * This class should be used when user is reguest to enter IP address
1856 NONSHARABLE_CLASS(CAknFixedPointQueryDialog) : public CAknQueryDialog
1860 * Second phase construction
1863 IMPORT_C static CAknFixedPointQueryDialog* NewL(TInt& aNumber, const TTone& aTone);
1866 CAknFixedPointQueryDialog(TInt& aNumber, const TTone& aTone = ENoTone);
1873 IMPORT_C virtual ~CAknFixedPointQueryDialog();
1877 * Set maximum and minimum addresses to editor. This override values given in resource.
1879 * @param aMinimumValue Minimumm value
1880 * @param aMaximumValue Maximum value.
1882 IMPORT_C void SetMinimumAndMaximum(TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial minimum and maximum are permitted
1884 IMPORT_C virtual TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
1891 * CAknExtQueryControl* control = STATIC_CAST(CAknExtQueryControl*,QueryControl());
1894 IMPORT_C virtual CAknQueryControl* QueryControl() const;
1896 protected://from CEikDialog
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.
1904 IMPORT_C void SetSizeAndPosition(const TSize& aSize);
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.
1911 IMPORT_C void PreLayoutDynInitL();
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.
1918 IMPORT_C void PostLayoutDynInitL();
1921 * Set the prompt inside the query control. If dialog is active redo
1924 IMPORT_C virtual void DoSetPromptL();
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.
1935 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
1938 * If the query text is ok (retrieved form query control) then display the
1939 * left soft key, otherwise hide it.
1941 IMPORT_C void UpdateLeftSoftKeyL();
1946 inline TInt& Number() { return iNumber; }
1951 inline const TInt& Number() const { return iNumber; }
1954 IMPORT_C virtual void CEikDialog_Reserved_1();
1955 IMPORT_C virtual void CEikDialog_Reserved_2();
1957 IMPORT_C virtual void CAknDialog_Reserved();
1959 IMPORT_C virtual void CAknQueryDialog_Reserved();
1965 //--------------------------------------
1966 //class CAknMultilineIpQueryDialog
1967 //--------------------------------------
1970 * Query Dialog with data input on more than one line (2 lines at the moment)
1972 * Create using NewL methods and passing parameters as appropriate.
1974 * Attention: When deriving from this class, you must call SetDataL during
1975 * second phase construction.
1980 NONSHARABLE_CLASS(CAknMultiLineIpQueryDialog) : public CAknMultiLineDataQueryDialog
1982 friend class CAknMultilineQueryDialogExtension;
1985 * Second phase construction
1988 IMPORT_C static CAknMultiLineIpQueryDialog* NewL(TInetAddr& aAddress1, TInetAddr& aAddress2, TTone aTone = ENoTone);
1990 IMPORT_C virtual ~CAknMultiLineIpQueryDialog();
1994 * Set the query data for first and second line
1995 * Must be called by derived classes during second phase construction
1998 template <class T1, class T2> void SetDataL(T1& aData1, T2& aData2)
2000 iFirstData = new (ELeave) TAknQueryData<T1>(aData1);
2001 iSecondData = new (ELeave) TAknQueryData<T2>(aData2);
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
2009 template <class T1, class T2> static CAknMultiLineIpQueryDialog*
2010 DoNewL(T1& aData1, T2& aData2, const TTone& aTone)
2012 CAknMultiLineIpQueryDialog* self = new (ELeave) CAknMultiLineIpQueryDialog(aTone);
2013 CleanupStack::PushL(self);
2015 self->SetDataL(aData1,aData2);
2017 CleanupStack::Pop(self);
2022 CAknMultiLineIpQueryDialog(const TTone& aTone);
2027 * Set prompt text for query. This this will override text given in constructor.
2029 * @param aFirstPrompt Text for prompt on the first query line
2030 * @param aSecondPrompt Text for prompt on the second query line
2032 IMPORT_C void SetPromptL(const TDesC& aFirstPrompt, const TDesC& aSecondPrompt);
2037 * Sets max length for the first editor in a query
2038 * @param aFirstTextEditorMaxLength Max length for editor
2040 IMPORT_C void SetMaxLengthOfFirstEditor(TInt aFirstTextEditorMaxLength);
2043 * Sets max length for the second editor in a query
2044 * @param aSecondTextEditorMaxLength Max length for editor
2046 IMPORT_C void SetMaxLengthOfSecondEditor(TInt aSecondTextEditorMaxLength);
2048 protected://from CEikDialog
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.
2059 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
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.
2066 IMPORT_C void PreLayoutDynInitL();
2068 IMPORT_C void HandleResourceChange(TInt aType);
2072 * If the query text is ok (retrieved form query controls) then display the
2073 * left soft key, otherwise hide it.
2075 IMPORT_C void UpdateLeftSoftKeyL();
2078 * Set the prompt inside the query control. If dialog is active redo
2081 IMPORT_C void DoSetPromptL();
2085 * Called by OfferkeyEventL(), gives a change to dismiss the query even with
2086 * keys different than Enter of Ok.
2088 * @param aKeyEvent Key event which will be checked
2089 * @return Should the query be dismissed
2091 IMPORT_C TBool NeedToDismissQueryL(const TKeyEvent& aKeyEvent);
2095 * Access to 1st query control
2097 * @return Pointer to the control of the first line.
2099 IMPORT_C CAknExtMultilineQueryControl* FirstControl() const;
2102 * Access to 2nd query control
2104 * @return Pointer to the control of the second line.
2106 IMPORT_C CAknExtMultilineQueryControl* SecondControl() const;
2113 IMPORT_C CAknQueryControl* QueryControl() const;
2117 * Prompt access for derived classes
2119 IMPORT_C TPtrC SecondPrompt() const;
2122 void HandleOrientationSwitch();
2123 TBool FirstLineEnabled() const;
2124 TBool SecondLineEnabled() const;
2125 TInt CurrentLine() const;
2128 TDesC* iSecondPrompt;
2130 MAknQueryData* iFirstData;
2131 MAknQueryData* iSecondData;
2133 TInt iFirstEditorMaxLength;
2134 TInt iSecondEditorMaxLength;
2138 TDes16* iSecondText;
2141 #endif // AKNQUERYDIALOG_H