UIQ Technology
Symbian OS Library

UIQ 3.1 SDK        UIQ developer portal

[Index] [Spacer] [Previous] [Next]



Location: QikSimpleDialog.h
Link against: qikdlg.lib

Class CQikSimpleDialog

class CQikSimpleDialog : public CCoeControl, public MQikCommandHandler, public MCoeControlObserver;

Description

Simple one page dialog without scroll bar.

Use the CQikSimpleDialog dialog class for simple one page dialogs, this is without tabs. The dialog has no scroll bar so it is only intended to be used with small controls.

Use the QIK_DIALOG struct to specify a resource.

Derivation

Members

Defined in CQikSimpleDialog:
ActivateL(), AllowForcedExit(), CancelNonWaitingDialog(), CloseDialog(), ComponentControl(), ConstructFromResourceL(), ControlProvider(), CountComponentControls(), DynInitOrDeleteCommandL(), ExecuteLD(), ExecuteLD(), FocusChanged(), GetColorUseListL(), GetHelpContext(), HandleCommandL(), HandleControlArrayEventL(), HandleControlEventL(), HandlePointerBufferReadyL(), HandlePointerEventL(), HandleResourceChange(), HasBorder(), InputCapabilities(), IsClosing(), IsCommandListActive(), IsForcedExit(), IsLaunched(), IsOneShot(), IsWaiting(), LocateControlByUniqueHandle(), LocateControlByUniqueHandle(), LocateCtrlByUniqueHandle(), LocateCtrlByUniqueHandle(), MakeVisible(), MinimumSize(), MopSupplyObject(), OfferKeyEventL(), Page(), Page(), PersistsScreenModeChange(), PlaceHolder(), PositionChanged(), PostLayoutDynInitL(), PreLayoutDynInitL(), PrepareForFocusGainL(), PrepareForFocusLossL(), PrepareL(), PrepareLC(), QikSimpleDialog_Reserved_1(), QikSimpleDialog_Reserved_2(), QikSimpleDialog_Reserved_3(), RequestRelayout(), RunL(), RunL(), RunLD(), RunLD(), SetAdjacent(), SetCanForcedExit(), SetContainerWindowL(), SetDimmed(), SetForcedExitCommandId(), SetLayoutManagerL(), SetNeighbor(), SetParent(), SetTextBaselineSpacing(), SetTitleIconL(), SetTitleTextL(), SizeChanged(), TextBaselineOffset(), WriteInternalStateL(), ~CQikSimpleDialog()

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CCoeControl:
AccumulatedZoom(), ActivateGc(), BackedUpWindow(), Background(), CapturesPointer(), ClaimPointerGrab(), CloseWindow(), ComponentArrayExists(), Components(), ControlContext(), ControlEnv(), CopyControlContextFrom(), CreateBackedUpWindowL(), CreateWindowL(), DeactivateGc(), Draw(), DrawBackground(), DrawDeferred(), DrawForeground(), DrawNow(), DrawableWindow(), EAbsoluteZoom, ERelativeZoom, EnableDragEvents(), FindBackground(), FindFontProvider(), GetColor(), GetGc(), GetTextDrawer(), GrabbingComponent(), HandleComponentControlsResourceChange(), HandleRedrawEvent(), HitTest(), IgnoreEventsUntilNextPointerUp(), Index(), InitComponentArrayL(), IsActivated(), IsBackedUp(), IsBeingDestroyed(), IsBlank(), IsDimmed(), IsFocused(), IsNonFocusing(), IsReadyToDraw(), IsVisible(), LayoutManager(), MaximumWidth(), MopNext(), Observer(), OverrideColorL(), OwnsWindow(), Parent(), Position(), PositionRelativeToScreen(), Rect(), RecursivelyMergedInputCapabilities(), ReportEventL(), Reserved_2(), ResetGc(), ScreenFont(), SetAllowStrayPointers(), SetBackground(), SetBlank(), SetCanDrawOutsideRect(), SetComponentsToInheritVisibility(), SetControlContext(), SetCornerAndSize(), SetExtent(), SetExtentToWholeScreen(), SetFocus(), SetFocusing(), SetFontProviderL(), SetGc(), SetGloballyCapturing(), SetHitTest(), SetMaximumWidth(), SetMopParent(), SetNonFocusing(), SetObserver(), SetPointerCapture(), SetPosition(), SetRect(), SetSize(), SetSizeWithoutNotification(), SetUniqueHandle(), SetZoomFactorL(), Size(), SystemGc(), TZoomType, TextDrawer(), UniqueHandle(), Window(), ZoomWithType(), iCoeEnv, iContext, iPosition, iSize

