#include <mw/eikmfne.h>
class CEikDurationEditor : public CEikMfne |
Public Member Functions | |
---|---|
CEikDurationEditor() | |
virtual | ~CEikDurationEditor() |
virtual IMPORT_C void | ConstructFromResourceL(TResourceReader &) |
IMPORT_C void | ConstructL(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, TUint32) |
IMPORT_C TTimeIntervalSeconds | Duration() |
IMPORT_C void | GetMinimumAndMaximum(TTimeIntervalSeconds &, TTimeIntervalSeconds &) |
virtual IMPORT_C void | HandlePointerEventL(const TPointerEvent &) |
virtual IMPORT_C void | PrepareForFocusLossL() |
IMPORT_C void | SetDuration(const TTimeIntervalSeconds &) |
IMPORT_C void | SetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &) |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize | |
CEikBorderedControl::iBorder |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType | |
CEikMfne:TFeatureId | |
CEikMfne:TFingerSupportParams |
Duration editor.
The duration editor allows a time duration to be displayed and edited. The editor has a clock icon and an edit field with separators for hours, minutes, and seconds. These fields can all be suppressed using the appropriate flags in the resource declaration.
Unlike the time editor control, the duration editor has no am or pm text. This is because the duration is a length of time (from 0 to 24 hours), rather than a point in time.
The minimum and maximum values are set, and values outside these limits are invalid.
The editor has an associated resource struct DURATION_EDITOR and control factory identifier EEikCtDurationEditor.
IMPORT_C | CEikDurationEditor | ( | ) |
Default constructor.
This function 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 | ~CEikDurationEditor | ( | ) | [virtual] |
Destructor.
The destructor frees the resources owned by the duration editor, prior to its destruction.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aResourceReader | ) | [virtual] |
Reimplemented from CCoeControl::ConstructFromResourceL(TResourceReader &)
Second-phase construction from a resource.
The function reads the maximum and minimum duration values, and the flags settings, from a DURATION_EDITOR resource. It sets the initial duration to be the same as the maximum value and honours the locale's time separators.
Parameter | Description |
---|---|
aResourceReader | A resource file reader. |
IMPORT_C void | ConstructL | ( | const TTimeIntervalSeconds & | aMinimumDuration, |
const TTimeIntervalSeconds & | aMaximumDuration, | |||
const TTimeIntervalSeconds & | aInitialDuration, | |||
TUint32 | aFlags | |||
) |
Second phase construction.
This function completes the construction of a newly-allocated duration editor. This function should be used instead of ConstructFromResourceL() when not initialising from a resource file.
The function sets the editor's minimum, maximum and initial values. The time separator characters specified in class TLocale are honoured. If the initial duration is less than the minimum value the minimum value is used as the initial setting. If the initial duration is greater than the maximum value the maximum value is used as the initial setting.
The aFlags parameter is used to determine whether the seconds or hours fields are not required. The minutes field is always present. Regardless of the value specified in aFlags, 24 hour time format is set, overriding the locale's setting.
Parameter | Description |
---|---|
aMinimumDuration | The minimum interval in seconds. |
aMaximumDuration | The maximum interval in seconds. |
aInitialDuration | The initial interval in seconds. |
aFlags | Duration editor flags. |
IMPORT_C TTimeIntervalSeconds | Duration | ( | ) | const |
Gets the duration editor's value and returns it as a period of seconds.
Returns: The editor's value in seconds.
IMPORT_C void | GetMinimumAndMaximum | ( | TTimeIntervalSeconds & | aMinimumDuration, |
TTimeIntervalSeconds & | aMaximumDuration | |||
) | const |
Gets the duration editor's minimum and maximum values.
Parameter | Description |
---|---|
aMinimumDuration | On return, the minimum value. |
aMaximumDuration | On return, the maximum value. |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
Reimplemented from CEikMfne::HandlePointerEventL(const TPointerEvent &)
From CCoeControl.
Handles pointer events.
Parameter | Description |
---|---|
aPointerEvent | The pointer event. |
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
Reimplemented from CEikMfne::PrepareForFocusLossL()
Editor validation.
This function should be called when an attempt is made to remove focus from a duration editor. If the editor value is not within the bounds specified by the minimum and maximum duration values, it is reset to the nearest allowable value - the function will leave.
IMPORT_C void | SetDuration | ( | const TTimeIntervalSeconds & | aDuration | ) |
Sets the duration editor's value.
Parameter | Description |
---|---|
aDuration | The new value to convert into hours, minutes and seconds and to which the duration editor's fields will be set. |
IMPORT_C void | SetMinimumAndMaximum | ( | const TTimeIntervalSeconds & | aMinimumDuration, |
const TTimeIntervalSeconds & | aMaximumDuration | |||
) |
Sets the minimum and maximum duration values.
The user can only enter values between these bounds.
Parameter | Description |
---|---|
aMinimumDuration | The minimum duration. |
aMaximumDuration | The maximum duration. |