CAgnRptDef Class Reference

class CAgnRptDef : public CBase

A repeat definition, including exceptions and sporadic dates, which is owned by an agenda entry.

The object is set using CAgnEntry::SetRptDefL() and is returned using CAgnSimpleEntry::RptDef().

The repeat definition has a type (daily, weekly etc.) and stores a set of repeat details (e.g. until time, interval between repeats). The repeat details are stored using an instance of a TAgnRpt - derived class. They are set using SetDaily(), SetWeekly() etc. These functions also set the type. It may optionally store an exception list, which is a list of the dates on which the repeat should not occur.

Inherits from

Public Member Functions
~CAgnRptDef()
IMPORT_C voidAddExceptionL(const TAgnCalendarTime &)
IMPORT_C voidAddSporadicDateL(const TAgnCalendarTime &)
IMPORT_C CAgnTzRules *AgnTzRules()
voidClearRRule()
IMPORT_C CTzRules *CloneTzRulesL()
IMPORT_C TTimeConvertFromRepeatLocalToUtcL(const TTime &)
IMPORT_C TTimeConvertFromUtcToRepeatLocalL(const TTime &)
IMPORT_C voidCopyL(const CAgnRptDef &)
IMPORT_C const RArray< TAgnCalendarTime > *Exceptions()
IMPORT_C voidExternalizeL(RWriteStream &, TBool)
IMPORT_C TBoolFindException(const TAgnCalendarTime &)
IMPORT_C const TAgnCalendarTime &FirstInstanceL()
TBool HasRepeatRule()
TBool HasSporadicDates()
IMPORT_C TUintInstanceCountL()
voidInternalizeExceptionsL(RReadStream &)
IMPORT_C voidInternalizeL(RReadStream &, TBool)
voidInternalizeRepeatRuleL(RReadStream &)
voidInternalizeSporadicDatesL(RReadStream &)
voidInternalizeTimeZoneL(RReadStream &, TBool)
TInt InvariantL()
TBool IsARepeatRuleDateInstanceL(const TTime &)
IMPORT_C TBoolIsAnInstanceL(const TTime &)
IMPORT_C TBoolIsAnUnexceptedInstanceL(const TTime &)
IMPORT_C const TAgnCalendarTime &LastInstanceL()
IMPORT_C CAgnRptDef *NewL(const CAgnSimpleEntry &)
IMPORT_C TBoolNudgeNextInstanceL(const TTime &, TTime &, TBool)
IMPORT_C TBoolNudgeNextInstanceUtcL(const TTime &, TTime &)
IMPORT_C TBoolNudgePreviousInstanceUtcL(const TTime &, TTime &)
IMPORT_C TBoolNudgePreviousUnexceptedInstanceL(const TTime &, TTime &)
IMPORT_C voidPruneExceptionsL()
IMPORT_C const TAgnRpt *RRule()
IMPORT_C voidRemoveAllExceptions()
IMPORT_C voidRemoveAllSporadicDates()
voidRemoveSporadicDate(const TAgnCalendarTime &)
IMPORT_C voidSetInterval(TUint16)
IMPORT_C voidSetRRuleL(const TAgnRpt &)
IMPORT_C voidSetTimeZoneL()
IMPORT_C voidSetTimeZoneL(const CTzRules &)
IMPORT_C voidSetUntilTime(const TAgnCalendarTime &)
IMPORT_C const RArray< TAgnCalendarTime > *SporadicDateList()
const TAgnCalendarTime &StartTime()
voidStartTimeChanged()
MAgnCalendarTimeMode::TTimeMode TimeMode()
IMPORT_C TAgnRpt::TTypeType()
TBool operator==(const CAgnRptDef &)
Private Member Functions
CAgnRptDef(const CAgnSimpleEntry &)
CAgnRptDef()
voidClearTimeArray(RArray< TAgnCalendarTime > *&)
voidCopyTimeArrayL(const RArray< TAgnCalendarTime > *, RArray< TAgnCalendarTime > *&)
voidCreateRptObjectL(const TAgnRpt &)
voidCreateRptObjectL(TAgnRpt::TType)
voidEnsureTimeArrayExistsL(RArray< TAgnCalendarTime > *&)
TInt FindSporadicDate(const TAgnCalendarTime &)
TBool IsASporadicDateInstanceL(const TTime &)
TBool NudgeInstanceBackwardsUtcL(const TTime &, TTime &, TBool)
TBool NudgeInstanceForwardsUtcL(const TTime &, TTime &, TBool)
TBool NudgeNextRepeatInstanceToNextValidInstanceUtcL(const TTime &, TTime &)
TBool NudgeNextRepeatInstanceUtcL(const TTime &, TTime &, TBool)
TBool NudgeNextSporadicInstanceUtcL(const TTime &, TTime &, TBool)
TBool NudgeNextUnexceptedRepeatInstanceUtcL(const TTime &, TTime &)
TBool NudgePreviousRepeatInstanceToPreviousValidInstanceUtcL(const TTime &, TTime &)
TBool NudgePreviousRepeatInstanceUtcL(const TTime &, TTime &, TBool)
TBool NudgePreviousSporadicInstanceUtcL(const TTime &, TTime &, TBool)
TBool NudgePreviousUnexceptedRepeatInstanceUtcL(const TTime &, TTime &)
voidResetTimeZone()
CAgnTlsProxy *TimeZoneAccessor()
voidTimeZoneChangedL()
const CTzRules *TzRules()
Inherited Functions
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()
Private Attributes
RArray< TAgnCalendarTime > *iExceptions
const CAgnSimpleEntry &iOwningEntry
TAgnRpt *iRRule
RArray< TAgnCalendarTime > *iSporadicDates
CAgnTzRules *iTimeZone

