2 * Copyright (c) 1997-1999 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.
19 #ifndef __EIKDIALG_H__
20 #define __EIKDIALG_H__
26 #ifndef __COECCNTX_H__
30 #ifndef __EIKBCTRL_H__
34 #ifndef __EIKDPOBS_H__
42 #ifndef __GULFTFLG_HRH__
43 #include <gulftflg.hrh>
49 // Header files needed by deprecated interfaces.
56 #ifndef __EIKBTGPC_H__
60 #include <AknPopupFader.h>
62 // constant definitions
63 const TInt KAknMediatorFacade(0x10275076);
67 class CEikCaptionedControl;
69 class CEikDialogPageSelector;
70 class CEikButtonGroupContainer;
71 class CEikDialogButtonCommandObserver;
72 class MEikCommandObserver;
76 struct SEikControlInfo;
78 class CEikDialogExtension ;
80 class CAknsListBoxBackgroundControlContext ;
82 // Forward declarations needed by deprecated interfaces.
87 class MAknDialogMediatorObserver;
89 struct SEikDegreesMinutesDirection;
93 * The @c CEikDialog class provides an instantiable base class for dialogs.
94 * Controls can be added directly to this class but it is normal to create
95 * a subclass to handle the controls appearing on the dialog dynamically.
97 class CEikDialog : public CEikBorderedControl,
98 public MCoeControlObserver,
99 public MEikDialogPageObserver,
100 public MCoeControlContext,
101 public MAknFadedComponent
106 DECLARE_TYPE_ID(0x10282EA8)
109 * C++ default constructor.
111 IMPORT_C CEikDialog();
116 IMPORT_C ~CEikDialog();
119 * Loads, displays, and destroys the dialog.
121 * This function loads the specified dialog from a resource and displays
122 * it. The method then destroys the dialog when it exits, therefore there
123 * is no need for the application program to destroy the dialog.
125 * In the resource file, use the @c EEikBidOk dialog button ID for an
126 * OK/Done/Continue button and @c EEikBidCancel for a Cancel button.
128 * The function returns immediately unless @c EEikDialogFlagWait has been
129 * specified in the @c DIALOG resource. If @c EEikDialogFlagWait is
130 * specified, it returns when the dialog exits.
132 * @param aResourceId The resource ID of the dialog to load.
133 * @return Zero, unless it is a waiting dialog. For a waiting dialog,
134 * the return value is the ID of the button that closed the dialog,
135 * or zero if it was the cancel button (@c EEikBidCancel).
137 IMPORT_C virtual TInt ExecuteLD(TInt aResourceId);
140 * Prepares the dialog, constructing it from the specified resource.
142 * @param aResourceId The resource ID of the dialog.
144 IMPORT_C virtual void PrepareLC(TInt aResourceId);
147 * Reads the dialog resources into the dialog, constructing it from the specified resource.
148 * The function is only to help loading dialog resources and
149 * extracting dialog data, in other cases use (@c PrepareLC()).
150 * Unlike PrepareLC(), it does not add the dialog to control stack.
153 * @param aResourceId The resource ID of the dialog.
155 IMPORT_C void ReadResourceLC(TInt aResourceId);
158 * Runs the dialog and returns the ID of the button used to dismiss it.
160 * The dialog is destroyed on exit.
162 * This function is called by the dialog framework (@c ExecuteLD()) to
163 * perform dynamic construction (layout) and to display/destroy the
164 * dialog. Static construction of the dialog must already be complete
165 * before this function is called, e.g. using @c PrepareLC().
167 * The function returns immediately unless @c EEikDialogFlagWait has
168 * been specified in the @c DIALOG resource. If @c EEikDialogFlagWait is
169 * specified it returns when the dialog exits.
171 * @return The ID of the button used to dismiss the dialog.
173 IMPORT_C virtual TInt RunLD();
176 * Sets the dialog title text from a descriptor.
179 * @param aText The descriptor containing the new title text.
181 IMPORT_C void SetTitleL(const TDesC& aText);
184 * Sets the dialog title text from a resource.
187 * @param aResourceId The ID of the resource containing the title text.
189 IMPORT_C void SetTitleL(TInt aResourceId);
192 * Sets the specified page to be dimmed or undimmed. The page is redrawn
195 * @param aPageId The ID of the page to be dimmed.
196 * @param aDimmed @c ETrue to dim the page, @c EFalse to un-dim it.
198 IMPORT_C void SetPageDimmedNow(TInt aPageId,TBool aDimmed);
201 * Sets the specified dialog line to a non-focusing state. After this
202 * function is called, the line will never be given keyboard focus.
204 * @param aControlId The ID of the control in the line which is to be
205 * set as non-focusing.
207 IMPORT_C void SetLineNonFocusing(TInt aControlId);
210 * Dims and deactivates, or un-dims and re-activates, the specified line.
212 * @param aControlId The ID of the line to dim or un-dim.
213 * @param aDimmed @c ETrue to dim the line, @c EFalse to un-dim it.
215 IMPORT_C void SetLineDimmedNow(TInt aControlId,TBool aDimmed);
218 * Makes the specified control visible or invisible. This function affects
219 * the specified control, the visibility of the caption is not affected.
221 * @param aControlId The ID of the control to make visible or invisible.
222 * @param aVisible @c ETrue to make the control visible.
223 * @c EFalse to make the control invisible.
225 IMPORT_C void MakeLineVisible(TInt aControlId,TBool aVisible);
228 * Makes the whole specified line visible and active or invisible and
229 * inactive. This function affects both the specified control and
232 * @param aControlId The ID of the control on the line to make visible
234 * @param aVisible @c ETrue to make the line visible. @c EFalse to make the
237 IMPORT_C void MakeWholeLineVisible(TInt aControlId,TBool aVisible);
240 * Deletes the specified dialog line.
242 * @param aControlId The dialog line to delete.
243 * @param aRedraw Whether to redraw the page. Default value is @c ETrue.
245 IMPORT_C void DeleteLine(TInt aControlId, TBool aRedraw=ETrue);
248 * Inserts a line in the dialog. The function takes as arguments the page
249 * and line index at which the line is to be inserted, and the resource used
252 * @param aIndex The index at which the line is to be inserted.
253 * @param aResourceId The ID of the resource which defines the line.
254 * @param aPageId The page on which the line is to be added.
256 IMPORT_C void InsertLineL(TInt aIndex,TInt aResourceId,TInt aPageId=0);
259 * Makes the specified panel button visible or invisible.
261 * @param aButtonId The ID of the panel button to make visible or invisible.
262 * @param aVisible @c ETrue to make the panel visible.
263 * @c EFalse to make it invisible.
265 IMPORT_C void MakePanelButtonVisible(TInt aButtonId,TBool aVisible);
268 * Tries to change focus to the specified line. Fails if the line ID is not
269 * valid. Calls @c PrepareForFocusTransitionL() before focus is given to
272 * @param aControlId The ID of the line to focus.
274 IMPORT_C void TryChangeFocusToL(TInt aControlId);
277 * Switches the latent line. The latent line is switched from
278 * @c aNoLongerLatent to @c aBecomesLatent. If dialog lines are latent they
279 * are not visible and are not taken into account when laying out the
280 * dialog. Latent lines can then be swapped around on the dialog later.
282 * @param aBecomesLatent The line ID of the line to become latent.
283 * @param aNoLongerLatent The line ID of the line to that is no longer
286 IMPORT_C void SwitchLineLatency(TInt aBecomesLatent,TInt aNoLongerLatent);
289 * Sets the specified page to be densely packed, or normally packed. This
290 * reduces the spacing between the dialog's lines.
292 * @param aPageId The ID of the page to be densely packed.
293 * @param aDensePacking @c ETrue for dense packing. @c EFalse for normal
296 IMPORT_C void SetPageDensePacking(TInt aPageId,TBool aDensePacking);
299 * Dynamically constructs a dialog with the specified flags and buttons
300 * and with a single activated empty page with ID 0. The dialog is therefore
301 * ready to dynamically add lines to.
303 * @param aFlags Dialog flags.
304 * @param aButtonsId Dialog buttons.
306 IMPORT_C void ConstructAutoDialogLC(TInt aFlags,TInt aButtonsId);
309 * Sets controllers return value.
311 * @param[in] aControlId Control identifier for wanted caption controller.
312 * @param[in] aControlType Type of control.
313 * @param[out] aReturnValue Controllers return value.
316 IMPORT_C void DeclareItemAuto(TInt aControlId,
321 * Lays out the dialog, setting it to take its preferred size and
322 * position for the screen.
326 IMPORT_C void Layout();
329 * Gets the preferred size of a dialog. The maximum size that the dialog
330 * must fit within must be specified, e.g. the size of the physical screen.
332 * @param aMaxSize The maximum size of the area in which the dialog must
334 * @return The preferred size of the dialog.
336 IMPORT_C TSize PreferredSize(const TSize& aMaxSize) const;
339 * Creates a control line on the page ID specified active page in
341 * The line can thereafter be accessed through the identifier @c aControlId.
342 * A control of type @c aControlType is created by the control factory and
343 * the return value of the line set to @c aReturnValue. If the value of
344 * @c aControlType is not known to the control factory then the construction
345 * of the control must be handled by @c CreateCustomControlL().
347 * @param aCaption The caption to appear in the dialog line.
348 * @param aControlId The ID of the active page on which the control
349 * line is to be created.
350 * @param aControlType The type of control to create.
351 * @param aReturnValue Deprecated. A random pointer.
352 * @return A pointer to the newly created control.
354 IMPORT_C CCoeControl* CreateLineByTypeL(const TDesC& aCaption,
360 * Creates a control line on the caption specified active page
362 * The line can thereafter be accessed through the identifier
364 * A control of type @c aControlType is created by the control
365 * factory and the return value of the line set to @c aReturnValue.
366 * If the value of @c aControlType is not known to the control factory
367 * then the construction of the control must be handled by
368 * @c CreateCustomControlL().
370 * @param aCaption The active page on which the control line is
372 * @param aPageId The ID of the active page on which the control line is
374 * @param aControlId The ID of the control. After the line is created this
375 * can be used to access it.
376 * @param aControlType The type of control to create.
377 * @param aReturnValue Deprecated. A random pointer.
378 * @return A pointer to the newly created control.
380 IMPORT_C CCoeControl* CreateLineByTypeL(const TDesC& aCaption,
387 * Sets the specified control's caption text from a descriptor.
389 * @param aControlId The ID of the control for which the caption
391 * @param aText The text for the caption.
393 IMPORT_C void SetControlCaptionL(TInt aControlId,const TDesC& aText);
396 * Sets the specified control's caption text from a resource.
398 * @param aControlId The ID of the control for which the caption
400 * @param aResourceId The ID of the resource containing the text for
403 IMPORT_C void SetControlCaptionL(TInt aControlId,TInt aResourceId);
406 * Gets a pointer to the specified control's caption.
408 * @param aControlId The ID of the control for which the label is required.
409 * @return A pointer to the caption.
411 IMPORT_C CEikLabel* ControlCaption(TInt aControlId) const;
414 * Returns a pointer to the specified control.
416 * Panics if the control ID is invalid. Does not imply transfer
419 * @param aControlId The ID of the control for which a pointer is required.
420 * @return A pointer to the control with ID aControlId.
422 IMPORT_C CCoeControl* Control(TInt aControlId) const;
425 * Gets a pointer to the specified control.
427 * @param aControlId The ID of the control for which a pointer is required.
428 * @return A pointer to the control with ID aControlId, or
429 * NULL if it doesn't exist.
431 IMPORT_C CCoeControl* ControlOrNull(TInt aControlId) const;
434 * Gets a reference to the dialog's command button container.
436 * @return The dialog's button group container.
438 IMPORT_C CEikButtonGroupContainer& ButtonGroupContainer() const;
441 * Gets a reference to the dialog title bar.
443 * @return A reference to the dialog title bar.
445 IMPORT_C CEikMover& Title() const;
448 * Gets a page id for the current page.
452 IMPORT_C TInt ActivePageId() const;
455 * Activates the first page on the dialog. At least one page must be active
456 * before this method can be used.
458 IMPORT_C void ActivateFirstPageL() const;
462 // To Support Edit/View state switch for forms (Sapphire DFRD)
463 // This breaks Binary Compatibility
466 * Sets the dialog to either editable or uneditable
468 * @param aEditable @c ETrue if dialog is editable.
469 * @c EFalse if dialog is uneditable.
471 IMPORT_C void SetEditableL( TBool aEditable ) ;
474 * Checks if the dialog is editable.
476 * @return @c ETrue if editable.
478 IMPORT_C TBool IsEditable() const ;
481 public: // from CCoeControl
484 * From @c CCoeControl.
486 * Handles a key event. Overrides @c CCoeControl::OfferKeyEventL().
488 * @param aKeyEvent The key event.
489 * @param aType The type of key event: @c EEventKey, @c EEventKeyUp
490 * or @c EEventKeyDown.
491 * @return Indicates whether or not the key event was used by this control.
492 * @c EKeyWasConsumed if the control takes action on the key event
493 * or @c EKeyWasNotConsumed otherwise.
495 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
499 * From @c CCoeControl.
501 * Responds to a change in focus.
503 * This is called whenever the control gains or loses focus, as a result
504 * of a call to @c SetFocus(). A typical use of @c FocusChanged() is to
505 * change the appearance of the control, for example by drawing a focus
506 * rectangle around it.
508 * The default implementation is empty, and should be overridden by the
509 * @c CCoeControl-derived class.
511 * @param aDrawNow Contains the value that was passed to it by
514 IMPORT_C void FocusChanged(TDrawNow aDrawNow);
517 * From @c CCoeControl.
519 * Gets the list of logical colours used to draw the control.
521 * The list includes an explanation of how each colour is used.
522 * The default implementation is empty.
524 * If overriding @c GetColorUseListL(), the implementation must include
525 * a base call to @c CCoeControl's @c GetColorUseListL().
528 * @param &aColorUseList The colour list.
530 IMPORT_C virtual void GetColorUseListL(
531 CArrayFix<TCoeColorUse>& aColorUseList) const;
532 // not available before Release 005u
535 * From @c CCoeControl.
537 * Handles a change to the control's resources.
539 * The types of resources handled are those which are shared across the
540 * environment, e.g. colours or fonts. For colour scheme changes,
541 * @c DrawDeferred() is called in order to redraw the control.
543 * If overriding @c HandleResourceChange(), the implementation must include
544 * a base call to @c CCoeControl's @c HandleResourceChange().
547 * @param aType A message UID value.
549 IMPORT_C virtual void HandleResourceChange(TInt aType);
550 // not available before Release 005u
553 * From @c CCoeControl.
555 * Gets the control's input capabilities.
557 * Classes that override @c CCoeControl::OfferKeyEventL() should also
558 * override this function, returning a @c TCoeInputCapabilities object
559 * whose attributes correspond to the behaviour of the @c OfferKeyEventL()
560 * function. The default implementation returns
561 * @c TCoeInputCapabilities::ENone.
563 * It is not necessary to call @c InputCapabilities() on any component
564 * controls from inside a class's @c InputCapabilities() function. This
565 * is done automatically by the UI Control Framework.
568 * @return The control's input capabilities.
570 IMPORT_C TCoeInputCapabilities InputCapabilities() const;
573 * From @c CCoeControl.
575 * Sets the dialog visibility
577 * @param aVisible @c ETrue control is visible.
578 * @c EFalse control is invisible.
580 IMPORT_C void MakeVisible(TBool aVisible);
583 * From @c CCoeControl.
585 * Handles pointer events.
587 * This function gets called whenever a pointer event occurs in the
588 * control, i.e. when the pointer is within the control's extent,
589 * or when the control has grabbed the pointer. The control should
590 * implement this function to handle pointer events.
592 * Note: events of type @c EButton1Down are processed before
593 * @c HandlePointerEventL() is called, in order to transfer keyboard
594 * focus to the control in which the @c EButton1Down event occurred.
596 * If overriding @c HandlePointerEventL(), the implementation must include
597 * a base call to @c CCoeControl's @c HandlePointerEventL().
599 * @param aPointerEvent The pointer event.
601 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
603 protected: // from MEikDialogPageObserver
606 * From @c MEikDialogPageObserver.
608 * Should be implemented to prepare for focus transition from the
611 * For example to validate the contents of the current control.
613 IMPORT_C virtual void PrepareForFocusTransitionL();
616 * From @c MEikDialogPageObserver.
618 * Should be implemented to take any action required when the active
619 * dialog page is changed.
623 * @param aPageId The ID of the page being switched to.
625 IMPORT_C virtual void PageChangedL(TInt aPageId);
628 * From @c MEikDialogPageObserver
630 * Should be implemented to take any action required when the current
631 * line is changed to @c aControlId.
635 * @param aControlId The ID of the control being switched to.
637 IMPORT_C virtual void LineChangedL(TInt aControlId);
639 public: // from MEikDialogPageObserver
642 * From @c MEikDialogPageObserver.
644 * Creates a control line in the dialog.on the active page with caption
646 * The line can thereafter be accessed through the identifier
648 * A control of type @c aControlType is created by the @c Eikon
649 * control factory and the return value of the line set to @c aReturnValue.
650 * If the value of @c aControlType is not known to the Eikon control
651 * factory then the construction of the control must be handled by
652 * @c CreateCustomControlL.
654 * @param aControlType The type of the custom control.
655 * @return Information for the custom control.
657 IMPORT_C virtual SEikControlInfo CreateCustomControlL(TInt aControlType);
660 * From @c MEikDialogPageObserver.
663 * Ths should be overriden with mappings between the base control types
664 * that form knows how to layout.
666 * Always returns @c MEikDialogPageObserver::EUnknownType.
668 * @param aControlType Not used.
669 * @return Current implementation always
670 * returns @c MEikDialogPageObserver::EUnknownType.
672 IMPORT_C MEikDialogPageObserver::TFormControlTypes
673 ConvertCustomControlTypeToBaseControlType(TInt aControlType) const;
676 * From @c MEikDialogPageObserver.
678 * Should be implemented to get the custom auto value for the custom control
679 * @c aControl of type @c aControlType with return value @c aReturnValue.
681 * This method is included in the interface to support deprecated legacy
686 * @param aReturnValue The custom controls return value.
687 * @param aControlType The type of the custom control.
688 * @param aControl The control whose auto value is being retrieved.
691 IMPORT_C virtual void GetCustomAutoValue(TAny* aReturnValue,
693 const CCoeControl* aControl);
695 protected: // from MCoeControlContext
698 * From @c MCoeControlContext.
700 * Initialises graphics context settings.
702 * This function should be implemented by derived classes to initialise
703 * the graphics context, given by @c aGc, with the required settings.
705 * @param aGc The graphics context to be initialised.
707 IMPORT_C void PrepareContext(CWindowGc& aGc) const;
709 protected: //from CCoeControl
712 * From @c CCoeControl.
714 * Writes the internal state to the given stream.
716 * @param[out] aWriteStream Target stream.
718 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
720 private: // from CCoeControl
722 IMPORT_C void Draw(const TRect& aRect) const;
727 * Returns the number of the control components.
729 * In Avkon returns 2 as the button group container is not internal.
731 * @return Number of control components.
733 IMPORT_C TInt CountComponentControls() const;
736 * Returns a pointer to the component control at the specified index
737 * in the component control list.
739 * Does not imply transfer of ownership.
741 * @param aIndex The index of the required component control.
742 * @return The required component control.
744 IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
749 * Gets number of lines in the specified page.
751 * @param aPageIndex Index of the page container.
752 * @return The number of lines in the page.
754 IMPORT_C TInt GetNumberOfLinesOnPage(TInt aPageIndex) const;
757 * Gets number of pages in the page selector.
759 * @return The number of pages.
761 IMPORT_C TInt GetNumberOfPages() const;
764 * Gets specified line from specified page.
766 * @param aLineIndex Index of the requested line.
767 * @param aPageIndex Index of the requested page.
768 * @return The wanted line.
770 IMPORT_C CEikCaptionedControl* GetLineByLineAndPageIndex(TInt aLineIndex,
771 TInt aPageIndex) const;
775 IMPORT_C void SizeChanged();
777 IMPORT_C TSize MinimumSize();
779 IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
781 IMPORT_C void Reserved_2();
788 IMPORT_C void* ExtensionInterface( TUid aInterface );
790 protected: // from MCoeControlObserver
793 * From @c MCoeControlObserver.
795 * Handles control events.
797 * The default implementation handles events of type @c EEventStateChanged,
798 * @c EEventInteractionRefused, and @c EEventPrepareFocusTransition by
799 * calling @c HandleControlStateChangeL(), @c HandleInteractionRefused(),
800 * and @c PrepareForFocusTransitionL() respectively.
802 * Overrides @c MCoeControlObserver::HandleControlEventL().
804 * @param aControl The control reporting the event.
805 * @param aEventType The event type.
807 IMPORT_C void HandleControlEventL(CCoeControl* aControl,
808 TCoeEvent aEventType);
810 protected: // new functions
813 * Tries to exit the dialog when the specified button is pressed, if this
814 * button should exit the dialog.
816 * See @c OkToExitL() to determine which buttons can exit the dialog.
818 * This will fail if user exit is prevented by the
819 * @c EEikDialogFlagNoUserExit flag. If the @c EEikDialogFlagNotifyEsc flag
820 * is not set and the dialog has been cancelled it immediately deletes
823 * @param aButtonId The id of the pressed button.
825 IMPORT_C void TryExitL(TInt aButtonId);
828 * Adjusts the IDs of all controls on a specified page.
830 * The adjustment consists of incrementing all the control IDs by
831 * @c aControlIdDelta.
833 * @param aPageId The page on which the control IDs are to be adjusted.
834 * @param aControlIdDelta The amount to increment the IDs.
836 IMPORT_C void AdjustAllIdsOnPage(TInt aPageId,TInt aControlIdDelta);
839 * Protected constructor creates a sleeping dialog from a resource.
841 * A sleeping dialog is one which can be displayed at any time since
842 * its memory resources are pre-allocated.
844 * @param aResourceId The resource ID of the dialog to be constructed.
846 IMPORT_C void ConstructSleepingDialogL(TInt aResourceId);
849 * Protected construction of a high priority sleeping dialog from
852 * A sleeping dialog is one which can be displayed at any time since
853 * its memory resources are pre-allocated.
855 * @param aResourceId The resource ID of the dialog to be constructed.
857 IMPORT_C void ConstructSleepingAlertDialogL(TInt aResourceId);
860 * Rouses a sleeping dialog by dynamically constructing the dialog and
861 * then bringing it to the front.
863 * Derived dialogs should pre-allocate any memory they need for
864 * initialisation during construction via @c ConstructFromResourceL()
865 * for each individual control. Derived versions of @c PreLayoutDynInitL()
866 * cannot rely on allocating any further memory.
870 IMPORT_C TInt RouseSleepingDialog();
873 * Exits sleeping dialog without deleting it.
875 IMPORT_C void ExitSleepingDialog();
878 * Gets the ID of the control in the focused line.
880 * @return Current control ID.
882 IMPORT_C TInt IdOfFocusControl() const;
885 * Gets the line index of the specified control.
887 * The control must be on the active page.
889 * @param aControl The control for which the line index is required.
890 * @return The line index, or @c KErrNotFound if the control is not on the
893 IMPORT_C TInt FindLineIndex(const CCoeControl& aControl) const;
896 * Gets a pointer to the line containing the specified control.
898 * This does not imply transfer of ownership from the dialog.
900 * @param aControlId The ID of the control.
901 * @return A pointer to the line containing the control identified by
904 IMPORT_C CEikCaptionedControl* Line(TInt aControlId) const;
907 * Gets a pointer to the current line.
909 * This does not imply transfer of ownership from the dialog.
911 * @return A pointer to the current line.
913 IMPORT_C CEikCaptionedControl* CurrentLine() const;
916 * Rotates the focus by a specified number of steps.
918 * Each line is a step, as are dialog tabs.
920 * @param aDelta The number of steps.
921 * @return @c ETrue if rotation of focus is successful,
922 * @c EFalse if there are no lines in the dialog or the rotation is
923 * otherwise unsuccessful.
925 IMPORT_C TBool RotateFocusByL(TInt aDelta);
928 * Gets the index of the dialog's active page.
930 * Pages are indexed from 0 in the order they are added.
932 * @return The index of the active page.
934 IMPORT_C TInt ActivePageIndex() const;
937 * Recalculates the minimum sizes of the lines on the active page.
939 * Overrides @c CCoeControl::ResetLineMinimumSizes().
941 IMPORT_C void ResetLineMinimumSizes();
944 * Swaps the dialog's button group container with a new container.
946 * The dialog takes ownership of the new container. A pointer to the old
947 * button group container is returned and ownership of this object is
948 * transferred to the calling object.
950 * @param aContainer The new button group container.
951 * @return A pointer to the old button group container. This is no longer
952 * owned by the dialog.
954 IMPORT_C CEikButtonGroupContainer* SwapButtonGroupContainer(
955 CEikButtonGroupContainer* aContainer);
958 * Gets a pointer to the dialog's internal button command observer.
960 * This is required when creating a new button group container for
963 * A dialog uses a proxy to observe button commands. This means dialog
964 * subclasses can directly observe commands, either issued by controls
965 * added to the dialog pages, or by menus launched by the dialog.
968 * @return A pointer to the dialog's internal button
971 IMPORT_C MEikCommandObserver* ButtonCommandObserver() const;
973 protected: // new functions
978 * @param aButtonId Not used.
979 * @return Always return @c ETrue.
981 IMPORT_C virtual TBool OkToExitL(TInt aButtonId);
984 * Initializes the dialog's controls before the dialog is sized and
985 * layed out. Empty by default.
987 IMPORT_C virtual void PreLayoutDynInitL();
990 * Initializes the dialog's controls after the dialog has been sized
991 * but before it has been activated. Empty by default.
993 IMPORT_C virtual void PostLayoutDynInitL();
996 * Sets the line which initally receives focus.
997 * This is the first focusable line on the first page in the
998 * dialog by default. Reimplementations of this method must
999 * activate a page before doing anything else.
1001 IMPORT_C virtual void SetInitialCurrentLine();
1004 * Handles a state change in the control with id aControlId.
1007 * @param aControlId Not used.
1009 IMPORT_C virtual void HandleControlStateChangeL(TInt aControlId);
1012 * Should handle an attempt by the user to activate a dimmed button with
1013 * id aControlId. Prints an info message by default.
1015 * Not implemented / Does nothing in Avkon.
1017 * @param aControlId Not used.
1019 IMPORT_C virtual void HandleInteractionRefused(TInt aControlId);
1022 * Sets the size and position of the dialog given the specified size hint.
1024 * The parameter is ignored if the @c FlagFillAppClientRect is set.
1025 * Otherwise it it centered and given the size that was asked for.
1027 * @param aSize The new size.
1029 IMPORT_C virtual void SetSizeAndPosition(const TSize& aSize);
1032 * Returns the border style for this dialog.
1034 * @return Border style. Always returns @c AknBorderId::EAknBorderNotePopup.
1036 IMPORT_C virtual TInt BorderStyle();
1041 * Routine to map the button id ( Avkon softkey command id) to
1042 * @c CEikBidCancel if it is a "cancel" type command type.
1044 * The following cases are mapped to a give an @c ExecuteLD return value
1047 * @c EAknSoftkeyCancel:
1048 * @c EAknSoftkeyBack:
1051 * Other cases are left unchanged.
1053 * This operation is performed at the last minute and does not affect other
1054 * processing in @c CEik/AknDialog.
1056 * It is a framework method; It can be overridded to obtain customized
1059 * @param aButtonId input id to map.
1060 * @return 0 for re-mapped negative command ids other values
1061 * are returned as their original command id values.
1063 IMPORT_C virtual TInt MappedCommandId( TInt aButtonId );
1066 * Get form flags of the active page
1068 * @return Active page's form flags
1070 IMPORT_C TInt FormFlagsFromActivePage();
1072 /* The following two methods are deprecated
1073 GetFirstLineOnFirstPageOrNull
1076 instead the functionality can be achieved by
1077 TInt GetNumberOfLinesOnPage(TInt aPageIndex) const;
1078 TInt GetNumberOfPages() const;
1079 CEikCaptionedControl* GetLineByLineAndPageIndex(TInt aLineIndex,
1080 TInt aPageIndex) const;
1084 * Gets first line of the first page.
1087 * @return Pointer to the first line of the first page. If NULL there is no
1090 IMPORT_C virtual CEikCaptionedControl* GetFirstLineOnFirstPageOrNull();
1093 * Gets all lines in the given page.
1095 * @param aControls After execution holds all captions in the page.
1096 * @param aPageId ID of the target page.
1099 IMPORT_C void ControlsOnPage(RArray<CEikCaptionedControl*>& aControls,
1100 TInt aPageId) const;
1105 protected: // from MObjectProvider
1108 * From @c MObjectProvider.
1110 * Retrieves an object of the same type as that encapsulated in aId.
1112 * This function is used to allow controls to ask their owners for
1113 * access to other objects that they own.
1115 * Other than in the case where NULL is returned, the object returned
1116 * must be of the same object type - that is, the @c ETypeId member of
1117 * the object pointed to by the pointer returned by this function must
1118 * be equal to the iUid member of aId.
1120 * @param aId An encapsulated object type ID.
1121 * @return Encapsulates the pointer to the object provided.
1122 * Note that the encapsulated pointer may be NULL.
1124 IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
1126 private: // new functions
1128 IMPORT_C virtual void CEikDialog_Reserved_1();
1130 IMPORT_C virtual void CEikDialog_Reserved_2();
1132 private: // internal functions
1134 void BaseConstructL();
1136 void StaticConstructL(TInt aResourceId);
1138 void DynamicConstructL();
1140 void CreateTitleBarL();
1142 void CreateButtonGroupContainerL(TInt aResourceId);
1144 void CreatePageSelectorL();
1146 void CreatePageSelectorL(TInt aResourceId);
1148 TInt WaitAsRequired();
1150 void StopWaitingAsRequired();
1152 TKeyResponse TryAnimateButtonAndExitL(TInt aKeycode);
1154 void GetAutoValues();
1156 void CommonConstructSleepingDialogL(TInt aResourceId);
1158 void SetBorderStyle();
1160 void FadeBehindPopup(TBool aFade);
1162 void DoFadeBehindPopup(TBool aFade);
1164 void DoResourceChangeLayout();
1167 * Handles embedded softkey state change.
1172 void HandleEmbeddedSofkeyStateChange();
1175 * Call back method to handle @c CEikCba content changes.
1179 * @param aAny pointer to @c CEikDialog instance.
1180 * @return error code.
1182 static TInt HandleEmbeddedSoftkeyStateChangeCallBack( TAny* aAny );
1185 * Enables/disables content observer.
1189 * @param aEnabled ETrue to enable, EFalse to disable.
1191 void EnableContentObserver( TBool aEnabled );
1193 // From MAknFadedComponent
1195 IMPORT_C virtual TInt CountFadedComponents();
1197 IMPORT_C virtual CCoeControl* FadedComponent(TInt aIndex);
1201 CEikMover* iTitleBar;
1203 CEikDialogPageSelector* iPageSelector;
1205 CEikButtonGroupContainer* iButtonGroupContainer;
1207 CEikDialogButtonCommandObserver* iButtonCommandObserver;
1211 TInt* iExitConfirmed;
1215 TAknPopupFader iPopupFader;
1217 CActiveSchedulerWait iWait; // owned, safe to use as direct member data.
1222 * Access to CEikDialog's extension object.
1224 * @return Pointer to extension object.
1225 * Constructed in @c CEikDialog::BaseContructL
1227 IMPORT_C CEikDialogExtension* Extension() const;
1231 CEikDialogExtension* iExtension ; // owned
1235 friend class CEikDialogButtonCommandObserver;
1237 friend class CEikDialogExtension;
1239 friend class CAknDialog;
1241 friend class CAknCharMap;
1243 friend class CAknCharMapDialog;
1245 friend class CAknNoteDialog;
1247 friend class CAknMediatorFacade;
1249 public: // added JIn to allow access to dialog flags.
1252 * Gets flags of the dialog.
1254 * @return Dialog flags.
1256 IMPORT_C TInt DialogFlags();
1261 * Sets the current Dialog into the Page selector
1263 void RegisterDialgWithPageSelector();
1266 // Deprecated interfaces.
1267 // Defined in EIKDLGUT.CPP.
1269 public: // Declare auto interfaces.
1272 * @deprecated Not supported.
1274 IMPORT_C void DeclareAutoTextEditorL(TInt aId,TDes* aText);
1277 * @deprecated Not supported.
1279 IMPORT_C void DeclareAutoNumberEditor(TInt aId,TInt* aNumber);
1282 * @deprecated Not supported.
1284 IMPORT_C void DeclareAutoRangeEditor(TInt aId,SEikRange* aRange);
1287 * @deprecated Not supported.
1289 IMPORT_C void DeclareAutoTimeEditor(TInt aId,TTime* aTime);
1292 * @deprecated Not supported.
1294 IMPORT_C void DeclareAutoDateEditor(TInt aId,TTime* aDate);
1297 * @deprecated Not supported.
1299 IMPORT_C void DeclareAutoTimeAndDateEditor(TInt aId,TTime* aTimeAndDate);
1302 * @deprecated Not supported.
1304 IMPORT_C void DeclareAutoDurationEditor(TInt aId,
1305 TTimeIntervalSeconds* aDuration);
1308 * @deprecated Not supported.
1310 IMPORT_C void DeclareAutoTimeOffsetEditor(TInt aId,
1311 TTimeIntervalSeconds* aTimeOffset);
1313 // IMPORT_C void DeclareAutoLatitudeEditor(TInt aId,
1314 // SEikDegreesMinutesDirection* aLatitude);
1315 // IMPORT_C void DeclareAutoLongitudeEditor(TInt aId,SEikDegreesMinutesDirection* aLongitude);
1318 * @deprecated Not supported.
1320 IMPORT_C void DeclareAutoFixedPointEditor(TInt aId,TInt* aValue);
1323 * @deprecated Not supported.
1325 IMPORT_C void DeclareAutoSecretEditor(TInt aId,TDes* aText);
1327 public: // Add auto interfaces.
1330 * @deprecated Not supported.
1332 IMPORT_C void AddAutoTextEditorL(const TDesC& aPrompt,TInt aId,TInt aFlags,TInt aWidthInChars,TInt aNoOfLines,TDes* aReturn);
1335 * @deprecated Not supported.
1337 IMPORT_C void AddAutoGlobalTextEditorL(const TDesC& aPrompt,TInt aId,TInt aFlags,TInt aWidthInChars,TInt aNoOfLines,TInt aTextLimit,CGlobalText* aReturn,TInt aFontControlFlags=EGulFontControlAll,TInt aFontNameFlags=EGulNoSymbolFonts);
1340 * @deprecated Not supported.
1342 IMPORT_C void AddAutoRichTextEditorL(const TDesC& aPrompt,TInt aId,TInt aFlags,TInt aWidthInChars,TInt aNoOfLines,TInt aTextLimit,CGlobalText* aReturn,TInt aFontControlFlags=EGulFontControlAll,TInt aFontNameFlags=EGulNoSymbolFonts);
1345 * @deprecated Not supported.
1347 IMPORT_C void AddAutoNumberEditorL(const TDesC& aPrompt,TInt aId,TInt aMin,TInt aMax,TInt* aReturn);
1350 * @deprecated Not supported.
1352 IMPORT_C void AddAutoRangeEditorL(const TDesC& aPrompt,TInt aId,TInt aMin,TInt aMax,HBufC* aSeparatorText,SEikRange* aReturn);
1355 * @deprecated Not supported.
1357 IMPORT_C void AddAutoTimeEditorL(const TDesC& aPrompt,TInt aId,const TTime& aMin,const TTime& aMax,TBool aNoSeconds,TTime* aReturn);
1360 * @deprecated Not supported.
1362 IMPORT_C void AddAutoDateEditorL(const TDesC& aPrompt,TInt aId,const TTime& aMin,const TTime& aMax, TBool aNoPopout,TTime* aReturn);
1365 * @deprecated Not supported.
1367 IMPORT_C void AddAutoTimeAndDateEditorL(const TDesC& aPrompt,TInt aId,const TTime& aMin,const TTime& aMax,TBool aNoSeconds,TBool aNoPopout,HBufC* aInterveningText,TTime* aReturn);
1370 * @deprecated Not supported.
1372 IMPORT_C void AddAutoDurationEditorL(const TDesC& aPrompt,TInt aId,const TTimeIntervalSeconds& aMin,const TTimeIntervalSeconds& aMax,TBool aNoSeconds,TTimeIntervalSeconds* aReturn);
1375 * @deprecated Not supported.
1377 IMPORT_C void AddAutoTimeOffsetEditorL(const TDesC& aPrompt,TInt aId,const TTimeIntervalSeconds& aMin,const TTimeIntervalSeconds& aMax,TBool aNoSeconds,TTimeIntervalSeconds* aReturn);
1379 // IMPORT_C void AddAutoLatitudeEditorL(const TDesC& aPrompt,TInt aId,HBufC* aDegreeSign,HBufC* aMinuteSign,HBufC* aSecondSign,HBufC* aTextForNorth,TChar aKeyToMatchForNorth,HBufC* aTextForSouth,TChar aKeyToMatchForSouth,SEikDegreesMinutesDirection* aReturn,TInt aFlags=0);
1380 // IMPORT_C void AddAutoLongitudeEditorL(const TDesC& aPrompt,TInt aId,HBufC* aDegreeSign,HBufC* aMinuteSign,HBufC* aSecondSign,HBufC* aTextForEast,TChar aKeyToMatchForEast,HBufC* aTextForWest,TChar aKeyToMatchForWest,SEikDegreesMinutesDirection* aReturn,TInt aFlags=0);
1383 * @deprecated Not supported.
1385 IMPORT_C void AddAutoFloatEditorL(const TDesC& aPrompt,TInt aId,const TReal& aMin,const TReal& aMax,TReal* aReturn);
1388 * @deprecated Not supported.
1390 IMPORT_C void AddAutoFixedPointEditorL(const TDesC& aPrompt,TInt aId,TInt aMin,TInt aMax,TInt* aRetValue,TInt aDecimalPlaces);
1393 * @deprecated Not supported.
1395 IMPORT_C void AddAutoSecretEditorL(const TDesC& aPrompt,TInt aId,TDes* aReturn);
1397 protected: // Set state interfaces.
1400 * @deprecated Not supported.
1402 IMPORT_C void SetLabelL(TInt aControlId, const TDesC& aDes);
1405 * @deprecated Not supported.
1407 IMPORT_C void SetLabelL(TInt aControlId, TInt aResourceId);
1410 * @deprecated Not supported.
1412 IMPORT_C void SetLabelReserveLengthL(TInt aControlId, TInt aLength);
1415 * @deprecated Not supported.
1417 IMPORT_C void SetEdwinTextL(TInt aControlId, const TDesC* aDes);
1420 * @deprecated Not supported.
1422 IMPORT_C void SetTextEditorTextL(TInt aControlId,const CGlobalText* aGlobalText);
1425 * @deprecated Not supported.
1427 IMPORT_C void ResetSecretEditor(TInt aControlId);
1430 * @deprecated Not supported.
1432 IMPORT_C void SetFloatingPointEditorValueL(TInt aControlId, const TReal* aValue);
1435 * @deprecated Not supported.
1437 IMPORT_C void SetFixedPointEditorValueL(TInt aControlId,TInt aValue);
1440 * @deprecated Not supported.
1442 IMPORT_C void SetFixedPointEditorDecimal(TInt aControlId, TInt aDecimal);
1445 * @deprecated Not supported.
1447 IMPORT_C void SetNumberEditorMinAndMax(TInt aControlId, TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial min and max are permitted
1450 * @deprecated Not supported.
1452 IMPORT_C void SetNumberEditorValue(TInt aControlId, TInt aNumber);
1455 * @deprecated Not supported.
1457 IMPORT_C void SetFloatEditorMinAndMax(TInt aControlId,TInt aMin,TInt aMax);
1460 * @deprecated Not supported.
1462 IMPORT_C void SetFloatEditorValueL(TInt aControlId,TReal aFloat);
1465 * @deprecated Not supported.
1467 IMPORT_C void SetRangeEditorMinAndMax(TInt aControlId, TInt aMinimumValue, TInt aMaximumValue); // only values inside the initial min and max are permitted
1470 * @deprecated Not supported.
1472 IMPORT_C void SetRangeEditorValue(TInt aControlId, const SEikRange& aRange);
1475 * @deprecated Not supported.
1477 IMPORT_C void SetTTimeEditorMinAndMax(TInt aControlId, const TTime& aMinimumTime, const TTime& aMaximumTime); // only values inside the initial min and max are permitted
1480 * @deprecated Not supported.
1482 IMPORT_C void SetTTimeEditorValue(TInt aControlId, const TTime& aTime);
1485 * @deprecated Not supported.
1487 IMPORT_C void SetDurationEditorMinAndMax(TInt aControlId, const TTimeIntervalSeconds& aMinimumDuration, const TTimeIntervalSeconds& aMaximumDuration); // only values inside the initial min and max are permi
1490 * @deprecated Not supported.
1492 IMPORT_C void SetDurationEditorValue(TInt aControlId, const TTimeIntervalSeconds& aDuration);
1495 * @deprecated Not supported.
1497 IMPORT_C void SetTimeOffsetEditorMinAndMax(TInt aControlId, const TTimeIntervalSeconds& aMinimumTimeOffset, const TTimeIntervalSeconds& aMaximumTimeOffset); // only values inside the initial min and max are
1500 * @deprecated Not supported.
1502 IMPORT_C void SetTimeOffsetEditorValue(TInt aControlId, const TTimeIntervalSeconds& aTimeOffset);
1504 // IMPORT_C void SetLatitudeEditorValue(TInt aControlId, const SEikDegreesMinutesDirection& aLatitude);
1505 // IMPORT_C void SetLongitudeEditorValue(TInt aControlId, const SEikDegreesMinutesDirection& aLongitude);
1508 * @deprecated Not supported.
1510 IMPORT_C void SetListBoxCurrentItem(TInt aControlId, TInt aItem);
1513 * @deprecated Not supported.
1515 IMPORT_C void SetFileNameL(TInt aControlId, const TDesC* aFileName);
1517 protected: // Get state interfaces.
1520 * @deprecated Not supported.
1522 IMPORT_C void GetLabelText(TDes& aDes,TInt aControlId) const;
1525 * @deprecated Not supported.
1527 IMPORT_C void GetEdwinText(TDes& aDes,TInt aControlId) const;
1530 * @deprecated Not supported.
1532 IMPORT_C void GetTextEditorText(CGlobalText*& aGlobalText,TInt aControlId);
1535 * @deprecated Not supported.
1537 IMPORT_C void GetSecretEditorText(TDes& aDes,TInt aControlId) const;
1540 * @deprecated Not supported.
1542 IMPORT_C TReal FloatingPointEditorValue(TInt aControlId) const;
1545 * @deprecated Not supported.
1547 IMPORT_C TInt FixedPointEditorValue(TInt aControlId) const;
1550 * @deprecated Not supported.
1552 IMPORT_C TInt FixedPointEditorDecimal(TInt aControlId) const;
1555 * @deprecated Not supported.
1557 IMPORT_C TReal FloatEditorValue(TInt aControlId) const;
1560 * @deprecated Not supported.
1562 IMPORT_C TInt NumberEditorValue(TInt aControlId) const;
1565 * @deprecated Not supported.
1567 IMPORT_C SEikRange RangeEditorValue(TInt aControlId) const;
1570 * @deprecated Not supported.
1572 IMPORT_C TTime TTimeEditorValue(TInt aControlId) const;
1575 * @deprecated Not supported.
1577 IMPORT_C TTimeIntervalSeconds DurationEditorValue(TInt aControlId) const;
1580 * @deprecated Not supported.
1582 IMPORT_C TTimeIntervalSeconds TimeOffsetEditorValue(TInt aControlId) const;
1584 // IMPORT_C SEikDegreesMinutesDirection LatitudeEditorValue(TInt aControlId) const;
1585 // IMPORT_C SEikDegreesMinutesDirection LongitudeEditorValue(TInt aControlId) const;
1588 * @deprecated Not supported.
1590 IMPORT_C void GetAutoValuesFromPage(CEikCapCArray* aLines);
1593 * @deprecated Not supported.
1595 IMPORT_C TInt ListBoxCurrentItem(TInt aControlId) const;
1598 * @deprecated Not supported.
1600 IMPORT_C void GetFileName(TFileName* aFileName,TInt aControlId) const;
1603 * Only has effect on forms, call this after adding or deleting lines.
1605 * @param aRedraw Whether to redraw the page. Usually expect this to be
1608 IMPORT_C void UpdatePageL(TBool aRedraw);
1613 * From @c CEikDialog (@c MEikDialogPageObserver).
1615 * The interface method which is called when dialog page is tapped with
1618 * @param aEventID An event identification number.
1620 IMPORT_C virtual void HandleDialogPageEventL(TInt aEventID);
1623 * Instantiates mediator support and send a command with given parameters
1624 * when a dialog is brought to display.
1627 * @param aDialogIndex unique index to identify a dialog within the category.
1628 * @param aCatUid gategory uid, if default paramter is passed, application
1629 * uid is used as a category.
1631 IMPORT_C void PublishDialogL(TInt aDialogIndex, TUid aCatUid = KNullUid);
1634 * Instantiates mediator support and passes possible feedback to given
1635 * intance. If no observer is set, dialog tries to handle feedback by it
1637 * Please note that no commands will be instantiated unless command
1638 * identifiers are are set using @c PublishDialogL.
1641 * @param aObserver Pointer to instance implementing
1642 * @c MAknDialogMediatorObserver API. Can be NULL.
1644 IMPORT_C void SetMediatorObserver(MAknDialogMediatorObserver* aObserver);
1647 * Tries to slide the dialog to the screen. If there is not enough memory for
1648 * sliding, the dialog appears as before.
1650 * Method is exported because of delayed notes.
1654 IMPORT_C void SlideDialog();
1658 * Sets dialog to be multilinequery.
1660 * This is called by multiline query only. Changes tab-key behaviour
1661 * of the dialog page. Tab key works differently for forms and
1662 * multiline queries.
1664 * @param aIsMultilineQuery Whether this dialog is multiline query
1666 IMPORT_C void SetMultilineQuery(TBool aIsMultilineQuery);