Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: agmrptd.h
Link against: agnmodel.lib

Class TAgnRpt

TAgnRpt

Support

Supported from 5.0

Description

This class stores the repeat details common to all agenda model repeat types. The abstract base class for the different repeat classes. The common repeat details are the start and end dates of the repeat, the interval between repeats, and two flags which indicate whether views should display the next repeat only, and whether it should repeat forever. An instance of a TAgnRpt-derived class is owned by a repeat definition (CAgnRptDef), which also contains the repeat exceptions list. It is set using CAgnRptDef::SetDaily(), SetWeekly() etc.

Defined in TAgnRpt:
ClearAll(), DisplayNextOnly(), EndDate(), EndDateAsAgnDate(), ExternalizeL(), FindRptEndDate(), InstanceCount(), InternalizeL(), Interval(), RepeatForever(), SetDisplayNextOnly(), SetEndDate(), SetInterval(), SetRepeatForever(), SetStartDate(), StartDate(), StartDateAsAgnDate(), TAgnRpt(), operator==()


Construction


TAgnRpt()

TAgnRpt();

Description

The default C++ constructor is used to construct the repeat object. The start and end dates are initialised to NULL values, the repeat interval to zero, and display next only and repeat forever flags are set to EFalse.


TAgnRpt()

TAgnRpt(const TAgnRpt& aRpt);

Description

The C++ copy constructor copies a new TAgnRpt object from an existing one.

Parameters

const TAgnRpt& aRpt

The object to be copied.

[Top]


Set repeat details


SetStartDate()

void SetStartDate(const TTime& aStartdate);

Description

Sets the start date for this repeat.

Parameters

const TTime& aStartdate

The start date (any time portion is ignored).


SetStartDate()

void SetStartDate(TAgnDate aStartdate);

Description

Sets the start date for this repeat.

Parameters

TAgnDate aStartdate

The start date.


SetEndDate()

void SetEndDate(const TTime& aEndDate);

Description

Sets the end date for this repeat.

Parameters

const TTime& aEndDate

The end date (any time portion is ignored).


SetEndDate()

void SetEndDate(TAgnDate aEndDate);

Description

Sets the end date for this repeat.

Parameters

TAgnDate aEndDate

The end date.


ClearAll()

void ClearAll();

Description

Clears all the repeat details. The start and end dates are set to NULL values and the repeat interval to zero. The display next only and repeat forever flags are set to EFalse.


SetDisplayNextOnly()

void SetDisplayNextOnly(TBool aDisplayNextOnly);

Description

Sets the flag which is used to indicate whether views should display the next repeat instance only.

Parameters

TBool aDisplayNextOnly

True = display next only, False = do not display next only.


SetInterval()

void SetInterval(TUint aInterval);

Description

Sets the repeat interval. This is a number of days for a daily repeat, a number of weeks for a weekly repeat , etc.

Parameters

TUint aInterval

The interval.


SetRepeatForever()

void SetRepeatForever(TBool aRepeatForever);

Description

Sets the flag which indicates whether the repeat should continue forever.

Parameters

TBool aRepeatForever

True = set the repeat’s end date to the agenda model’s maximum date. False = do not repeat forever.

[Top]


Get repeat details


StartDate()

TTime StartDate() const;

Description

Returns the start date.

Return value

TTime

The start date.


StartDateAsAgnDate()

TAgnDate StartDateAsAgnDate() const;

Description

Returns the start date as an agenda date.

Return value

TAgnDate

The start date.


EndDate()

TTime EndDate() const;

Description

Returns the end date.

Return value

TTime

The end date.


EndDateAsAgnDate()

TAgnDate EndDateAsAgnDate() const;

Description

Returns the end date as an agenda date.

Return value

TAgnDate

The end date.


FindRptEndDate()

virtual TTime FindRptEndDate(TUint aCount) const=0;

Description

Pure virtual function. Implementations in derived classes should calculate the repeat end date from the number of instances.

Parameters

TUint aCount

The number of instances.

Return value

TTime

The end date.


InstanceCount()

virtual TUint InstanceCount() const=0;

Description

Pure virtual function. Implementations should return the number of instances generated by the repeat algorithm.

Return value

TUint

The number of instances.


Interval()

TInt Interval() const;

Description

Returns the repeat interval.

Return value

TInt

The interval.


DisplayNextOnly()

TBool DisplayNextOnly() const;

Description

Returns whether the display next only flag is set.

Return value

TBool

True if display is next only, otherwise False.


RepeatForever()

TBool RepeatForever() const;

Description

Returns whether the repeat forever flag is set.

Return value

TBool

True if repeat forever is set, otherwise False.

[Top]


Comparison


operator==()

TBool operator==(const TAgnRpt& aRpt) const;

Description

Compares two sets of common repeat details.

Parameters

const TAgnRpt& aRpt

The repeat details to compare with this object.

Return value

TBool

True if all five properties agree, otherwise False.

[Top]


Stream persistence


ExternalizeL()

virtual void ExternalizeL(RWriteStream& aStream) const;

Description

Externalises the repeat definition to a write stream.

Parameters

RWriteStream& aStream

The stream to which the object should be externalised.

Leave codes

 

The function leaves with EAgnBadErrorEntry if the repeat definition contains invalid or conflicting information, for instance if the start or end date is invalid.


InternalizeL()

virtual void InternalizeL(RReadStream& aStream);

Description

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

Parameters

RReadStream& aStream

The stream from which the object should be internalised.

Leave codes

 

The function leaves with KErrCorrupt if the repeat definition has an invalid type or if it has invalid information.