class CEikTimeAndDateEditor : public CEikTTimeEditor |
Time and date editor.
This control allows both a time and date to be displayed and edited. It contains the following time fields: hours, minutes and seconds, two time separator characters and am/pm text, and the following date fields: year, month and day, with two date separator characters. The seconds and hours fields are optional and the order of the date fields and the separator characters are locale-dependent. The upper and lower field bounds are set, and dates and times outside these bounds are invalid.
Date field values may be edited directly or via a pop-out calendar dialog.
The editor has an associated resource struct TIME_AND_DATE_EDITOR and control factory identifier EEikCtTimeAndDateEditor.
Public Member Functions | |
---|---|
CEikTimeAndDateEditor () | |
~CEikTimeAndDateEditor () | |
IMPORT_C void | ConstructFromResourceL ( TResourceReader &) |
IMPORT_C void | ConstructL (const TTime &, const TTime &, const TTime &, TUint32 , HBufC *) |
IMPORT_C void | GetMinimumAndMaximum ( TTime &, TTime &) |
IMPORT_C void | HandlePointerEventL (const TPointerEvent &) |
IMPORT_C TBool | IsUninitialised () |
IMPORT_C TKeyResponse | OfferKeyEventL (const TKeyEvent &, TEventCode ) |
IMPORT_C void | PrepareForFocusLossL () |
IMPORT_C void | SetMinimumAndMaximum (const TTime &, const TTime &) |
IMPORT_C void | SetTimeAndDate (const TTime &) |
IMPORT_C void | SetUninitialised ( TBool ) |
IMPORT_C TTime | TimeAndDate () |
Private Member Functions | |
---|---|
IMPORT_C void | CEikMfne_Reserved () |
void | CreatePopoutIfRequiredL () |
void | DoSetMinimumAndMaximum (const TTime &, const TTime &) |
IMPORT_C void * | ExtensionInterface ( TUid ) |
void | GetMinimumAndMaximumAndInitialDatesForCalendarL ( TTime &, TTime &, TTime &) |
TTime | GetTTime () |
void | SetDateFromCalendarAndDrawNow (const TTime &) |
void | SetTTime (const TTime &) |
Inherited Enumerations | |
---|---|
CCoeControl:TZoomType | |
CEikMfne:TFeatureId | |
CEikMfne:TFingerSupportParams |
Private Attributes | |
---|---|
CDateEditor * | iDateEditor |
TTime | iMaximumTimeAndDate |
TTime | iMinimumTimeAndDate |
TInt | iSpare |
CTimeEditor * | iTimeEditor |
Inherited Attributes | |
---|---|
CCoeControl::iCoeEnv | |
CCoeControl::iContext | |
CCoeControl::iPosition | |
CCoeControl::iSize | |
CEikBorderedControl::iBorder |
IMPORT_C | CEikTimeAndDateEditor | ( | ) |
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 | ~CEikTimeAndDateEditor | ( | ) | [virtual] |
Destructor.
This frees the resources owned by the time and date editor, prior to its destruction.
IMPORT_C void | ConstructFromResourceL | ( | TResourceReader & | aResourceReader | ) | [virtual] |
Second phase construction from a resource.
This function completes the construction of a newly-allocated date/time editor from a TIME_AND_DATE_EDITOR resource. The minimum and maximum date/times, the date and time flag settings, and the intervening text are read from the resource, and ConstructL() is called with these settings. The initial date/time is set to the maximum date/time value.
TResourceReader & aResourceReader | A resource file reader. |
IMPORT_C void | ConstructL | ( | const TTime & | aMinimumTimeAndDate, |
const TTime & | aMaximumTimeAndDate, | |||
const TTime & | aInitialTimeAndDate, | |||
TUint32 | aFlags, | |||
HBufC * | aInterveningText = NULL | |||
) |
Second phase construction.
This function completes construction of a newly-allocated date and time editor, by setting the minimum, maximum and initial date and time values. It should be called by the container only if the control is not constructed from a resource file.
The aFlags parameter is used to set whether the seconds or hours fields are not required. The minutes field is always present. It may also be used to specify whether or not to force 24 hour time format, overriding the locale's setting, and whether the editor should have a pop-out calendar dialog.
The locale-dependant date and time settings specified in class TLocale are honoured.
If the initial date/time is outside the bounds specified by the minimum and maximum, it is set to the nearest valid setting.
A panic will occur if the minimum date/time is later than the maximum date/time.
const TTime & aMinimumTimeAndDate | The minimum date and time value. |
const TTime & aMaximumTimeAndDate | The maximum date and time value. |
const TTime & aInitialTimeAndDate | The initial date and time value. |
TUint32 aFlags | A bitmask of flags. See eikon.hrh file, EEikTime, EEikDate etc. |
HBufC * aInterveningText = NULL | Descriptor containing the text to use to separate the time and date portions of the editor. |
void | DoSetMinimumAndMaximum | ( | const TTime & | aMinimumTimeAndDate, |
const TTime & | aMaximumTimeAndDate | |||
) | [private] |
IMPORT_C void * | ExtensionInterface | ( | TUid | aInterface | ) | [private, virtual] |
From CAknControl
TUid aInterface |
IMPORT_C void | GetMinimumAndMaximum | ( | TTime & | aMinimumTimeAndDate, |
TTime & | aMaximumTimeAndDate | |||
) | const [virtual] |
Gets the range of allowable values that may be entered by the user.
void | GetMinimumAndMaximumAndInitialDatesForCalendarL | ( | TTime & | aMinimumDate, |
TTime & | aMaximumDate, | |||
TTime & | aInitialDate | |||
) | const [private, virtual] |
TTime | GetTTime | ( | ) | const [private, virtual] |
An implementation (of this pure virtual function) should get the time from the editor.
Can only be called if CEikMfne::PrepareForFocusLossL() succeeded.
IMPORT_C void | HandlePointerEventL | ( | const TPointerEvent & | aPointerEvent | ) | [virtual] |
const TPointerEvent & aPointerEvent | The pointer event. |
IMPORT_C TBool | IsUninitialised | ( | ) | const |
Gets the uninitialized status of the editor.
IMPORT_C TKeyResponse | OfferKeyEventL | ( | const TKeyEvent & | aKeyEvent, |
TEventCode | aType | |||
) | [virtual] |
Handles key events.
For example, the Tab key validates and launches a calendar popout.
Calls CEikMfne::OfferKeyEventL() if the control does not consume the key.
const TKeyEvent & aKeyEvent | The key event. |
TEventCode aType | The type of key event. |
IMPORT_C void | PrepareForFocusLossL | ( | ) | [virtual] |
Prepares the editor for focus loss.
This function should be called to validate the editor's contents when an attempt is made to remove focus from the control. If the control value is not within the bounds specified by the minimum and maximum date/time values, it is reset to the nearest allowable value, the function will leave and display an appropriate message.
void | SetDateFromCalendarAndDrawNow | ( | const TTime & | aDate | ) | [private, virtual] |
const TTime & aDate |
IMPORT_C void | SetMinimumAndMaximum | ( | const TTime & | aMinimumTimeAndDate, |
const TTime & | aMaximumTimeAndDate | |||
) | [virtual] |
Sets the range of allowable values.
These define the maximum and minimum time/date values that may be entered by the user.
If the existing date/time value is outside the new bounds, it is reset to the nearest allowable value.
void | SetTTime | ( | const TTime & | aTime | ) | [private, virtual] |
An implementation (of this pure virtual function) should set the time in the editor.
const TTime & aTime | The time. |
IMPORT_C void | SetTimeAndDate | ( | const TTime & | aTimeAndDate | ) |
Sets the values of the time and date editor's fields.
const TTime & aTimeAndDate | The new value for the date and time editor's fields. |
IMPORT_C void | SetUninitialised | ( | TBool | aUninitialised | ) |
Sets the uninitialized status of the editor.
TBool aUninitialised | If ETrue, sets the editor as uninitialized, i.e. it doesn't display anything. |
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.