Constructor & Destructor Documentation

CAgnRptDef(const CAgnSimpleEntry &)

CAgnRptDef(const CAgnSimpleEntry &aOwningEntry)[private]

Parameters

const CAgnSimpleEntry & aOwningEntry

CAgnRptDef()

CAgnRptDef()[private]

~CAgnRptDef()

IMPORT_C~CAgnRptDef()

Frees all resources owned by the repeat definition, prior to its destruction.

Member Functions Documentation

AddExceptionL(const TAgnCalendarTime &)

IMPORT_C voidAddExceptionL(const TAgnCalendarTime &aException)

Adds an exception to the list of exceptions (first creating the exception list if necessary).

Parameters

const TAgnCalendarTime & aExceptionThe exception to add to the list.

AddSporadicDateL(const TAgnCalendarTime &)

IMPORT_C voidAddSporadicDateL(const TAgnCalendarTime &aSporadicDate)

Adds a sporadic date to the list of sporadic dates (first creating the sporadic date list if necessary).

Parameters

const TAgnCalendarTime & aSporadicDateThe sporadic date to add to the list.

AgnTzRules()

IMPORT_C CAgnTzRules *AgnTzRules()const

ClearRRule()

voidClearRRule()

Clear the Repeat Rule only, leaving sporadic dates and exception dates intact

ClearTimeArray(RArray< TAgnCalendarTime > *&)

voidClearTimeArray(RArray< TAgnCalendarTime > *&aTimeArray)[private]

Parameters

RArray< TAgnCalendarTime > *& aTimeArray

CloneTzRulesL()

IMPORT_C CTzRules *CloneTzRulesL()

Gets a copy of the time zone rules that apply to the repeat definition.

ConvertFromRepeatLocalToUtcL(const TTime &)

IMPORT_C TTimeConvertFromRepeatLocalToUtcL(const TTime &aRptLocalDate)const

Parameters

const TTime & aRptLocalDate

ConvertFromUtcToRepeatLocalL(const TTime &)

IMPORT_C TTimeConvertFromUtcToRepeatLocalL(const TTime &aUtcDate)const

Parameters

const TTime & aUtcDate

CopyL(const CAgnRptDef &)

IMPORT_C voidCopyL(const CAgnRptDef &aRpt)

Copies the contents of a repeat definition into this object.

Parameters

const CAgnRptDef & aRpt

CopyTimeArrayL(const RArray< TAgnCalendarTime > *, RArray< TAgnCalendarTime > *&)

voidCopyTimeArrayL(const RArray< TAgnCalendarTime > *aSource,
RArray< TAgnCalendarTime > *&aDestination
)[private]

Parameters

const RArray< TAgnCalendarTime > * aSource
RArray< TAgnCalendarTime > *& aDestination

CreateRptObjectL(const TAgnRpt &)

voidCreateRptObjectL(const TAgnRpt &aRpt)[private]

Create a Repeat Rule of the appropriate repeat rule type operator.

Parameters

const TAgnRpt & aRptRepeat details.

CreateRptObjectL(TAgnRpt::TType)

voidCreateRptObjectL(TAgnRpt::TTypeaType)[private]

Parameters

TAgnRpt::TType aType

EnsureTimeArrayExistsL(RArray< TAgnCalendarTime > *&)

voidEnsureTimeArrayExistsL(RArray< TAgnCalendarTime > *&aTimeArray)[private]

Parameters

RArray< TAgnCalendarTime > *& aTimeArray

