|
|
|||
Location:
QikNumberEditor.h
Link against: qikctl.lib
class CQikNumberEditor : public CQikNumericEditor, public MQikControlStreamInterface, public MQikCommandListOwner, public MQUiConfigChangedObserver, public MQikCommandHandler;
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.
MQikCommandHandler - Interface for classes responsible of executing commandsMQUiConfigChangedObserver - The Ui config observer notifies about Ui config changesMQikCommandListOwner - Interface for classes adding commandsMQikControlStreamInterface - MQikControlStreamInterface is used by controls to be able to handle cancel behaviour from e.gMQikTextRepresentationInterface - MQikTextRepresentationInterface should be implemented by controls that are normally shown in a container pop-out e.gMCoeControlObserver - Interface for a control to send events to its observer controlMObjectProvider - An interface that allows an object to be part of a network of object providersCBase - Base class for all classes to be instantiated on the heapCCoeControl - Control base class from which all other controls are derivedCQikNumericEditor - Numeric editor base classCQikNumberEditor - Integer editorDefined 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()
IMPORT_C CQikNumberEditor();
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.
IMPORT_C void ConstructL(TInt aMinimumValue, TInt aMaximumValue, TInt aInitialValue, TInt aNumberFlags=ENone);
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.
|
IMPORT_C TInt Value() const;
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.
|
GetActualValue()SetValueL()ChangeValueL()IncreaseValueL()DecreaseValueL()IMPORT_C TBool GetActualValue(TInt &aValue);
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.
|
|
Value()SetValueL()ChangeValueL()IncreaseValueL()DecreaseValueL()IMPORT_C void SetValueL(TInt aValue);
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.
|
Value()GetActualValue()ChangeValueL()IncreaseValueL()DecreaseValueL()IMPORT_C void GetMinimumAndMaximum(TInt &aMinimum, TInt &aMaximum) const;
Gets the editor's minimum and maximum values. Values outside these bounds cannot be entered into the editor.
|
IMPORT_C void SetMinimumAndMaximum(TInt aMinimum, TInt aMaximum);
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.
|
virtual IMPORT_C void ConstructFromResourceL(TResourceReader &aReader);
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.
|
virtual IMPORT_C void GetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList) const;
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.
|
virtual IMPORT_C void HandleResourceChange(TInt aType);
protected Handles a change to the control's resources of type aType which are shared across the environment, e.g. colours or fonts.
|
virtual IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType);
Handles key events.
|
|
protected: virtual IMPORT_C void IncreaseValueL();
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.
CQikNumericEditor::IncreaseValueL()Value()GetActualValue()ChangeValueL()SetValueL()ChangeValueL()DecreaseValueL()protected: virtual IMPORT_C void DecreaseValueL();
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.
CQikNumericEditor::DecreaseValueL()Value()GetActualValue()ChangeValueL()SetValueL()ChangeValueL()IncreaseValueL()protected: virtual IMPORT_C TBool ValidateKeyEvent(const TKeyEvent &aKeyEvent, TEventCode aType) const;
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.
|
|
protected: virtual IMPORT_C TBool ValidateTextL(const TDes &aText) const;
Validates a text to see if it contains any illegal characters.
|
|
protected: virtual IMPORT_C MQikCommandHandler *MapCommandHandler(CQikCommand &aCommand);
Called when a softkey or menupane item has been selected.
|
|
protected: virtual IMPORT_C void HandleCommandL(CQikCommand &aCommand);
Called when a softkey or menupane item has been selected
|
|
protected: virtual IMPORT_C void PrepareForFocusGainL();
Prepares the control by adding the control's softkey commands.
protected: virtual IMPORT_C void PrepareForFocusLossL();
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.
protected: virtual IMPORT_C TCoeInputCapabilities InputCapabilities() const;
Gets the editor's input capabilities.
This editor supports entry of numbers that are TCoeInputCapabilities::EWesternNumericIntegerNegative , or TCoeInputCapabilities::EWesternNumericIntegerPositive .
|
protected: virtual IMPORT_C TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
Gets an object whose type is encapsulated by the specified TTypeUid object.
|
|
protected: virtual IMPORT_C void WriteInternalStateL(RWriteStream &aWriteStream) const;
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.
|
protected: IMPORT_C void SetMinimumInfoMessage(TInt aResourceId);
Sets the information message to be displayed when the value entered in the number editor is less than the minimum specified number.
|
protected: IMPORT_C void SetMaximumInfoMessage(TInt aResourceId);
Sets the information message to be displayed when the value entered in the number editor is greater than the maximum specified number.
|
SetMinimumInfoMessage()SetGeneralInfoMessage()ApppendValueToMinMaxInfoMessage()protected: IMPORT_C void SetGeneralInfoMessage(TInt aResourceId);
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.
|
protected: IMPORT_C void AppendValueToMinMaxInfoMessage(TBool aAppendNumber);
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.
|
TFlags
The following flags may be combined with a bitwise OR to form the aNumberFlags argument to ConstructL (TInt, ...).
|