UIQ Technology
 Developer Library

UIQ 3 SDK

UIQ developer portal

FEEDBACK 

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



Location: QikNumberEditor.h
Link against: qikctl.lib

Class CQikNumberEditor

class CQikNumberEditor : public CQikNumericEditor, public MQikControlStreamInterface, public MQikCommandListOwner, public MQUiConfigChangedObserver, public MQikCommandHandler;

Description

Integer editor.

This control supports editing a single integer value. The maximum and minimum numbers which can be entered into the editor may be set. Values outside these bounds are invalid, and a warning is given when an attempt is made to remove focus.

This class is not intended for user derivation. The associated resource is QIK_NUMBER_EDITOR.

Derivation

  • MObjectProvider - An interface that allows an object to be part of a network of object providers
  • CBase - Base class for all classes to be instantiated on the heap
  • Members

    Defined in CQikNumberEditor:
    AppendValueToMinMaxInfoMessage(), CQikNumberEditor(), ConstructFromResourceL(), ConstructL(), DecreaseValueL(), EDisplayLeadingZeros, ENoSpinnerArrows, ENone, EUseSpinnerArrows, GetActualValue(), GetColorUseListL(), GetMinimumAndMaximum(), HandleCommandL(), HandleResourceChange(), IncreaseValueL(), InputCapabilities(), MapCommandHandler(), MopSupplyObject(), OfferKeyEventL(), PrepareForFocusGainL(), PrepareForFocusLossL(), SetGeneralInfoMessage(), SetMaximumInfoMessage(), SetMinimumAndMaximum(), SetMinimumInfoMessage(), SetTemporaryValueL(), SetValueL(), TFlags, ValidateKeyEvent(), ValidateTextL(), Value(), WriteInternalStateL(), ~CQikNumberEditor()

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

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

    Inherited from CQikNumericEditor:
    BaseConstructL(), CommandDeleteL(), ComponentControl(), CountComponentControls(), Draw(), Edwin(), FocusChanged(), GetTextL(), HandleControlEventL(), HandlePointerEventL(), MinimumSize(), PositionChanged(), SetControlValueObserver(), SetDimmed(), SetSpinnerArrows(), SetTextL(), SizeChanged(), TextRepresentationL(), iControlValueObserver

    Inherited from MCoeControlObserver:
    EEventInteractionRefused, EEventPrepareFocusTransition, EEventRequestCancel, EEventRequestExit, EEventRequestFocus, EEventStateChanged, TCoeEvent

    Inherited from MObjectProvider:
    MopGetObject(), MopGetObjectNoChaining()

    Inherited from MQUiConfigChangedObserver:
    HandleUiConfigChangedL()

    Inherited from MQikCommandHandler:
    HandleAttemptDimmedSelectionL()

    Inherited from MQikControlStreamInterface:
    RestoreUserDataL(), StoreUserDataL()


    Construction and destruction


    CQikNumberEditor()

    IMPORT_C CQikNumberEditor();

    Description

    Default constructor.

    This function constructs an uninitialised CQikNumberEditor . It should be used as the first stage in two stage construction, followed by a call to either ConstructFromResourceL() to initialise the editor's field values from a resource file, or ConstructL() if no resource file is used.

    See also:


    ~CQikNumberEditor()

    IMPORT_C ~CQikNumberEditor();

    Description

    Default destructor.


    ConstructL()

    IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue, TInt aNumberFlags=ENone);

    Description

    Second phase construction. Completes the construction of the CQikNumberEditor object. This function should be used instead of ConstructFromResourceL() when not initialising from a resource file.

    The function sets the minimum and maximum values that the user is able to enter into the editor, and the initial value. If the aMinimumValue is greater than aMaximumValue the values are swapped.

    Parameters

    TInt aMinimumValue

    The minimum allowed editor value.

    TInt aMaximumValue

    The maximum allowed editor value.

    TInt aInitialValue

    The initial editor value.

    TInt aNumberFlags

    The flags to be set for using preceding zeros or spinner arrows.

    See also:

    [Top]


    Member functions


    Value()

    IMPORT_C TInt Value() const;

    Description

    Returns the control's current value if is inside the specified limits. If the current value is smaller than the minimum specified value or only a minus sign has been entered or if the input section is empty, the returned value will be the minimum specified value. If the value is greater than the specified maximum value the returned value will be the maximum specified value.

    Return value

    TInt

    The editor's current value if the value is inside the specified limits. The returned value is always between iMinimumValue and iMaximumValue

    See also:


    GetActualValue()

    IMPORT_C TBool GetActualValue(TInt &aValue);

    Description

    Gets the control's current value if there is a number in the number editor and returns true. If there is no number in the editor then aValue will not be set and the method returns false.

    Parameters

    TInt &aValue

    The current value set in the number editor.

    Return value

    TBool

    True if there is a number in the input field, otherwise false.

    See also:


    SetValueL()

    IMPORT_C void SetValueL(TInt aValue);

    Description

    Sets the control's actual value in a cyclic way between iMinimumValue and iMaximumValue . If aValue exceed the the control's maximum value the actual value will be set to the minimum value. If aValue is smaller than the control's minimum value the actual value will be set to the maximum value. When the NumberEditor is focused this method will also set the highlighting. CoeControl will be informed of the change for a redraw of the displayed value.

    Parameters

    TInt aValue

    The new value for this control.

    See also:


    GetMinimumAndMaximum()

    IMPORT_C void GetMinimumAndMaximum(TInt &aMinimum, TInt &aMaximum) const;

    Description

    Gets the editor's minimum and maximum values. Values outside these bounds cannot be entered into the editor.

    Parameters

    TInt &aMinimum

    On return, contains the editor's minimum allowed value.

    TInt &aMaximum

    On return, contains the editor's maximum allowed value.

    See also:


    SetMinimumAndMaximum()

    IMPORT_C void SetMinimumAndMaximum(TInt aMinimum, TInt aMaximum);

    Description

    Sets the editor's minimum and maximum values. Values outside these bounds cannot be entered into the editor. This method resizes the control if necessary to have enough space for the new max and min values.

    Parameters

    TInt aMinimum

    The editor's maximum allowed value.

    TInt aMaximum

    See also:


    SetTemporaryValueL()

    IMPORT_C void SetTemporaryValueL(TInt aValue);

    Description

    Parameters

    TInt aValue


    ConstructFromResourceL()

    virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);

    Description

    Second phase construction from a resource.

    Completes the construction of the CQikNumberEditor object reading all parameters from a QIK_NUMBER_EDITOR resource. The minimum and maximum values that can be displayed in the editor are read from the resource, and ConstructL() is called with these settings. The initial value of the editor is set to zero.

    Parameters

    TResourceReader &aReader

    See also:


    GetColorUseListL()

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

    Description

    Gets the list of logical colours employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.

    Parameters

    CArrayFix< TCoeColorUse > &aColorUseList


    HandleResourceChange()

    virtual IMPORT_C void HandleResourceChange(TInt aType);

    Description

    protected Handles a change to the control's resources of type aType which are shared across the environment, e.g. colours or fonts.

    Parameters

    TInt aType


    OfferKeyEventL()

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

    Description

    Handles key events.

    Parameters

    const TKeyEvent &aKeyEvent

    The key event occurred.

    TEventCode aType

    The type of event that occurred.

    Return value

    TKeyResponse

    A TKeyResponse indicates whether or not the key event was used by this control.


    IncreaseValueL()

    protected: virtual IMPORT_C void IncreaseValueL();

    Description

    Increases the editor's value by one, which is equivalent to ChangeValueL(1) . The control's new actual value will be the actual value + 1. If the new actual value exceed the control's maximum value the actual value will be set to the minimum value (wrapping). CoeControl will be informed of the change for a redraw of the displayed value.

    See also:


    DecreaseValueL()

    protected: virtual IMPORT_C void DecreaseValueL();

    Description

    Decreases the editor's value by one, which is equivalent to ChangeValueL (-1). The control's new actual value will be the actual value -1. If the new actual value becomes smaller than the control's minimum value the actual value will be set to the maximum value. CoeControl will be informed of the change for a redraw of the displayed value.

    See also:


    ValidateKeyEvent()

    protected: virtual IMPORT_C TBool ValidateKeyEvent(const TKeyEvent &aKeyEvent, TEventCode aType) const;

    Description

    Validates the entered key. This function is called by OfferKeyEventL() , and returns ETrue if the key is appropriate for this editor. The key is valid if it is a digit or an arrow key.

    Parameters

    const TKeyEvent &aKeyEvent

    The key event.

    TEventCode aType

    The type of key event: EEventKey , EEventKeyUp or EEventKeyDown .

    Return value

    TBool

    True if the key is acceptable by this control (any digit, right, left, up and down hardware keys and arrows. - and delete and backspace), false in any other case

    See also:


    ValidateTextL()

    protected: virtual IMPORT_C TBool ValidateTextL(const TDes &aText) const;

    Description

    Validates a text to see if it contains any illegal characters.

    Parameters

    const TDes &aText

    The text to display.

    Return value

    TBool

    ETrue if no illegal characters were found else EFalse .


    MapCommandHandler()

    protected: virtual IMPORT_C MQikCommandHandler *MapCommandHandler(CQikCommand &aCommand);

    Description

    Called when a softkey or menupane item has been selected.

    Parameters

    CQikCommand &aCommand

    Command that should be executed. (Not used in this method).

    Return value

    MQikCommandHandler *


    HandleCommandL()

    protected: virtual IMPORT_C void HandleCommandL(CQikCommand &aCommand);

    Description

    Called when a softkey or menupane item has been selected

    Parameters

    CQikCommand &aCommand

    Command that should be executed.

    Panic codes

    EQikPanicUnknownCommandId

    DEBUG_BUILDS: The supplied command id is unknown. RELEASE_BUILDS: does nothing.


    PrepareForFocusGainL()

    protected: virtual IMPORT_C void PrepareForFocusGainL();

    Description

    Prepares the control by adding the control's softkey commands.


    PrepareForFocusLossL()

    protected: virtual IMPORT_C void PrepareForFocusLossL();

    Description

    Prepare the control to lose the focus and check if there is a valid number in the input field. If there is no valid number in the input field, i.e. the number is outside the specified limits or there is no number entered, then this method will display an information message and leave. If the method doesn't leave the method removes the number editor commands. Before the method leaves the input field is reset to the last entered valid number.


    InputCapabilities()

    protected: virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;

    Description

    Gets the editor's input capabilities.

    This editor supports entry of numbers that are TCoeInputCapabilities::EWesternNumericIntegerNegative , or TCoeInputCapabilities::EWesternNumericIntegerPositive .

    Return value

    TCoeInputCapabilities

    The editor's input capabilities.

    See also:


    MopSupplyObject()

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

    Description

    Gets an object whose type is encapsulated by the specified TTypeUid object.

    Parameters

    TTypeUid aId

    Encapsulates the Uid that identifies the type of object required.

    Return value

    TTypeUid::Ptr

    Encapsulates the pointer to the object provided. Note that the encapsulated pointer may be NULL.


    WriteInternalStateL()

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

    Description

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

    Parameters

    RWriteStream &aWriteStream


    SetMinimumInfoMessage()

    protected: IMPORT_C void SetMinimumInfoMessage(TInt aResourceId);

    Description

    Sets the information message to be displayed when the value entered in the number editor is less than the minimum specified number.

    Parameters

    TInt aResourceId

    The numeric ID of the resource to be read.

    See also:


    SetMaximumInfoMessage()

    protected: IMPORT_C void SetMaximumInfoMessage(TInt aResourceId);

    Description

    Sets the information message to be displayed when the value entered in the number editor is greater than the maximum specified number.

    Parameters

    TInt aResourceId

    The numeric ID of the resource to be read.

    See also:


    SetGeneralInfoMessage()

    protected: IMPORT_C void SetGeneralInfoMessage(TInt aResourceId);

    Description

    Sets the information message to be displayed when an invalid input is entered in the number editor or when trying to save and close an empty number editor. An invalid value is e.g. a minus sign entered to the right of a number or in succession or if the minus sign is entered when the minimum value is greater than or equal to zero.

    Parameters

    TInt aResourceId

    The numeric ID of the resource to be read.

    See also:


    AppendValueToMinMaxInfoMessage()

    protected: IMPORT_C void AppendValueToMinMaxInfoMessage(TBool aAppendNumber);

    Description

    Tells if the maximum or minimum number should be appended to the information message. E.g. the maximum or minimum allowed values that may be entered in the number editor.

    Parameters

    TBool aAppendNumber

    See also:

    [Top]


    Member enumerations


    Enum TFlags

    TFlags

    Description

    The following flags may be combined with a bitwise OR to form the aNumberFlags argument to ConstructL (TInt, ...).

    ENone

    EDisplayLeadingZeros

    EUseSpinnerArrows

    ENoSpinnerArrows

    Terms and conditions of use of the material