Exceptions()

IMPORT_C const RArray< TAgnCalendarTime > *Exceptions()const

Gets a pointer to the repeat definition's exception list. Pointer to the exception list.

ExternalizeL(RWriteStream &, TBool)

IMPORT_C voidExternalizeL(RWriteStream &aStream,
TBoolaToBuffer = EFalse
)

Externalises the repeat definition to a write stream.

Parameters

RWriteStream & aStreamStream to which the object should be externalised.
TBool aToBuffer = EFalse

FindException(const TAgnCalendarTime &)

IMPORT_C TBoolFindException(const TAgnCalendarTime &aException)const

Tests whether aException is in the exceptions list.

ETrue = present, otherwise EFalse.

Parameters

const TAgnCalendarTime & aExceptionThe exception.

FindSporadicDate(const TAgnCalendarTime &)

TInt FindSporadicDate(const TAgnCalendarTime &aException)const [private]

Tests whether aSporadicDate is in the sporadic dates list, using the sporadic date as the find key.

ETrue = present, otherwise EFalse.

Parameters

const TAgnCalendarTime & aExceptionThe sporadic dates.

FirstInstanceL()

IMPORT_C const TAgnCalendarTime &FirstInstanceL()const

Gets the first instance of the repeat as a TAgnCalendarTime. This is either the first sporadic date or the start of the repeat rule, whichever is earlier.

The first instance of the repeat.

HasRepeatRule()

TBool HasRepeatRule()const

Returns ETrue if there is a repeat rule

if there is a repeat rule

HasSporadicDates()

TBool HasSporadicDates()const

Returns ETrue if there is at least one sporadic date

if there is at least one sporadic date

InstanceCountL()

IMPORT_C TUintInstanceCountL()const

Gets the number of repeat instances generated by the repeat algorithm, including excepted instances.

The number of repeat instances.

InternalizeExceptionsL(RReadStream &)

voidInternalizeExceptionsL(RReadStream &aStream)

Parameters

RReadStream & aStream

InternalizeL(RReadStream &, TBool)

IMPORT_C voidInternalizeL(RReadStream &aStream,
TBoolaFromBuffer = EFalse
)

Internalises the repeat definition from a read stream, including type, repeat details and exception list.

Parameters

RReadStream & aStreamStream from which the object should be internalised.
TBool aFromBuffer = EFalse

InternalizeRepeatRuleL(RReadStream &)

voidInternalizeRepeatRuleL(RReadStream &aStream)

Parameters

RReadStream & aStream

InternalizeSporadicDatesL(RReadStream &)

voidInternalizeSporadicDatesL(RReadStream &aStream)

Parameters

RReadStream & aStream

InternalizeTimeZoneL(RReadStream &, TBool)

voidInternalizeTimeZoneL(RReadStream &aStream,
TBoolaFromBuffer = EFalse
)

Parameters

RReadStream & aStream
TBool aFromBuffer = EFalse

InvariantL()

TInt InvariantL()const

Check that the rpt doesn't violate its invariants

IsARepeatRuleDateInstanceL(const TTime &)

TBool IsARepeatRuleDateInstanceL(const TTime &aDate)const

Parameters

const TTime & aDate

IsASporadicDateInstanceL(const TTime &)

TBool IsASporadicDateInstanceL(const TTime &aDate)const [private]

Parameters

const TTime & aDate

IsAnInstanceL(const TTime &)

IMPORT_C TBoolIsAnInstanceL(const TTime &aDate)const

Tests whether aDate (System local time) falls on an instance generated from the repeat algorithm or on a sporadic date including excepted items.

Note: this function is not intended to be called by a view.

True = date falls on an instance, otherwise False.

Parameters

const TTime & aDateThe date to be checked, expressed as System Local Time

IsAnUnexceptedInstanceL(const TTime &)

IMPORT_C TBoolIsAnUnexceptedInstanceL(const TTime &aDate)const

Tests whether aDate falls on an instance generated from the repeat algorithm or a sporadic date which is not excepted.

True = the date falls on a non excepted instance, otherwise False.

Parameters

const TTime & aDateThe system local date to be checked, expressed as Current System Local Time

LastInstanceL()

IMPORT_C const TAgnCalendarTime &LastInstanceL()const

Gets the last instance of the repeat as a TAgnCalendarTime. This is either the last sporadic date or the end of the repeat rule, whichever is latest.

The last instance of the repeat.

NewL(const CAgnSimpleEntry &)

IMPORT_C CAgnRptDef *NewL(const CAgnSimpleEntry &aOwningEntry)[static]

Allocates and constructs a repeat definition.

