CEikDurationEditor Class Reference

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 voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidConstructL(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, TUint32)
IMPORT_C TTimeIntervalSecondsDuration()
IMPORT_C voidGetMinimumAndMaximum(TTimeIntervalSeconds &, TTimeIntervalSeconds &)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C voidPrepareForFocusLossL()
IMPORT_C voidSetDuration(const TTimeIntervalSeconds &)
IMPORT_C voidSetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &)
Private Member Functions
IMPORT_C voidCEikMfne_Reserved()
voidDoSetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &)
IMPORT_C void *ExtensionInterface(TUid)
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::ActivateL()
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::ComponentControl(TInt)const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CountComponentControls()const
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MaximumWidth()const
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetContainerWindowL(const CCoeControl &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetDimmed(TBool)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikBorderedControl::Border()const
CEikBorderedControl::CEikBorderedControl()
CEikBorderedControl::CEikBorderedControl(const TGulBorder &)
CEikBorderedControl::HasBorder()const
CEikBorderedControl::SetAdjacent(TInt)
CEikBorderedControl::SetBorder(TGulBorder::TBorderType)
CEikBorderedControl::SetBorder(TInt)
CEikMfne::AddField(CEikMfneField *)
CEikMfne::BorderMargins()const
CEikMfne::CEikMfne()
CEikMfne::Convert(const TTime &)
CEikMfne::Convert(const TTimeIntervalSeconds &)
CEikMfne::CreateFieldArrayL(TInt)
CEikMfne::CurrentField()const
CEikMfne::DrawNowAndLeaveWithTimeDateFormatInfoMsgL(TInt,const TTime &)const
CEikMfne::Field(TInt)const
CEikMfne::FieldIsAboutToBeDeHighlighted(CEikMfneField *,TBool &)
CEikMfne::FocusChanged(TDrawNow)
CEikMfne::Font()const
CEikMfne::GetColorUseListL(CArrayFix< TCoeColorUse > &)const
CEikMfne::GetCursorInfo(TPoint &,TInt &,TInt &,TInt &)
CEikMfne::GetFeature(TInt,TInt &)const
CEikMfne::HandleInteraction(TBool,TInt,TInt,CEikMfneField::THighlightType,TBool &,TBool &)
CEikMfne::HandleMfneCommandL(TInt)
CEikMfne::HandleResourceChange(TInt)
CEikMfne::HighlightField(TInt)
CEikMfne::InputCapabilities()const
CEikMfne::InvalidFieldAlert()
CEikMfne::LeaveWithAlert(TInt)
CEikMfne::MakeVisible(TBool)
CEikMfne::MfneSize()const
CEikMfne::MfneSize(TBool)
CEikMfne::MinimumSize()
CEikMfne::MopSupplyObject(TTypeUid)
CEikMfne::NumFields()const
CEikMfne::OfferKeyEventL(const TKeyEvent &,TEventCode)
CEikMfne::ReadDate(TResourceReader &)
CEikMfne::ReadDuration(TResourceReader &)
CEikMfne::ReadTime(TResourceReader &)
CEikMfne::ReadTimeAndDate(TResourceReader &)
CEikMfne::ReadTimeOffset(TResourceReader &)
CEikMfne::ReportStateChangeEventL()
CEikMfne::ReportUpdate()
CEikMfne::ResetFieldArray()
CEikMfne::SetCurrentField(TInt)
CEikMfne::SetFeature(TInt,TInt)
CEikMfne::SetFirstEditableField()
CEikMfne::SetFont(const CFont *)
CEikMfne::SetMfneAlignment(TInt)
CEikMfne::SetSkinBackgroundControlContextL(MAknsControlContext *)
CEikMfne::SetSkinTextColorL(TInt,TInt)
CEikMfne::SetSuppressBackgroundDrawing(TBool)
CEikMfne::SetUpAndDownKeysConsumed(TBool)
CEikMfne::SetUseOverrideColors(TBool)
CEikMfne::SetValidateCallBack(TCallBack)
CEikMfne::SizeChanged()
CEikMfne::SupportsFeature(TInt)const
CEikMfne::WriteInternalStateL(RWriteStream &)const
CEikMfne::~CEikMfne()
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

Constructor & Destructor Documentation

CEikDurationEditor()

IMPORT_CCEikDurationEditor()

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.

~CEikDurationEditor()

IMPORT_C~CEikDurationEditor()[virtual]

Destructor.

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

Member Functions Documentation

CEikMfne_Reserved()

IMPORT_C voidCEikMfne_Reserved()[private, virtual]

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(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.

Parameters

TResourceReader & aResourceReaderA resource file reader.

ConstructL(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, const TTimeIntervalSeconds &, TUint32)

IMPORT_C voidConstructL(const TTimeIntervalSeconds &aMinimumDuration,
const TTimeIntervalSeconds &aMaximumDuration,
const TTimeIntervalSeconds &aInitialDuration,
TUint32aFlags
)

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

const TTimeIntervalSeconds & aMinimumDurationThe minimum interval in seconds.
const TTimeIntervalSeconds & aMaximumDurationThe maximum interval in seconds.
const TTimeIntervalSeconds & aInitialDurationThe initial interval in seconds.
TUint32 aFlagsDuration editor flags.

DoSetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &)

voidDoSetMinimumAndMaximum(const TTimeIntervalSeconds &aMinimumDuration,
const TTimeIntervalSeconds &aMaximumDuration
)[private]

Parameters

const TTimeIntervalSeconds & aMinimumDuration
const TTimeIntervalSeconds & aMaximumDuration

Duration()

IMPORT_C TTimeIntervalSecondsDuration()const

Gets the duration editor's value and returns it as a period of seconds.

The editor's value in seconds.

ExtensionInterface(TUid)

IMPORT_C void *ExtensionInterface(TUidaInterface)[private, virtual]

Parameters

TUid aInterface

GetMinimumAndMaximum(TTimeIntervalSeconds &, TTimeIntervalSeconds &)

IMPORT_C voidGetMinimumAndMaximum(TTimeIntervalSeconds &aMinimumDuration,
TTimeIntervalSeconds &aMaximumDuration
)const

Gets the duration editor's minimum and maximum values.

Parameters

TTimeIntervalSeconds & aMinimumDurationOn return, the minimum value.
TTimeIntervalSeconds & aMaximumDurationOn return, the maximum value.

HandlePointerEventL(const TPointerEvent &)

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl.

Handles pointer events.

Parameters

const TPointerEvent & aPointerEventThe pointer event.

PrepareForFocusLossL()

IMPORT_C voidPrepareForFocusLossL()[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.

SetDuration(const TTimeIntervalSeconds &)

IMPORT_C voidSetDuration(const TTimeIntervalSeconds &aDuration)

Sets the duration editor's value.

Parameters

const TTimeIntervalSeconds & aDurationThe new value to convert into hours, minutes and seconds and to which the duration editor's fields will be set.

SetMinimumAndMaximum(const TTimeIntervalSeconds &, const TTimeIntervalSeconds &)

IMPORT_C voidSetMinimumAndMaximum(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.

Parameters

const TTimeIntervalSeconds & aMinimumDurationThe minimum duration.
const TTimeIntervalSeconds & aMaximumDurationThe maximum duration.

Member Data Documentation

TTimeIntervalSeconds iMaximumDuration

TTimeIntervalSeconds iMaximumDuration[private]

TTimeIntervalSeconds iMinimumDuration

TTimeIntervalSeconds iMinimumDuration[private]

TInt iSpare

TInt iSpare[private]

CTimeEditor * iTimeEditor

CTimeEditor *iTimeEditor[private]