class CEikDurationEditor : public CEikMfne |
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.
Public Member Functions | |
---|---|
CEikDurationEditor() | |
~CEikDurationEditor() | |
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 &) |
IMPORT_C void | HandlePointerEventL(const TPointerEvent &) |
IMPORT_C void | PrepareForFocusLossL() |
IMPORT_C void | SetDuration(const TTimeIntervalSeconds &) |
IMPORT_C void | SetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &) |
Private Member Functions | |
---|---|
IMPORT_C void | CEikMfne_Reserved() |
void | DoSetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &) |
IMPORT_C void * | ExtensionInterface(TUid) |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType | |
CEikMfne:TFeatureId | |
CEikMfne:TFingerSupportParams |
Private Attributes | |
---|---|
TTimeIntervalSeconds | iMaximumDuration |
TTimeIntervalSeconds | iMinimumDuration |
TInt | iSpare |
CTimeEditor * | iTimeEditor |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize | |
CEikBorderedControl::iBorder |
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] |
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.
TResourceReader & 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.
const TTimeIntervalSeconds & aMinimumDuration | The minimum interval in seconds. |
const TTimeIntervalSeconds & aMaximumDuration | The maximum interval in seconds. |
const TTimeIntervalSeconds & aInitialDuration | The initial interval in seconds. |
TUint32 aFlags | Duration editor flags. |
void | DoSetMinimumAndMaximum | ( | const TTimeIntervalSeconds & | aMinimumDuration, |
const TTimeIntervalSeconds & | aMaximumDuration | |||
) | [private] |
const TTimeIntervalSeconds & aMinimumDuration | |
const TTimeIntervalSeconds & aMaximumDuration |
IMPORT_C TTimeIntervalSeconds | Duration | ( | ) | const |
Gets the duration editor's value and returns it as a period of seconds.
The editor's value in seconds.
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl
TUid aInterface |
IMPORT_C void | GetMinimumAndMaximum | ( | TTimeIntervalSeconds & | aMinimumDuration, |
TTimeIntervalSeconds & | aMaximumDuration | |||
) | const |
Gets the duration editor's minimum and maximum values.
TTimeIntervalSeconds & aMinimumDuration | On return, the minimum value. |
TTimeIntervalSeconds & aMaximumDuration | On return, the maximum value. |
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
From CCoeControl.
Handles pointer events.
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
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.
const TTimeIntervalSeconds & 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.
panic
48 If the minimum duration exceeds the maximum.
const TTimeIntervalSeconds & aMinimumDuration | The minimum duration. |
const TTimeIntervalSeconds & aMaximumDuration | The maximum duration. |