Inherited from MCoeControlObserver:
EEventInteractionRefused, EEventPrepareFocusTransition, EEventRequestCancel, EEventRequestExit, EEventRequestFocus, EEventStateChanged, MCoeControlObserver_Reserved1(), MCoeControlObserver_Reserved2(), TCoeEvent

Inherited from MObjectProvider:
MObjectProvider_Reserved1(), MObjectProvider_Reserved2(), MopGetObject(), MopGetObjectNoChaining()

Inherited from MQikCommandHandler:
HandleAttemptDimmedSelectionL()

See also:


Construction and destruction


~CQikSimpleDialog()

IMPORT_C ~CQikSimpleDialog();

Description

Destructor

Panic codes

QIKDLG

0 if the dialog is still launched

[Top]


Member functions


PrepareL()

IMPORT_C void PrepareL(TInt aResourceId);

Description

Create window and load from resource

Parameters

TInt aResourceId

Panic codes

QIKDLG

1 if the resource structure is corrupt

QIKDLG

2 if the dialog has already been prepared


PrepareLC()

IMPORT_C void PrepareLC(TInt aResourceId);

Description

Pushes the dialog onto the cleanup stack, and calls PrepareL

Parameters

TInt aResourceId


RunL()

IMPORT_C TInt RunL();

Description

Run the dialog in a waiting mode, and return only when the dialog has closed

Return value

TInt

the Id of the command that closed the dialog

See also:


RunLD()

IMPORT_C TInt RunLD();

Description

Launch the dialog and return only when the dialog has closed The dialog will be automatically deleted when this function returns This is termed a waiting, one-shot dialog.

Return value

TInt

the Id of the command that closed the dialog

See also:


ExecuteLD()

IMPORT_C TInt ExecuteLD(TInt aResourceId);

Description

Prepare and launch the dialog and return when the dialog has closed. The dialog will be automatically closed when the dialog is closed. This is termed a waiting, one-shot dialog.

Parameters

TInt aResourceId

passed to PrepareLC

Return value

TInt

the return code of the dialog


RunL()

IMPORT_C void RunL(TRequestStatus &aNotifyWhenClosed);

Description

Launch the dialog and return immediately. The request status parameter will be informed when the dialog is closed. THis request status parameter should not be on the stack. The return code for the command closing the dialog will be returned in the request status.

Parameters

TRequestStatus &aNotifyWhenClosed

the request status to inform when the dialog has closed

Panic codes

QIKDLG

4 if aNotifyWhenClosed is NULL (as this would leave the dialog orphaned) This is termed a non-waiting dialog.


RunLD()

IMPORT_C void RunLD(TRequestStatus *aNotifyWhenClosed);

Description

Launch the dialog and return immediately. The request status parameter will be informed when the dialog is closed. The request parameter may be null if the the application does not want to know when the dialog is closed. The dialog will be deleted automatically when it is closed. This is termed a non-waiting, one-shot dialog.

Parameters

TRequestStatus *aNotifyWhenClosed

will be given the return code of the dialog when the dialog closes


ExecuteLD()

IMPORT_C void ExecuteLD(TInt aResourceId, TRequestStatus *aNotifyWhenClosed);

Description

