CEikTimeEditor Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikctl.lib eikcoctl.lib uiklaf.lib form.lib

Capability Information

Required Capabilities

None


#include <eikmfne.h>

Inherits CEikTTimeEditor.


Detailed Description

Time editor.

This control allows a time value to be displayed and edited. By default the editor has hours, minutes and seconds fields, although the seconds and hours fields may be omitted. 12 and 24-hour format are supported. When 12-hour format is used, am or pm text will be included as another field, either before or after the time. Locale information is used to determine the time separator characters. Locale information is set and retrieved using class TLocale.

The upper and lower field bounds are set depending on the format, and times outside these bounds are invalid.

The editor has an associated resource struct TIME_EDITOR and control factory identifier EEikCtTimeEditor.


Public Member Functions

IMPORT_C  CEikTimeEditor ()
  Default constructor.
virtual IMPORT_C  ~CEikTimeEditor ()
  Destructor.
IMPORT_C void  ConstructL (const TTime &aMinimumTime, const TTime &aMaximumTime, const TTime &aInitialTime, TUint32 aFlags)
  Second phase construction.
IMPORT_C void  SetTime (const TTime &aTime)
  Sets the time editor's value.
IMPORT_C TTime  Time () const
  Gets the time editor's value.
IMPORT_C void  SetUninitialised (TBool aUninitialised)
  Sets the uninitialized status of the editor.
IMPORT_C TBool  IsUninitialised () const
  Gets the uninitialized status of the editor.
virtual IMPORT_C void  SetMinimumAndMaximum (const TTime &aMinimumTime, const TTime &aMaximumTime)
  Sets the range of allowable time values.
virtual IMPORT_C void  GetMinimumAndMaximum (TTime &aMinimumTime, TTime &aMaximumTime) const
  Gets the range of allowable values that may be entered by the user.
virtual IMPORT_C void  ConstructFromResourceL (TResourceReader &aResourceReader)
  Second phase construction from a resource.
virtual IMPORT_C void  PrepareForFocusLossL ()
  Prepares the editor for focus loss.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Constructor & Destructor Documentation

IMPORT_C CEikTimeEditor::CEikTimeEditor  ) 
 

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.

virtual IMPORT_C CEikTimeEditor::~CEikTimeEditor  )  [virtual]
 

Destructor.

This frees the resources owned by the time editor, prior to its destruction.


Member Function Documentation

virtual IMPORT_C void CEikTimeEditor::ConstructFromResourceL TResourceReader &  aResourceReader  )  [virtual]
 

Second phase construction from a resource.

This function completes the construction of a newly-allocated time editor from a TIME_EDITOR resource. The minimum and maximum times, and the flags settings are read from the resource, and ConstructL() is called with these settings. The initial time is set to the maximum time value. Honours the locale's AM/PM text setting and time separators.

Parameters:
aResourceReader  A resource file reader.
IMPORT_C void CEikTimeEditor::ConstructL const TTime &  aMinimumTime,
const TTime &  aMaximumTime,
const TTime &  aInitialTime,
TUint32  aFlags
 

Second phase construction.

This function completes the construction of a newly-allocated time editor, by setting its minimum, maximum and initial values, and the AM/PM text settings - the AM/PM settings and time separator characters specified in class TLocale are honoured. It should be called by the container only if the control is not constructed from a resource file.

If the initial time is outside the bounds specified, it is reset to the nearest available setting.

The aFlags parameter is used to determine whether the seconds or hours fields are 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.

A panic will occur if the minimum time is later than the maximum time.

Parameters:
aMinimumTime  The minimum allowable time.
aMaximumTime  The maximum allowable time.
aInitialTime  The initial time.
aFlags  Determines which fields are required and whether or not to force 24 hour formatting. See eikon.hrh EEiktime etc.
virtual IMPORT_C void CEikTimeEditor::GetMinimumAndMaximum TTime &  aMinimumTime,
TTime &  aMaximumTime
const [virtual]
 

Gets the range of allowable values that may be entered by the user.

Parameters:
aMinimumTime  On return, contains the time editor's minimum allowable value.
aMaximumTime  On return, contains the time editor's maximum allowable value.

Implements CEikTTimeEditor.

IMPORT_C void CEikTimeEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  )  [virtual]
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikMfne.

IMPORT_C TBool CEikTimeEditor::IsUninitialised  )  const
 

Gets the uninitialized status of the editor.

Returns:
ETrue, if the editor is set as uninitialized.
virtual IMPORT_C void CEikTimeEditor::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 time values, it is reset to the nearest allowable value, the function will leave and will display an appropriate message.

Reimplemented from CEikMfne.

virtual IMPORT_C void CEikTimeEditor::SetMinimumAndMaximum const TTime &  aMinimumTime,
const TTime &  aMaximumTime
[virtual]
 

Sets the range of allowable time values.

These define the maximum and minimum values that may be entered by the user.

If the existing time value is outside the bounds set by this function, it is reset to the nearest boundary value.

Parameters:
aMinimumTime  The minimum allowable value.
aMaximumTime  The maximum allowable value.
Panic:
38 If the minimum value exceeds the maximum.

Implements CEikTTimeEditor.

IMPORT_C void CEikTimeEditor::SetTime const TTime &  aTime  ) 
 

Sets the time editor's value.

Parameters:
aTime  The new value to which to set the editor's fields.
IMPORT_C void CEikTimeEditor::SetUninitialised TBool  aUninitialised  ) 
 

Sets the uninitialized status of the editor.

Parameters:
aUninitialised  If ETrue, sets the editor as uninitialized, i.e. it doesn't display anything.
IMPORT_C TTime CEikTimeEditor::Time  )  const
 

Gets the time editor's value.

Returns:
The editor's value. (Date values are all zero.)

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top