Pointer to the created repeat definition.

Parameters

const CAgnSimpleEntry & aOwningEntry

NudgeInstanceBackwardsUtcL(const TTime &, TTime &, TBool)

TBool NudgeInstanceBackwardsUtcL(const TTime &aDate,
TTime &aNext,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDate
TTime & aNext
TBool aCheckExcepted

NudgeInstanceForwardsUtcL(const TTime &, TTime &, TBool)

TBool NudgeInstanceForwardsUtcL(const TTime &aDate,
TTime &aNext,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDate
TTime & aNext
TBool aCheckExcepted

NudgeNextInstanceL(const TTime &, TTime &, TBool)

IMPORT_C TBoolNudgeNextInstanceL(const TTime &aDay,
TTime &aNext,
TBoolaCheckUnexcepted
)const

Tests whether there is another repeat instance date after aDate (System local time), including excepted instances and Sporadic Dates.

If there is, it returns ETrue and sets aNext to it. If not, it returns EFalse and sets aNext to the last valid instance date. If aDate is a valid instance, then aNext is set to it, not the next instance.

For example:

If repeat instances fall on 10th Jan and 20th Jan, then if aDate = 10th Jan, this function returns ETrue and sets aNext to 10th Jan. If aDate = 11th to 19th Jan, it returns ETrue and sets aNext to 20th Jan. If aDate = 21st Jan, it returns EFalse and sets aNext to 20th Jan.

This function can leave.

True if there is a next instance, otherwise False.

Parameters

const TTime & aDay
TTime & aNextOn return contains the date (in System Local Time) of the next instance if there is one, or if not, the last valid instance date
TBool aCheckUnexcepted

NudgeNextInstanceUtcL(const TTime &, TTime &)

IMPORT_C TBoolNudgeNextInstanceUtcL(const TTime &aDayUtc,
TTime &aNextUtc
)const

Parameters

const TTime & aDayUtc
TTime & aNextUtc

NudgeNextRepeatInstanceToNextValidInstanceUtcL(const TTime &, TTime &)

TBool NudgeNextRepeatInstanceToNextValidInstanceUtcL(const TTime &aUtcDate,
TTime &aUtcNext
)const [private]

Parameters

const TTime & aUtcDate
TTime & aUtcNext

NudgeNextRepeatInstanceUtcL(const TTime &, TTime &, TBool)

TBool NudgeNextRepeatInstanceUtcL(const TTime &aDate,
TTime &aNext,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDate
TTime & aNext
TBool aCheckExcepted

NudgeNextSporadicInstanceUtcL(const TTime &, TTime &, TBool)

TBool NudgeNextSporadicInstanceUtcL(const TTime &aDate,
TTime &aNext,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDate
TTime & aNext
TBool aCheckExcepted

NudgeNextUnexceptedRepeatInstanceUtcL(const TTime &, TTime &)

TBool NudgeNextUnexceptedRepeatInstanceUtcL(const TTime &aDate,
TTime &aNext
)const [private]

Parameters

const TTime & aDate
TTime & aNext

NudgePreviousInstanceUtcL(const TTime &, TTime &)

IMPORT_C TBoolNudgePreviousInstanceUtcL(const TTime &aDayUtc,
TTime &aPrevUtc
)const

Parameters

const TTime & aDayUtc
TTime & aPrevUtc

NudgePreviousRepeatInstanceToPreviousValidInstanceUtcL(const TTime &, TTime &)

TBool NudgePreviousRepeatInstanceToPreviousValidInstanceUtcL(const TTime &aUtcDate,
TTime &aUtcPrev
)const [private]

Parameters

const TTime & aUtcDate
TTime & aUtcPrev

NudgePreviousRepeatInstanceUtcL(const TTime &, TTime &, TBool)

TBool NudgePreviousRepeatInstanceUtcL(const TTime &aDay,
TTime &aPrev,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDay
TTime & aPrev
TBool aCheckExcepted

NudgePreviousSporadicInstanceUtcL(const TTime &, TTime &, TBool)

TBool NudgePreviousSporadicInstanceUtcL(const TTime &aDay,
TTime &aPrev,
TBoolaCheckExcepted
)const [private]

Parameters

const TTime & aDay
TTime & aPrev
TBool aCheckExcepted

NudgePreviousUnexceptedInstanceL(const TTime &, TTime &)

IMPORT_C TBoolNudgePreviousUnexceptedInstanceL(const TTime &aDay,
TTime &aPrev
)const

Tests whether there is a repeat instance or sporadic date before aDate.

If there is, it returns ETrue and sets aNext to it. If not, it returns EFalse and sets aNext to the last valid instance date. If aDate is a valid instance, then aNext is set to it, not the next instance.

This function can leave.

For example:

If repeat instances fall on 10th Jan and 20th Jan, then if aDate = 20th Jan, it returns ETrue and sets aNext to 20th Jan. If aDate = 11th to 19th Jan, it returns ETrue and sets aNext to 10th Jan. If aDate = 9th Jan, it returns EFalse and sets aNext to 10th Jan.

True if there is a previous instance, otherwise false.

Parameters

const TTime & aDay
TTime & aPrevOn return contains the date (System Local Time) of the previous instance if there is one, otherwise the first valid instance date.

NudgePreviousUnexceptedRepeatInstanceUtcL(const TTime &, TTime &)

TBool NudgePreviousUnexceptedRepeatInstanceUtcL(const TTime &aDay,
TTime &aPrev
)const [private]

Parameters

const TTime & aDay
TTime & aPrev

PruneExceptionsL()

IMPORT_C voidPruneExceptionsL()

Removes any exceptions which do not occur on instances

RRule()

IMPORT_C const TAgnRpt *RRule()const

Gets a pointer to the repeat details. Pointer to the repeat details

RemoveAllExceptions()

IMPORT_C voidRemoveAllExceptions()

Removes all the exceptions from the exception list.

RemoveAllSporadicDates()

IMPORT_C voidRemoveAllSporadicDates()

Removes all the sporadic dates from the sporadic date list.

RemoveSporadicDate(const TAgnCalendarTime &)

voidRemoveSporadicDate(const TAgnCalendarTime &aException)

Removes a sporadic date from the sporadic date list.

If it is the last sporadic date in the list, the list is deleted.

ETrue if the sporadic date was found and removed, otherwise EFalse.

Parameters

const TAgnCalendarTime & aExceptionThe sporadic date to be removed.

ResetTimeZone()

voidResetTimeZone()[private]

SetInterval(TUint16)

IMPORT_C voidSetInterval(TUint16aInterval)

Parameters

TUint16 aInterval

SetRRuleL(const TAgnRpt &)

IMPORT_C voidSetRRuleL(const TAgnRpt &aRpt)

Parameters

const TAgnRpt & aRpt

SetTimeZoneL()

IMPORT_C voidSetTimeZoneL()

Sets the time zone to the current system time zone. Leaves with KErrGeneral if the time zone server could not be accessed.

SetTimeZoneL(const CTzRules &)

IMPORT_C voidSetTimeZoneL(const CTzRules &aTimeZone)

Sets the time zone to aTimeZone

Parameters

const CTzRules & aTimeZoneThe time zone in which the repeat entry times are expressed. It contains a collection of time zone rules.

SetUntilTime(const TAgnCalendarTime &)

IMPORT_C voidSetUntilTime(const TAgnCalendarTime &aUntilTime)

Parameters

const TAgnCalendarTime & aUntilTime

SporadicDateList()

IMPORT_C const RArray< TAgnCalendarTime > *SporadicDateList()const

Gets a pointer to the repeat definition's sporadic date list. Pointer to the sporadic date list.

StartTime()

const TAgnCalendarTime &StartTime()const

Gets the start date expressed as Current System Local Time. The start date expressed as Current System Local Time.

StartTimeChanged()

voidStartTimeChanged()

TimeMode()

MAgnCalendarTimeMode::TTimeMode TimeMode()const

TimeZoneAccessor()

CAgnTlsProxy *TimeZoneAccessor()[private]

TimeZoneChangedL()

voidTimeZoneChangedL()[private]

Type()

IMPORT_C TAgnRpt::TTypeType()const

Gets the repeat definition's type, as set by SetDaily(), SetWeekly() etc.

The repeat definition's type.

TzRules()

const CTzRules *TzRules()const [private]

operator==(const CAgnRptDef &)

TBool operator==(const CAgnRptDef &aRpt)const

Compares two repeat definitions for equality.

This compares all repeat details, the repeat type and the exception list.

True if complete definitions agree, otherwise False.

Parameters

const CAgnRptDef & aRpt

Member Data Documentation

RArray< TAgnCalendarTime > * iExceptions

RArray< TAgnCalendarTime > *iExceptions[private]

const CAgnSimpleEntry & iOwningEntry

const CAgnSimpleEntry &iOwningEntry[private]

TAgnRpt * iRRule

TAgnRpt *iRRule[private]

RArray< TAgnCalendarTime > * iSporadicDates

RArray< TAgnCalendarTime > *iSporadicDates[private]

CAgnTzRules * iTimeZone

CAgnTzRules *iTimeZone[private]