Prepare and launch the dialog, returning immediately. The request status parameter will be informed when the dialog is closed. The request parameter may be null if the the application does not want to know when the dialog is closed. The dialog will be deleted automatically when it is closed. This is termed a non-waiting, one-shot dialog.

Parameters

TInt aResourceId

TRequestStatus *aNotifyWhenClosed

will be given the return code of the dialog when the dialog closes


CancelNonWaitingDialog()

IMPORT_C void CancelNonWaitingDialog(TInt aRetCode);

Description

Cancels a non-waiting dialog. The caller is an active object that is notified with a value in the TRequestStatus when the dialog has been closed. The parameter (aRetCode) is not used if the call originates from the active object's cancel method, which waits for event completion and does not handle the completion code.

Parameters

TInt aRetCode

The completion code value to return to the caller when the dialog has been closed. Not used if method called when active object cancelled.


SetCanForcedExit()

IMPORT_C TInt SetCanForcedExit(TBool aCan);

Description

Sets whether this dialog stays on-screen when screenmode changes If the dialog is currently launched, this command may fail (by returning an error code)

Parameters

TBool aCan

EFalse if the system shall not be able to force the dialog to close, otherwise ETrue

Return value

TInt

KErrNone if successful, else a standard system-wide error code


SetForcedExitCommandId()

IMPORT_C void SetForcedExitCommandId(TInt aCommandId);

Description

Sets the id of the command that will be executed when the dialog is forced to exit by the system. The id must point to a command that is added to the list of commands for this dialog. If a command with the specified id is not found the normal behaviour will apply, which is if any command of type EQikCommandTypeDone is found it will be executed, otherwise the first command of type cancel that is found will be executed.

Parameters

TInt aCommandId

The id of the command that shall be executed when the dialog is forced to exit by the system.


HandleCommandL()

virtual IMPORT_C void HandleCommandL(CQikCommand &aCommand);

Description

Called each time a command is executed in this dialog The default action is to close the dialog with the return code of the Id of the command. This default is effective for simple query dialogs and the such. Override this function to handle more complicated cases

Parameters

CQikCommand &aCommand


HandleControlEventL()

virtual IMPORT_C void HandleControlEventL(CCoeControl *aControl, TCoeEvent aEventType);

Description

Implementing MCoeControlObserver This default implementation allows controls to receive focus if they request it

Parameters

CCoeControl *aControl

TCoeEvent aEventType


OfferKeyEventL()

virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);

Description

Overloaded from CCoeControl .

Offers aKeyEvent to the control with the current focus. Implements basic focus navigation for following keys:

Leaves if OfferKeyEventL for the control that had focus leaved.

Parameters

const TKeyEvent &aKeyEvent

the key event

TEventCode aType

The type of key event: EEventKey, EEventKeyUp or EEventKeyDown

Return value

TKeyResponse


InputCapabilities()

virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

Description

Returns this CQikSimpleDialog's input capabilities.

Return value

TCoeInputCapabilities

the input capabilities of this CQikSimpleDialog.


RequestRelayout()

virtual IMPORT_C TBool RequestRelayout(const CCoeControl *aChildControl);

Description

Returns this CQikSimpleDialog's input capabilities.

Parameters

const CCoeControl *aChildControl

Return value

TBool

the input capabilities of this CQikSimpleDialog.


LocateControlByUniqueHandle()

T *LocateControlByUniqueHandle(TInt aUniqueHandle);

Description

Search for a specific control by its unique handle.

Parameters

TInt aUniqueHandle

The unique identifier for the control to be searched for.

Return value

T *

The control within the dialog which has this unique handle.


LocateControlByUniqueHandle()

const T *LocateControlByUniqueHandle(TInt aUniqueHandle) const;

Description

Search for a specific control by its unique handle.

Parameters

TInt aUniqueHandle

The unique identifier for the control to be searched for.

Return value

const T *

The control within the dialog which has this unique handle.


