CEikTimeOffsetEditor 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

Time offset editor.

This control allows a signed time offset to be displayed and edited. It has the same fields as the time editor control CEikTimeEditor, except there is no AM or PM text because the value is a time offset, positive or negative, from 0 to 24 hours rather than a point in time.

The editor has an associated resource struct TIME_OFFSET_EDITOR and control factory identifier EEikCtTimeOffsetEditor.


Public Member Functions

IMPORT_C  CEikTimeOffsetEditor ()
  Default constructor.
virtual IMPORT_C  ~CEikTimeOffsetEditor ()
  Destructor.
IMPORT_C void  ConstructL (const TTimeIntervalSeconds &aMinimumTimeOffset, const TTimeIntervalSeconds &aMaximumTimeOffset, const TTimeIntervalSeconds &aInitialTimeOffset, TUint32 aFlags)
  Second phase constructor.
IMPORT_C void  SetMinimumAndMaximum (const TTimeIntervalSeconds &aMinimumTimeOffset, const TTimeIntervalSeconds &aMaximumTimeOffset)
  Sets the range of allowable offset values.
IMPORT_C void  GetMinimumAndMaximum (TTimeIntervalSeconds &aMinimumTimeOffset, TTimeIntervalSeconds &aMaximumTimeOffset) const
  Gets the range of allowable values that may be entered by the user.
IMPORT_C void  SetTimeOffset (const TTimeIntervalSeconds &aTimeOffset)
  Sets the time offset editor's value.
IMPORT_C TTimeIntervalSeconds  TimeOffset () const
  Gets the time offset editor's value converted into seconds.
IMPORT_C void  ConstructFromResourceL (TResourceReader &aResourceReader)
  Second phase construction from a resource.
IMPORT_C void  PrepareForFocusLossL ()
  Prepares editor for focus loss.
IMPORT_C void  HandlePointerEventL (const TPointerEvent &aPointerEvent)
  From CCoeControl.

Constructor & Destructor Documentation

IMPORT_C CEikTimeOffsetEditor::CEikTimeOffsetEditor  ) 
 

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 CEikTimeOffsetEditor::~CEikTimeOffsetEditor  )  [virtual]
 

Destructor.

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


Member Function Documentation

IMPORT_C void CEikTimeOffsetEditor::ConstructFromResourceL TResourceReader &  aResourceReader  ) 
 

Second phase construction from a resource.

This function completes the construction of a time offset editor from a TIME_OFFSET_EDITOR resource.

The minimum and maximum time offsets, and the flags settings are read from the resource, and ConstructL() is called with these settings. The initial time offset is set to the maximum time offset value.

Parameters:
aResourceReader  A resource file reader.
IMPORT_C void CEikTimeOffsetEditor::ConstructL const TTimeIntervalSeconds &  aMinimumTimeOffset,
const TTimeIntervalSeconds &  aMaximumTimeOffset,
const TTimeIntervalSeconds &  aInitialTimeOffset,
TUint32  aFlags
 

Second phase constructor.

This function completes the construction of a time offset editor, by setting its minimum, maximum and initial values. The time separator characters specified in the system's locale are honoured. It should be called by the container only if the control is not constructed from a resource file.

The aFlags parameter is used to determine whether the seconds or hours fields are displayed by the editor. The minutes field is always displayed. This function forces 24 hour time format for the time offset editor, overriding the locale's setting.

If the initial time offset is outside the bounds specified, it is invalid and will be reset to the upper or lower bound.

The minimum value for a time offset editor is -23:59:59, and the maximum value is 23:59:59.

Parameters:
aMinimumTimeOffset  The minimum allowable value, in seconds.
aMaximumTimeOffset  The maximum allowable value, in seconds.
aInitialTimeOffset  The initial value, in seconds.
aFlags  Determines which fields are required. Specify CTimeEditor::EWithoutSecondsField for no seconds field, CTimeEditor::EWithoutHoursField for no hours field. 24 hour clock format is set, regardless of the flag setting specified in this parameter.
IMPORT_C void CEikTimeOffsetEditor::GetMinimumAndMaximum TTimeIntervalSeconds &  aMinimumTimeOffset,
TTimeIntervalSeconds &  aMaximumTimeOffset
const
 

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

Parameters:
aMinimumTimeOffset  On return, contains the time offset editor’s minimum allowable value.
aMaximumTimeOffset  On return, contains the time offset editor’s maximum allowable value.
IMPORT_C void CEikTimeOffsetEditor::HandlePointerEventL const TPointerEvent &  aPointerEvent  )  [virtual]
 

From CCoeControl.

Handles pointer events.

Parameters:
aPointerEvent  The pointer event.

Reimplemented from CEikMfne.

IMPORT_C void CEikTimeOffsetEditor::PrepareForFocusLossL  )  [virtual]
 

Prepares 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 offset values, it is reset to the nearest allowable value. The function then leaves.

Reimplemented from CEikMfne.

IMPORT_C void CEikTimeOffsetEditor::SetMinimumAndMaximum const TTimeIntervalSeconds &  aMinimumTimeOffset,
const TTimeIntervalSeconds &  aMaximumTimeOffset
 

Sets the range of allowable offset values.

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

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

Parameters:
aMinimumTimeOffset  The minimum allowable value.
aMaximumTimeOffset  The maximum allowable value.
Panic:
49 If the minimum exceeds the maximum.
IMPORT_C void CEikTimeOffsetEditor::SetTimeOffset const TTimeIntervalSeconds &  aTimeOffset  ) 
 

Sets the time offset editor's value.

The sign is set according to whether the value specified is positive or negative.

Parameters:
aTimeOffset  The new offset value to which to assign to the editor.
IMPORT_C TTimeIntervalSeconds CEikTimeOffsetEditor::TimeOffset  )  const
 

Gets the time offset editor's value converted into seconds.

Returns:
The editor's value in seconds.

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

Copyright © Nokia Corporation 2001-2008
Back to top