CEikDurationEditor 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 CEikMfne.


Detailed Description

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

IMPORT_C  CEikDurationEditor ()
  Default constructor.
virtual IMPORT_C  ~CEikDurationEditor ()
  Destructor.
IMPORT_C void  ConstructL (const TTimeIntervalSeconds &aMinimumDuration, const TTimeIntervalSeconds &aMaximumDuration, const TTimeIntervalSeconds &aInitialDuration, TUint32 aFlags)
  Second phase construction.
IMPORT_C void  SetMinimumAndMaximum (const TTimeIntervalSeconds &aMinimumDuration, const TTimeIntervalSeconds &aMaximumDuration)
  Sets the minimum and maximum duration values.
IMPORT_C void  GetMinimumAndMaximum (TTimeIntervalSeconds &aMinimumDuration, TTimeIntervalSeconds &aMaximumDuration) const
  Gets the duration editor's minimum and maximum values.
IMPORT_C void  SetDuration (const TTimeIntervalSeconds &aDuration)
  Sets the duration editor's value.
IMPORT_C TTimeIntervalSeconds  Duration () const
  Gets the duration editor's value and returns it as a period of seconds.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aResourceReader)
  Second-phase construction from a resource.
IMPORT_C void  PrepareForFocusLossL ()
  Editor validation.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Constructor & Destructor Documentation

IMPORT_C CEikDurationEditor::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.

virtual IMPORT_C CEikDurationEditor::~CEikDurationEditor  )  [virtual]
 

Destructor.

The destructor frees the resources owned by the duration editor, prior to its destruction.


Member Function Documentation

IMPORT_C void CEikDurationEditor::ConstructFromResourceL TResourceReader &  aResourceReader  ) 
 

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.

Parameters:
aResourceReader  A resource file reader.
IMPORT_C void CEikDurationEditor::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.

Parameters:
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 CEikDurationEditor::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 CEikDurationEditor::GetMinimumAndMaximum TTimeIntervalSeconds &  aMinimumDuration,
TTimeIntervalSeconds &  aMaximumDuration
const
 

Gets the duration editor's minimum and maximum values.

Parameters:
aMinimumDuration  On return, the minimum value.
aMaximumDuration  On return, the maximum value.
IMPORT_C void CEikDurationEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  )  [virtual]
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikMfne.

IMPORT_C void CEikDurationEditor::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.

Reimplemented from CEikMfne.

IMPORT_C void CEikDurationEditor::SetDuration const TTimeIntervalSeconds &  aDuration  ) 
 

Sets the duration editor's value.

Parameters:
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 CEikDurationEditor::SetMinimumAndMaximum const TTimeIntervalSeconds &  aMinimumDuration,
const TTimeIntervalSeconds &  aMaximumDuration
 

Sets the minimum and maximum duration values.

The user can only enter values between these bounds.

Parameters:
aMinimumDuration  The minimum duration.
aMaximumDuration  The maximum duration.
Panic:
48 If the minimum duration exceeds the maximum.

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

Copyright © Nokia Corporation 2001-2008
Back to top