IsLaunched()

protected: IMPORT_C TBool IsLaunched() const;

Description

Is the dialog currently displayed to the user?

Return value

TBool


IsWaiting()

protected: IMPORT_C TBool IsWaiting() const;

Description

Is the dialog a waiting dialog? Waiting dialogs are dialogs that are launched and return the Id of the command that closes them, only returning when the dialog is closed. Non-waiting dialogs return immediately, and notify an active object when they are closed.

Return value

TBool


IsOneShot()

protected: IMPORT_C TBool IsOneShot() const;

Description

Will this dialog be deleted automatically when it is closed?

Return value

TBool


IsClosing()

protected: IMPORT_C TBool IsClosing() const;

Description

Is the dialog launched, but has been signalled to close?

Return value

TBool


IsForcedExit()

protected: IMPORT_C TBool IsForcedExit() const;

Description

Is the dialog currently being forced to exit by the system? This can be useful to query in the HandleCommandL

Return value

TBool


PersistsScreenModeChange()

protected: IMPORT_C TBool PersistsScreenModeChange() const;

Description

Return value

TBool


CloseDialog()

protected: IMPORT_C void CloseDialog(TInt aRetCode);

Description

Signals that the dialog should close Does nothing if the dialog is not launched If this is a waiting dialog, the value is returned to the calling function directly; if this is a non-waiting dialog, the an active object is notified with this value in the TRequestStatus; for this reason, avoid using a return-code of KRequestPending (-KMaxTInt) in such circumstances!

Parameters

TInt aRetCode

the value to return to the caller


ControlProvider()

protected: IMPORT_C CQikControlProvider *ControlProvider();

Description

Retrieves the control provider associated with this dialog

Return value

CQikControlProvider *


Page()

protected: IMPORT_C CQikContainerBase *Page();

Description

Used to get the dialog page (for adding and removing controls to/from the container for example).

Return value

CQikContainerBase *


Page()

protected: IMPORT_C const CQikContainerBase *Page() const;

Description

Used to get the dialog page (for adding and removing controls to/from the container for example).

Return value

const CQikContainerBase *


MopSupplyObject()

protected: virtual IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);

Description

Overriding CCoeControl If a subclass overrides this method, it is important that they call this method to resolve objects they otherwise cannot

Parameters

TTypeUid aId

Return value

TTypeUid::Ptr


PreLayoutDynInitL()

protected: virtual IMPORT_C void PreLayoutDynInitL();

Description

Called before the dialog is layed out This is useful to override for setting parameters of graphical components such as labels and images, so that their sizes can be properly computed when laying out


PostLayoutDynInitL()

protected: virtual IMPORT_C void PostLayoutDynInitL();

Description

Called when the dialog has been layed out


AllowForcedExit()

protected: virtual IMPORT_C TBool AllowForcedExit();

Description

Controls whether this dialog can be forced to close at this time.

Return value

TBool


PlaceHolder()

protected: IMPORT_C TInt PlaceHolder();

Description

Unused placeholder to maintain binary compatibility.

Return value

TInt


QikSimpleDialog_Reserved_1()

private: virtual IMPORT_C TInt QikSimpleDialog_Reserved_1();

Description

For future use; do not override this method

Return value

TInt


QikSimpleDialog_Reserved_2()

private: virtual IMPORT_C TInt QikSimpleDialog_Reserved_2();

Description

For future use; do not override this method

Return value

TInt


QikSimpleDialog_Reserved_3()

private: virtual IMPORT_C TInt QikSimpleDialog_Reserved_3();

Description

For future use; do not override this method

Return value

TInt


DynInitOrDeleteCommandL()

protected: virtual IMPORT_C CQikCommand *DynInitOrDeleteCommandL(CQikCommand *aCommand, const CCoeControl &aControlAddingCommands);

Description

Called once for each command is added to the dialog By default, it accepts all commands Useful to be overriden if custom command management needs to be done (e.g. changing the text of a particular command, or suppressing commands)

