class CEikMfne : public CEikBorderedControl |
Multi-field numeric editor abstract base class.
This is a set of fields, where a field can be a number, a symbol or a separator. Field classes are derived from CEikMfneField .
Concrete multi-field numeric editors are derived from this class and should provide the following:
* A virtual destructor if the class introduces new data members which are allocated on the heap.
* A ConstructL() function; this is used to initialise a multi-field numeric editor.
* A ConstructFromResourceL() function; this is used to initialise a multi-field numeric editor from a resource.
* A data member to store the editor's value.
* Functions to set and get the editor's value.
* Functions to set the minimum and maximum allowable values.
Protected Member Functions | |
---|---|
IMPORT_C void | FieldIsAboutToBeDeHighlighted ( CEikMfneField *, TBool &) |
IMPORT_C void | FocusChanged ( TDrawNow ) |
IMPORT_C void | HandleInteraction ( TBool , TInt , TInt , CEikMfneField::THighlightType , TBool &, TBool &) |
IMPORT_C TSize | MfneSize () |
IMPORT_C TSize | MfneSize ( TBool ) |
IMPORT_C void | SizeChanged () |
IMPORT_C void | WriteInternalStateL ( RWriteStream &) |
Private Member Functions | |
---|---|
IMPORT_C void | CEikMfne_Reserved () |
TBool | ConsumesUpAndDownKeys () |
void | CreateExtensionIfRequiredL () |
IMPORT_C void | CreatePopoutIfRequiredL () |
IMPORT_C void | Draw (const TRect &) |
void | DrawCursor () |
void | DrawRange ( CWindowGc &, TInt , TInt , TBool ) |
void | EvaluateSkinningBackground () |
IMPORT_C void * | ExtensionInterface ( TUid ) |
void | HideCursor () |
void | LaunchPenInputL () |
CWindowGc & | PreparedGc () |
IMPORT_C void | Reserved_2 () |
void | SetGcToDimmedVideo ( CWindowGc &) |
void | SetGcToInverseVideo ( CWindowGc &) |
void | SetGcToNormalVideo ( CWindowGc &) |
MAknsControlContext * | SkinBackgroundControlContext () |
TBool | SkinningBackground () |
Public Member Enumerations | |
---|---|
enum | TFeatureId { EClipGcToRect , EDisablePenInput , EFingerSupport , ELaunchPenInputAutomatic , EPartialScreenInput } |
enum | TFingerSupportParams { EDisaleFingerSupport , EnableFingerSupport , EnableWithAllHighlight } |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType |
Private Attributes | |
---|---|
TInt | iAlignment |
TInt | iCurrentField |
CEikMfneExtension * | iExtension |
CEikMfneField ** | iFields |
TBitFlags | iFlags |
const CFont * | iFont |
TInt | iNumFields |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize | |
CEikBorderedControl::iBorder |
IMPORT_C | ~CEikMfne | ( | ) | [virtual] |
Destructor.
This function is virtual which ensures that if delete is explicitly called on a CEikMfne pointer which points to a derived class instance, the derived class destructor is called.
IMPORT_C void | AddField | ( | CEikMfneField * | aField | ) |
Adds a field.
The field is added as the first empty element in the field array or, if there is no current field, aField becomes the current field.
This should be called by the container only if a derived control is not constructed from a resource.
Ownership of aField is transferred to this multi-field numeric editor.
CEikMfneField * aField | A field. |
TBool | ConsumesUpAndDownKeys | ( | ) | const [private] |
Access to state of whether up/down keys are eaten and used to increment/decrement. If these keys are not consumed, then the events are passed on.
IMPORT_C TTimeIntervalSeconds | Convert | ( | const TTime & | aTime | ) | [static] |
Converts a time duration to seconds.
const TTime & aTime | The date and time to be converted. |
IMPORT_C TTime | Convert | ( | const TTimeIntervalSeconds & | aTimeIntervalSeconds | ) | [static] |
Converts a time duration in seconds to hours, minutes and seconds.
const TTimeIntervalSeconds & aTimeIntervalSeconds | The number of seconds to be converted. |
void | CreateExtensionIfRequiredL | ( | ) | [private] |
Check for the existence of the extension and create if required.
IMPORT_C void | CreateFieldArrayL | ( | TInt | aNumFields | ) |
Allocates a field array containing aNumFields elements.
This should be called by the container only if a derived control is not constructed from a resource.
TInt aNumFields | The number of fields. |
TInt | CurrentField | ( | ) | const [inline] |
Gets the index into the field array of the current field.
IMPORT_C void | Draw | ( | const TRect & | aRect | ) | const [private, virtual] |
From CCoeControl . Draws the border around the control. This function also clears the central area if the IsBlank() method returns ETrue .
From CCoeControl
const TRect & aRect | Not used. |
IMPORT_C void | DrawNowAndLeaveWithTimeDateFormatInfoMsgL | ( | TInt | aResourceId, |
const TTime & | aTimeDate | |||
) | const |
Draws immediately, and then leaves with an info message containing a formatted time/date string.
The time/date is passed to the function, as is the resource which contains the format string which defines how it is to be formatted.
void | DrawRange | ( | CWindowGc & | aGc, |
TInt | aFirstField, | |||
TInt | aLastField, | |||
TBool | aSkipBackgroundDrawer = EFalse | |||
) | const [private] |
Draws the specified fields within the MFNE. All fields between and including the aFirstField and aLastField will be drawn.
void | EvaluateSkinningBackground | ( | ) | [private] |
Checks if app is skin enabled and that the current control context has bitmap. If so, then state is set true. This should be called at constuction and when HandleResourceChange is called
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl
TUid aInterface |
IMPORT_C CEikMfneField * | Field | ( | TInt | aField | ) | const |
Gets the CEikMfneField at the specified index.
TInt aField | The field index. |
IMPORT_C void | FieldIsAboutToBeDeHighlighted | ( | CEikMfneField * | aField, |
TBool & | aDrawAllFields | |||
) | [protected, virtual] |
Empty virtual function.
Called by HandleInteraction() when switching from the current field. Can be implemented by derived classes to maintain consistency between fields, e.g. in a range editor.
CEikMfneField * aField | The current field. |
TBool & aDrawAllFields | On return, whether all fields have changed and need to be redrawn. |
IMPORT_C void | FocusChanged | ( | TDrawNow | aDrawNow | ) | [protected, virtual] |
Redraws the current field, so removing or displaying the cursor.
If the editor has lost focus, the current field is reset to the first editable field.
TDrawNow aDrawNow | Whether to draw the control immediately. |
IMPORT_C const CFont * | Font | ( | ) | const |
Gets a pointer to the CFont object that is used to draw the fields in this editor.
IMPORT_C void | GetColorUseListL | ( | CArrayFix < TCoeColorUse > & | aColorUseList | ) | const [virtual] |
Gets the list of logical colours used to draw the control.
The colours are appended to aColorUseList.
Overrides CCoeControl::GetColorUseListL() .
Gets the list of logical colors employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.
CArrayFix < TCoeColorUse > & aColorUseList | On return, the colour list. |
void | GetCursorInfo | ( | TPoint & | aPos, |
TInt & | aHeight, | |||
TInt & | aWidth, | |||
TInt & | aAscent | |||
) |
IMPORT_C TInt | GetFeature | ( | TInt | aFeatureId, |
TInt & | aFeatureParam | |||
) | const |
Used to getting feature statuses.
IMPORT_C void | HandleInteraction | ( | TBool | aHandleDeHighlight, |
TInt | aNewCurrentField, | |||
TInt | aOldWidthInPixelsOfOldCurrentField, | |||
CEikMfneField::THighlightType | aOldHighlightTypeOfOldCurrentField, | |||
TBool & | aDataAltered, | |||
TBool & | aError | |||
) | [protected] |
Handles the redrawing associated with a change to the current field.
Called by OfferKeyEventL() , HandlePointerEventL() and PrepareForFocusLossL() .
TBool aHandleDeHighlight | ETrue if the current field has changed so requires de-highlighting. |
TInt aNewCurrentField | The index of the field to which the user has moved. |
TInt aOldWidthInPixelsOfOldCurrentField | The width in pixels of the previous current field. |
CEikMfneField::THighlightType aOldHighlightTypeOfOldCurrentField | The highlight type of the previously current field. |
TBool & aDataAltered | ETrue if the data has been changed. |
TBool & aError | On return, ETrue if successful, EFalse if not successful. |
IMPORT_C void | HandleMfneCommandL | ( | TInt | aCommand | ) |
From MAknMfneCommandObserver . Allows owning controls to give commands to MFNE editors. This is interface was added to enable modifying the current field value with touch buttons.
TInt aCommand | Command ID defined in MAknMfneCommandObserver::TMfneCommand |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C void | HandleResourceChange | ( | TInt | aType | ) | [virtual] |
Handles a change to the control's resources.
The types of resources handled are those which are shared across the environment, e.g. colours or fonts.
Overrides CCoeControl::HandleResourceChange() .
Handles a change to the control's resources of type aType which are shared across the environment, e.g. colors or fonts.
TInt aType | A message UID value. |
IMPORT_C TCoeInputCapabilities | InputCapabilities | ( | ) | const [virtual] |
Gets the total of the input capabilities of all the editor's fields.
Overrides CCoeControl::InputCapabilities() .
If this function is overrided in a subclass, the subclass should obtain this class' InputCapabilities' object provider through TCoeInputCapabilities::ObjectProvider() and set that as a part of the subclass' InputCapabilities object provider chain to ensure maximum functionality.
void | InvalidFieldAlert | ( | ) | [static] |
void | LeaveWithAlert | ( | TInt | aResourceId | ) | [static] |
TInt aResourceId |
IMPORT_C TSize | MfneSize | ( | ) | const [protected] |
Gets the size of the multi-field numeric editor.
The width is the sum of the maximum widths of every field.
IMPORT_C TSize | MfneSize | ( | TBool | aShrinkToMinimumSize | ) | [protected] |
Gets the size of the multi-field numeric editor.
The width is the sum of the maximum widths of every field.
TBool aShrinkToMinimumSize | ETrue to shrink the width to the minimum required for each field. |
IMPORT_C TTypeUid::Ptr | MopSupplyObject | ( | TTypeUid | aId | ) | [virtual] |
Retrieves an object of the same type as that encapsulated in aId.
Overrides CCoeControl::MopSupplyObject() .
TTypeUid aId | An encapsulated object type ID. |
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Handles key events.
Overrides CCoeControl::OfferKeyEventL() . The key event is passed onto the current field to handle.
const TKeyEvent & aKeyEvent | The key event. |
TEventCode aType | The type of key event. |
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
Prepares for focus loss.
Overrides CCoeControl::PrepareForFocusLossL() .
This function should be called when an attempt is made to remove focus from a multi-field numeric editor. It redraws the control, removing highlighting from the current field.
It may be overridden in derived classes to test the validity of information entered into the editor. Derived class versions should include a base function call.
IMPORT_C TTime | ReadDate | ( | TResourceReader & | aResourceReader | ) | [static] |
A utility function which reads days, months and years from a resource and returns the corresponding TTime value.
TResourceReader & aResourceReader | A resource reader. |
IMPORT_C TTimeIntervalSeconds | ReadDuration | ( | TResourceReader & | aResourceReader | ) | [static] |
Reads a duration value from a resource.
TResourceReader & aResourceReader | A resource reader. |
IMPORT_C TTime | ReadTime | ( | TResourceReader & | aResourceReader | ) | [static] |
A utility function which reads seconds, minutes and hours from a resource and returns the corresponding TTime value.
TResourceReader & aResourceReader | A resource reader. |
IMPORT_C TTime | ReadTimeAndDate | ( | TResourceReader & | aResourceReader | ) | [static] |
A utility function which reads seconds, minutes, hours, days, months and years from a resource and returns the corresponding TTime value.
TResourceReader & aResourceReader | A resource reader. |
IMPORT_C TTimeIntervalSeconds | ReadTimeOffset | ( | TResourceReader & | aResourceReader | ) | [static] |
Reads a time offset from a resource.
This is identical to ReadDuration() , except that negative offsets are allowed.
TResourceReader & aResourceReader | A resource reader. |
IMPORT_C void | ResetFieldArray | ( | ) |
Deletes the editor's field and the field array.
After a call to this, CreateFieldArrayL() can be called again.
IMPORT_C TInt | SetFeature | ( | TInt | aFeatureId, |
TInt | aFeatureParam | |||
) |
Used for setting various flag-like features to the editor.
IMPORT_C void | SetFont | ( | const CFont * | aFont | ) |
Sets the font that is used to draw the fields in this editor.
const CFont * aFont | A pointer to a CFont object that is used to draw the fields in this editor. |
void | SetGcToDimmedVideo | ( | CWindowGc & | aGc | ) | const [private] |
CWindowGc & aGc |
void | SetGcToInverseVideo | ( | CWindowGc & | aGc | ) | const [private] |
CWindowGc & aGc |
void | SetGcToNormalVideo | ( | CWindowGc & | aGc | ) | const [private] |
CWindowGc & aGc |
IMPORT_C void | SetMfneAlignment | ( | TInt | aAlignment | ) |
Sets the alignment of the editor. The editor alignments, defined in avkon.hrh, are EAknEditorAlignNone, EAknEditorAlignCenter, EAknEditorAlignLeft, EAknEditorAlignRight or EAknEditorAlignBidi.
TInt aAlignment | The editor's alignment |
IMPORT_C void | SetSkinBackgroundControlContextL | ( | MAknsControlContext * | aControlContext | ) |
Sets within in the editor an externally owned Skins background control context. This background control context will then be used by the editor to draw background.
If this API is not called, then the editor IS skin enabled, (that is CEikMfnes are skin enabled by default) but it will try to find a control context with which to perform background drawing from the Control Environment, via the Object Provider.
Setting this control context to NULL will have the effect of turning off background skinning.
MAknsControlContext * aControlContext |
IMPORT_C void | SetSkinTextColorL | ( | TInt | aAknSkinIDForTextColor, |
TInt | aAknSkinIDForBgColor = KErrNotFound | |||
) |
Sets the colors for text and background as skin IDs. Please note that bgcolor overrides skinned draw if set
TInt aAknSkinIDForTextColor | ID for text color. |
TInt aAknSkinIDForBgColor = KErrNotFound | ID for background color. |
IMPORT_C void | SetSuppressBackgroundDrawing | ( | TBool | aSuppress | ) |
Used for suppressing all editor's background drawing. This is intended for internal use.
Note that when this is set, the background is not drawn with skin nor cleared, so the background MUST be drawn by the parent control every time the editor changes.
TBool aSuppress | If ETrue, suppress background drawing |
IMPORT_C void | SetUpAndDownKeysConsumed | ( | TBool | aConsume | ) |
Sets whether the editor consumes up and down key events. If this is set to EFalse, the editor returns EKeyWasNotConsumed upon receiving EKeyDownArrow or EKeyUpArrow key event and doesn't send the key event to the current field.
TBool aConsume | If EFalse, OfferKeyEventL() returns EKeyWasNotConsumed when up and down key events are received. |
IMPORT_C void | SetUseOverrideColors | ( | TBool | aUseOverrideColors | ) |
Sets the MFNE to use the CCoeControl::OverrideColorL() defined color in drawing. If this is set, no skinning will be used in drawing.
TBool aUseOverrideColors | ETrue to make the MFNE use overridden colors. |
void | SetValidateCallBack | ( | TCallBack | aCallBack | ) |
TCallBack aCallBack |
MAknsControlContext * | SkinBackgroundControlContext | ( | ) | const [private] |
Access to Skins background control context that is potentially being used by the Editor.
This API will first check to see if an control context has been set by API, and if so, return that. If the background control context has been set to NULL by API, then it will return NULL. If the background control context has never been set by API, then this returns the control context (if one exists) that the object obtains from Object Provider.
TBool | SkinningBackground | ( | ) | const [private] |
application is skin enabled
current skin has a background or frame bitmap It is set during construction and does not change its value after except if the Skin is changed, whereupon the control context is re-accessed and checked for bitmaps present
IMPORT_C TBool | SupportsFeature | ( | TInt | aFeatureId | ) | const |
Used for checking if the editor supports a feature. For features, see TFeatureId.
TInt aFeatureId |
IMPORT_C void | WriteInternalStateL | ( | RWriteStream & | aWriteStream | ) | const [protected, virtual] |
Writes the internal state of the control and its components to aStream.
This function is empty in release builds.
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.
RWriteStream & aWriteStream |
Settable features for MFNE. See SetFeature() .
EClipGcToRect |
Tries to prevent MFNE drawing outside its rect, event if it smaller than MinimumSize() . 0 (or EFalse) parameter disables this, non-zero (or ETrue) enables the feature. |
EDisablePenInput |
Disables VKB. Non-zero (or ETrue) parameter disables VKB, 0 (or EFalse) enables VKB. When disabled, editor doesn't request PenInputServer to start VKB |
EFingerSupport |
Support finger input. Paramter is TFingerSupportParams. |
ELaunchPenInputAutomatic | |
EPartialScreenInput |
Parameter for finger support feature: 0 means disable the suppor; 1 means enable the support; 2 means enable the support with highlight of whole text.
EDisaleFingerSupport | |
EnableFingerSupport | |
EnableWithAllHighlight |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.