Parameters

CQikCommand *aCommand

const CCoeControl &aControlAddingCommands

Return value

CQikCommand *

See also:


IsCommandListActive()

IMPORT_C TBool IsCommandListActive(TInt aCommandListResourceId) const;

Description

Checks if a certain commandlist is in use or not.

Parameters

TInt aCommandListResourceId

The resource id for the commandlist.

Return value

TBool

ETrue if commandlist is in use, else EFalse


ConstructFromResourceL()

virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

Description

Constructs the dialog from a resource file.

Parameters

TResourceReader &aReader

The resource reader to use.

See also:


HandlePointerEventL()

virtual IMPORT_C void HandlePointerEventL(const TPointerEvent &aPointerEvent);

Description

Handles pointer events.

Parameters

const TPointerEvent &aPointerEvent

The pointer event.

See also:


SetParent()

virtual IMPORT_C TInt SetParent(CCoeControl *aParent);

Description

Sets aParent as the parent of this dialog.

Parameters

CCoeControl *aParent

The control to set as this dialog's parent.

Return value

TInt

KErrNone if successful, otherwise another of the system error codes.

See also:


MakeVisible()

virtual IMPORT_C void MakeVisible(TBool aVisible);

Description

Sets this dialog as visible or invisible.

Parameters

TBool aVisible

ETrue to make the dialog visible, EFalse to make it invisible.

See also:


SetDimmed()

virtual IMPORT_C void SetDimmed(TBool aDimmed);

Description

Sets the dialog to be dimmed.

Parameters

TBool aDimmed

ETrue to dim the dialog, EFalse to set the dialog as not dimmed.

See also:


PrepareForFocusLossL()

virtual IMPORT_C void PrepareForFocusLossL();

Description

Prepares the dialog for loss of focus.

This function is called immediately before focus is removed from a control.

See also:


PrepareForFocusGainL()

virtual IMPORT_C void PrepareForFocusGainL();

Description

Prepares the dialog for gaining focus.

This function is called immediately before a control is focused.

See also:


GetColorUseListL()

virtual IMPORT_C void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;

Description

Gets a list of logical colours employed in the drawing of the control paired with an explanation of how they are used.

Parameters

CArrayFix< TCoeColorUse > &aColorUseList

The colour list.

See also:


HandleResourceChange()

virtual IMPORT_C void HandleResourceChange(TInt aType);

Description

Handles a change to the dialog's resources.

Parameters

TInt aType

A message UID value.

See also:


MinimumSize()

virtual IMPORT_C TSize MinimumSize();

Description

Gets the dialog's minimum required size.

Return value

TSize

The minimum size required by the control.

See also:


CountComponentControls()

virtual IMPORT_C TInt CountComponentControls() const;

Description

Gets the number of controls contained in a compound control.

Return value

TInt

The number of component controls contained by this dialog.

See also:


ComponentControl()

virtual IMPORT_C CCoeControl *ComponentControl(TInt aIndex) const;

Description

Gets an indexed component of a compound control.

Parameters

TInt aIndex

The index of the control.

Return value

CCoeControl *

The component control with an index of aIndex.

See also:


SetContainerWindowL()

virtual IMPORT_C void SetContainerWindowL(const CCoeControl &aContainer);

Description

Sets the dialog's containing window by copying it from aContainer.

Parameters

const CCoeControl &aContainer

The compound control that is the container for this dialog

See also:


ActivateL()

virtual IMPORT_C void ActivateL();

Description

Sets the dialog as ready to be drawn.

See also:


SetAdjacent()

virtual IMPORT_C void SetAdjacent(TInt aAdjacent);

Description

Sets the dialog's appearance when it is next to other controls.

Parameters

TInt aAdjacent

Typically a value defined in TGulAdjacent.

See also:


SetNeighbor()

virtual IMPORT_C void SetNeighbor(CCoeControl *aNeighbor);

Description

Sets an associated control.

Parameters

CCoeControl *aNeighbor

A control to be used by this function.

See also:


HasBorder()

virtual IMPORT_C TBool HasBorder() const;

Description

Tests if the dialog has a border.

Return value

TBool

ETrue if the dialog has a border, EFalse if the dialog does not have a border. The default implementation of this function returns EFalse.

See also:


GetHelpContext()

virtual IMPORT_C void GetHelpContext(TCoeHelpContext &aContext) const;

Description

Gets the dialog's help context.

Parameters

TCoeHelpContext &aContext

The dialog's help context

See also:


SetLayoutManagerL()

virtual IMPORT_C void SetLayoutManagerL(MCoeLayoutManager *aLayout);

Description

Sets the layout manager.

Parameters

MCoeLayoutManager *aLayout

The new layout manager, NULL if you just want to remove the current layout manager.

See also:


TextBaselineOffset()

virtual IMPORT_C TInt TextBaselineOffset(const TSize &aSize) const;

Description

Gets the offset to the first text baseline relative to the top of the control.

Parameters

const TSize &aSize

The offset of the baseline may depend on the size of the control. This argument specifies the size to use when computing the baseline offset.

Return value

TInt

The offset of the baseline from the top of the control.

See also:


SetTextBaselineSpacing()

virtual IMPORT_C void SetTextBaselineSpacing(TInt aSpacing);

Description

Sets the spacing between text baselines.

Parameters

TInt aSpacing

The baseline spacing i.e. the space in pixels between the text baselines.

See also:


SetTitleTextL()

IMPORT_C void SetTitleTextL(const TDesC &aText);

Description

Sets the dialog title text from a descriptor.

Parameters

const TDesC &aText

The descriptor containing the new title text.


SetTitleIconL()

IMPORT_C void SetTitleIconL(const CQikContent *aContent, TQikPassingOwnership aOwnership);

Description

Sets the dialog title icon.

Parameters

const CQikContent *aContent

The icon to use for the dialog title. Pass NULL to clear the icon.

TQikPassingOwnership aOwnership

Indicates if the ownership is transferred.


FocusChanged()

protected: virtual IMPORT_C void FocusChanged(TDrawNow aDrawNow);

Description

Responds to a change in focus.

Parameters

TDrawNow aDrawNow

Contains the value that was passed to it by SetFocus().

See also:


WriteInternalStateL()

protected: virtual IMPORT_C void WriteInternalStateL(RWriteStream &aWriteStream) const;

Description

Writes the internal state of the control and its components to aStream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

Parameters

RWriteStream &aWriteStream


SizeChanged()

protected: virtual IMPORT_C void SizeChanged();

Description

Responds to changes to the size and position of the contents of this dialog.

See also:


HandlePointerBufferReadyL()

protected: virtual IMPORT_C void HandlePointerBufferReadyL();

Description

Handles pointer buffer ready events.

See also:


PositionChanged()

protected: virtual IMPORT_C void PositionChanged();

Description

Responds to changes in the position of this dialog.

See also:


HandleControlArrayEventL()

protected: virtual IMPORT_C void HandleControlArrayEventL(CCoeControlArray::TEvent aEvent, const CCoeControlArray *aArray, CCoeControl *aControl, TInt aControlId);

Description

Handles events generated by the CCoeControlArray.

Parameters

CCoeControlArray::TEvent aEvent

The type of the event

const CCoeControlArray *aArray

The array that generated the event

CCoeControl *aControl

The control affected by the event

TInt aControlId

The id of the control affected by the event

See also:


LocateCtrlByUniqueHandle()

private: IMPORT_C CCoeControl *LocateCtrlByUniqueHandle(TInt aUniqueHandle);

Description

Used to locate a control within the simple dialog using a unique handle.

Parameters

TInt aUniqueHandle

the unique handle to look for.

Return value

CCoeControl *

the control with the unique handle specified in aUniqueHandle