Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: agmentry.h
Link against: agnmodel.lib

Class CAgnEntry

CAgnEntry

Support

Supported from 5.0

Description

Abstract base class for the concrete agenda entry classes. It is derived from CAgnBasicEntry which provides alarm and repeat information and entry attributes. CAgnEntry adds other common entry information including entry IDs, persistence and synchronisation information.

Synchronisation information includes a record of the date/time the entry was last modified  — the last changed date/time. Most agenda entry functions which change an entry’s details or attributes call the SetLastChangedDate() function.

Agenda entries are identified by an entry ID. Instances are identified by an instance ID, which consists of an entry ID and a date. IDs are used so that lists of entries can be efficiently processed and passed as function arguments and return values.

This class also provides casting functions. An entry or instance is retrieved into a CAgnEntry because its type is not yet known. To find the type of a retrieved entry or instance, use CAgnEntry::Type(), which is implemented by each concrete entry class. The return value is one of EAnniv, EAppt, EEvent or ETodo. Then use CastToAnniv(), CastToAppt(), CastToEvent() or CastToTodo() respectively to cast the entry or instance to a pointer to the appropriate class.

Derivation

CAgnBasicEntryAbstract base class for the entry classes CAgnAppt, CAgnTodo, CAgnEvent and CAgnAnniv
CAgnEntryAbstract base class for the concrete agenda entry classes
CBaseBase class for all classes to be instantiated on the heap

Defined in CAgnEntry:
AddAttendeeL(), AddCategoryL(), AlarmSoundName(), AttendeeCount(), CastToAnniv(), CastToAppt(), CastToEvent(), CastToTodo(), CategoryCount(), ClearAlarm(), CloseEmbeddedStore(), CompareL(), CopyFromL(), CreationDate(), DeleteAttendee(), DeleteCategory(), DisplayTime(), EAnniv, EAppt, EDeepCopy, EEvent, EShallowCopy, ETodo, EmbeddedStore(), EntryId(), ExternalizeL(), FetchAttendee(), FetchCategory(), GetBackgroundColor(), HasAttendees(), HasCategory(), InstanceDate(), InstanceEndDate(), InstanceId(), InstanceStartDate(), InternalizeL(), LoadAllComponentsL(), Location(), MakeInstanceNonRepeating(), OpenEmbeddedStoreL(), OpenRichTextStoreL(), ReplicationData(), RestoreComponentsL(), RichTextL(), RichTextStreamId(), SetAlarmSoundNameL(), SetBackgroundColorL(), SetCreationDateL(), SetId(), SetIdAndInstanceDate(), SetInstanceDate(), SetInstanceId(), SetLastChangedDate(), SetLocationL(), SetReplicationData(), SetRichTextStreamId(), SetRptDefL(), SetUniqueId(), StoreComponentsL(), TCopyHow, TType, UniqueId(), ~CAgnEntry()

Inherited from CAgnBasicEntry:
AddExceptionL(), AlarmDaysWarning(), AlarmInstanceDateTime(), AlarmTime(), ClearAllAttributes(), ClearRepeat(), DisplayInYearView(), EntrySymbol(), Exceptions(), FindException(), HasAlarm(), HasDefaultDisplayTime(), HasEntrySymbol(), HasExceptions(), HasExtended(), IsADayNote(), IsCrossedOut(), IsRepeating(), IsSketch(), IsStoredInline(), IsTentative(), PruneExceptions(), RemoveAllExceptions(), RemoveException(), RptDef(), SetAlarm(), SetDisplayInYearView(), SetEntrySymbol(), SetHasAlarm(), SetHasDefaultDisplayTime(), SetHasEntrySymbol(), SetHasExceptions(), SetHasExtended(), SetIsADayNote(), SetIsCrossedOut(), SetIsRepeating(), SetIsSketch(), SetIsStoredInline(), SetIsTentative(), SetRptEndDate(), SetRptStartDate()

Inherited from CBase:
operator new()


Pure virtual functions


CopyFromL()

virtual void CopyFromL(CAgnEntry* aSource,const MPictureFactory* aPictureFactory,TCopyHow aCopyHow)=0;

Description

Requirements:

An implementation of this function should copy the entry details from aSource into this object.

Parameters

CAgnEntry* aSource

Pointer to an agenda entry object to copy.

const MPictureFactory* aPictureFactory

Pointer to a picture header factory.

TCopyHow aCopyHow

Specifies whether the copy should be deep (EDeepCopy) or shallow (EShallowCopy).


CopyFromL()

virtual void CopyFromL(CAgnEntry* aSource,const MPictureFactory* aPictureFactory)=0;

Description

Requirements:

An implementation of this function should copy the entry details from aSource into this object.

Parameters

CAgnEntry* aSource

Pointer to an agenda entry object to copy.

const MPictureFactory* aPictureFactory

Pointer to a picture header factory.


InstanceStartDate()

virtual TTime InstanceStartDate() const=0;

Description

Requirements:

An implementation of this function should return the start date/time of an instance of the entry.

Return value

TTime

The instance’s start date/time.


InstanceEndDate()

virtual TTime InstanceEndDate() const=0;

Description

Requirements:

An implementation of this function should return the end date/time of an instance of the entry.

Return value

TTime

The instance’s end date/time.


DisplayTime()

virtual TTimeIntervalMinutes DisplayTime() const=0;

Description

Requirements:

An implementation of this function should return the entry's display time.

Return value

TTimeIntervalMinutes

The entry’s display time. If the entry is timed, this will be the same as its start time.

[Top]


Destructor


~CAgnEntry()

~CAgnEntry();

Description

The destructor frees all resources owned by the entry, prior to its destruction.

[Top]


Casting


CastToAnniv()

const CAgnAnniv* CastToAnniv() const;
CAgnAnniv* CastToAnniv();

Description

Casts an entry or instance to a CAgnAnniv* in order to use the functions provided by the CAgnAnniv class. The entry must be of type CAgnAnniv or a panic occurs.

Two versions of the function are supplied. The compiler chooses the appropriate version based on the use made of the returned pointer. If the returned pointer is used in an expression where that pointer can be modified, then the non-const version is chosen.

Return value

const CAgnAnniv*

A const pointer to an anniversary entry.

CAgnAnniv*

A non-const pointer to an anniversary entry.


CastToAppt()

const CAgnAppt* CastToAppt() const;
CAgnAppt* CastToAppt();

Description

Casts an entry or instance to a CAgnAppt* in order to use the functions provided by the CAgnAppt class. The entry must be of type CAgnAppt or a panic occurs.

Two versions of the function are supplied. The compiler chooses the appropriate version based on the use made of the returned pointer. If the returned pointer is used in an expression where that pointer can be modified, then the non-const version is chosen.

Return value

const CAgnAppt*

A const pointer to an appointment entry.

CAgnAppt*

A non-const pointer to an appointment entry.


CastToEvent()

const CAgnEvent* CastToEvent() const;

Description

Casts an entry or instance to a CAgnEvent* in order to use the functions provided by the CAgnEvent class. The entry must be of type CAgnEvent or a panic occurs.

Two versions of the function are supplied. The compiler chooses the appropriate version based on the use made of the returned pointer. If the returned pointer is used in an expression where that pointer can be modified, then the non-const version is chosen.

Return value

const CAgnEvent*

A const pointer to an event entry.

CAgnEvent*

A non-const pointer to an even entry.


CastToTodo()

const CAgnTodo* CastToTodo() const;

Description

Casts an entry or instance to a CAgnTodo* in order to use the functions provided by the CAgnTodo class. The entry must be of type CAgnTodo or a panic will occur.

Two versions of the function are supplied. The compiler chooses the appropriate version based on the use made of the returned pointer. If the returned pointer is used in an expression where that pointer can be modified, then the non-const version is chosen.

Return value

const CAgnTodo*

A const pointer to a to-do entry.

CAgnTodo*

A non-const pointer to a to-do entry.

[Top]


Alarm information


ClearAlarm()

void ClearAlarm();

Description

Removes the alarm from an entry. Any alarm sound name which has been set using SetAlarmSoundNameL() is deleted.


AlarmSoundName()

TPtrC AlarmSoundName() const;

Description

Returns the name of the alarm sound as set bySetAlarmSoundName(), or null if the entry isn't alarmed.

Return value

TPtrC

The current name of the alarm sound.


SetAlarmSoundNameL()

void SetAlarmSoundNameL(const TDesC& aAlarmSoundName);

Description

Sets the name of the alarm sound.

Note

If the length of the new alarm sound name is greater thanKMaxAlarmSoundName (=32) characters, it will be truncated toKMaxAlarmSoundName characters.

Parameters

const TDesC& aAlarmSoundName

Const reference to the name of the alarm sound.

[Top]


Synchronisation information


SetLastChangedDate()

virtual void SetLastChangedDate();

Description

Sets the entry’s last changed date/time to the current universal time. This date/time is used when the agenda is synchronised with other systems, to check whether any changes have taken place since the last synchronisation. Most functions which change an entry's details or attributes call this function.


UniqueId()

TAgnUniqueId UniqueId() const;

Description

Retrieves the entry’s unique ID. The unique ID uniquely identifies the agenda entry in an agenda file. This value is assigned when the entry is created, and is preserved during updates. Because of this, it can be used to identify the entry during synchronisation.

Return value

TAgnUniqueId

The entry’s unique ID.


SetUniqueId()

void SetUniqueId(TAgnUniqueId aUId);

Description

Sets the entry’s unique ID.

Parameters

TAgnUniqueId aUId

The entry’s unique ID.


ReplicationData()

const TAgnReplicationData& ReplicationData() const;

Description

Retrieves the entry’s replication data as set bySetReplicationData().

Two versions of the function are supplied. The compiler chooses the appropriate version based on the use made of the returned pointer. If the returned pointer is used in an expression where that pointer can be modified, then the non-const version is chosen.

Return value

const TAgnReplicationData&

A const reference to the entry’s replication data.

TAgnReplicationData&

A non-const reference to the entry’s replication data.


SetReplicationData()

void SetReplicationData(const TAgnReplicationData& aReplicationData);

Description

Sets the entry’s replication data.

Parameters

const TAgnReplicationData& aReplicationData

A reference to the entry’s replication data.

[Top]


Persistence


StoreComponentsL()

TStreamId StoreComponentsL(CStreamStore& aStore);

Description

Stores the entry’s rich text object to an embedded store — only necessary if the entry's rich text object is stored out of line.

Parameters

CStreamStore& aStore

A reference to the stream store which contains the entry and the embedded store for the entry's rich text.

Return value

TStreamId

The ID for the embedded store in which the entry’s rich text is stored.


RestoreComponentsL()

void RestoreComponentsL(const CStreamStore& aStore);

Description

Restores the entry's rich text object from an embedded store (only necessary if the entry's rich text object is stored out of line).

Parameters

const CStreamStore& aStore

A reference to the stream store which contains the entry and the embedded store for the entry's rich text.


ExternalizeL()

void ExternalizeL(RWriteStream& aStream)const;

Description

Externalises an entry's details and attributes, but not its rich text to a write stream. The presence of this function means that the standard templatedoperator<<() (defined in s32strm.h) is available to externalise objects of this class.

Parameters

RWriteStream& aStream

Stream to which the object should be externalised.


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises an entry's details and attributes, but not its rich text from a read stream. The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.

Parameters

RReadStream& aStream

Stream from which the object should be internalised.


OpenRichTextStoreL()

CStreamStore* OpenRichTextStoreL();

Description

If the entry's rich text is stored out of line, this function opens and returns a pointer to the embedded store in which the entry’s rich text object is stored.

Note

Out of line means that the entry's rich text object is stored in an embedded store in the entry's stream. An agenda entry is set to be stored out of line if its rich text object is large.

Return value

CStreamStore*

Pointer to the stream store from which the entry's rich text object can be restored.


OpenEmbeddedStoreL()

CStreamStore* OpenEmbeddedStoreL();

Description

If the entry's rich text is stored out of line, this function opens and returns a pointer to the embedded store in which the entry’s rich text object is stored. If the agenda model is in client mode, this function uses the server.

Return value

CStreamStore*

Pointer to the stream store from which the entry's rich text object can be restored.


CloseEmbeddedStore()

void CloseEmbeddedStore();

Description

Deletes the embedded store. If the agenda model is in client mode, just sets the store to NULL.


EmbeddedStore()

CStreamStore* EmbeddedStore() const;

Description

If the entry's rich text object is stored out of line, returns a pointer to the embedded store in which the entry’s rich text is stored.

Return value

CStreamStore*

Pointer to the embedded store which contains the entry's rich text.


LoadAllComponentsL()

void LoadAllComponentsL(const MPictureFactory* aPictureFactory);

Description

Loads all of an entry's components, e.g. rich text stored out of line. This function would be called when you need to load the entry's rich text from file to memory, e.g. when an entry is placed on the clipboard.

Parameters

const MPictureFactory* aPictureFactory

Pointer to a picture header factory.


SetRichTextStreamId()

void SetRichTextStreamId(TStreamId aId);

Description

For a rich text object which is stored out of line, this function sets the ID for the embedded stream store in which the object has been stored.

Parameters

TStreamId aId

The ID for the stream store in which the entry’s rich text object has been stored.


RichTextStreamId()

TStreamId RichTextStreamId() const;

Description

Retrieves the ID for the embedded stream store in which the entry’s rich text has been stored.

Return value

TStreamId

The ID for the stream store in which the entry’s rich text has been stored.

[Top]


ID information


InstanceDate()

TAgnDate InstanceDate() const;

Description

Retrieves the instance date. The instance’s entry ID (TAgnEntryId) together with the instance date (TAgnDate) make up the instance ID (TAgnInstanceId). These two components of the instance ID can be retrieved individually or together.

By default, the instance date for all entries is NULL (AgnDateTime::NullDate()).

Return value

TAgnDate

The instance date.


SetInstanceDate()

void SetInstanceDate(TAgnDate aDate);

Description

Sets the instance date.

Parameters

TAgnDate aDate

The instance date.


EntryId()

TAgnEntryId EntryId() const;

Description

Retrieves the entry’s ID.

Return value

TAgnEntryId

Uniquely identifies an entry, but for an instance, you also need to consider the instance date.


SetId()

void SetId(TAgnEntryId aId);

Description

Sets the entry ID.

Parameters

TAgnEntryId aId

The ID to assign to the entry.


InstanceId()

TAgnInstanceId InstanceId() const;

Description

Retrieves the instance ID.

Return value

TAgnInstanceId

The instance ID (the entry ID plus the instance date).


SetIdAndInstanceDate()

void SetIdAndInstanceDate(TAgnEntryId aId,TAgnDate aDate);

Description

Sets the entry ID and the instance date. Together these two details make up the instance ID.

Parameters

TAgnEntryId aId

Uniquely identifies an entry.

TAgnDate aDate

The instance date.


SetIdAndInstanceDate()

void SetIdAndInstanceDate(const TAgnInstanceId& aInstanceId);

Description

Sets the instance ID.

Parameters

const TAgnInstanceId& aInstanceId

The instance ID, which is the entry ID plus the instance date.


SetInstanceId()

void SetInstanceId(const TAgnInstanceId& aInstanceId);

Description

Sets the instance ID.

Parameters

const TAgnInstanceId& aInstanceId

Const reference to the instance ID, which is the entry ID plus the instance date.

[Top]


Repeat information


SetRptDefL()

void SetRptDefL(const CAgnRptDef* aRptDef);

Description

Sets the entry’s repeat definition. The repeat definition includes daily, weekly, monthly and yearly repeat details, display details, start and end details and exceptions. For non-to-do entries the start date/time is set to the start date/time of the repeat, and the end date/time is set correspondingly. For to-do entries the due date is set. For day notes, the display date/time is set.

Parameters

const CAgnRptDef* aRptDef

Pointer to the new repeat definition.


MakeInstanceNonRepeating()

void MakeInstanceNonRepeating();

Description

Converts an instance of a repeating entry into a non-repeating entry. The entry's start and end date/times (or due date for a to-do entry) are set according to the instance's start and end date. If the entry is a day note, its display date/time is set according to the instance start date/time. If the entry is a to-do, its due date is set according to the instance end date.

[Top]


Text content


RichTextL()

CRichText* RichTextL();

Description

Returns a pointer to the rich text owned by the entry.

Return value

CRichText*

Pointer to the rich text object.

[Top]


Comparison


CompareL()

TBool CompareL(CAgnEntry* aEntry,TIncludeIdWhenComparing aCompareId);

Description

Compares the entry aEntry with this entry and returns true if they are equal, false if not. The entries’ instance IDs and unique IDs are also compared.

The function casts the entry to its respective type usingCastToAppt(), CastToAnniv(),CastToEvent()orCastToTodo()as appropriate.

Parameters

CAgnEntry* aEntry

Pointer to an agenda entry.

TIncludeIdWhenComparing aCompareId

This argument is used internally, for test purposes only. As it has a default value, it should be ignored by developers.

Return value

TBool

ETrue if aEntry is the same as this entry,EFalse if not. Note. Replication data is not included in the comparison, except for the replication status.

[Top]


Location


Location()

TPtrC Location();

Description

Retrieves the contents of the entry’s location field.

Return value

TPtrC

The location. NULL if the entry has no location field.


SetLocationL()

void SetLocationL(const TDesC& aLocation);

Description

Sets the contents of the entry’s location field. Sets the entry's has extended property.

Parameters

const TDesC& aLocation

Descriptor containing a location, e.g. of a meeting.

[Top]


Attendee details


HasAttendees()

TBool HasAttendees();

Description

Returns true if one or more attendees have been added to the entry, false if not.

Return value

TBool

ETrue if one or more attendees have been added to the entry,EFalse if not.


AttendeeCount()

TInt AttendeeCount();

Description

Retrieves the number of attendees that have been added to the entry.

Return value

TInt

Number of attendees added.


FetchAttendee()

CAgnAttendee* FetchAttendee(TInt aIndex);

Description

Retrieves the attendee at the specified index within the entry’s list of attendees. Make sure that you specify a valid index (between zero andAttendeeCount() – 1), otherwise a panic occurs.

Parameters

TInt aIndex

Index to identify the specified attendee.

Return value

CAgnAttendee*

Pointer to the object containing attendee details.


AddAttendeeL()

void AddAttendeeL(CAgnAttendee* aAttendee);

Description

Appends an attendee to the entry’s list of attendees.

Parameters

CAgnAttendee* aAttendee

Pointer to the object containing attendee details.


DeleteAttendee()

void DeleteAttendee(TInt aIndex);

Description

Deletes the attendee at the index specified from the entry’s list of attendees. If there is no attendee at the index specified, a panic will occur.

Parameters

TInt aIndex

Index to identify the specified attendee.

[Top]


Categories


HasCategory()

TBool HasCategory();

Support

Supported from 6.0

Description

Returns a Boolean to indicate whether the entry has any categories.

Return value

TBool

ETrue if it has any categories, EFalse if not.


CategoryCount()

TInt CategoryCount();

Support

Supported from 6.0

Description

Returns the number of categories owned by the entry.

Return value

TInt

The number of categories.


AddCategoryL()

void AddCategoryL(CAgnCategory* aCategory);

Support

Supported from 6.0

Description

Appends a category to the entry's list of categories. The entry takes ownership of the category specified.

Parameters

CAgnCategory* aCategory

The category to be added.


FetchCategory()

CAgnCategory* FetchCategory(TInt aIndex);

Support

Supported from 6.0

Description

Fetches the category at aIndex.

Parameters

TInt aIndex

Index into the entry's list of categories. Must be a valid array index or a panic occurs.

Return value

CAgnCategory*

Pointer to the category located at the index specified.


DeleteCategory()

void DeleteCategory(TInt aIndex);

Support

Supported from 6.0

Description

Deletes the category at aIndex.

Parameters

TInt aIndex

Index into the entry's list of categories. Must be a valid array index or a panic occurs.

[Top]


Colour


SetBackgroundColorL()

void SetBackgroundColorL(const TRgb& aColor);

Support

Supported from 6.0

Description

Sets the background colour for the agenda entry's symbol.

Note

The entry symbol's background colour is used by the entry model when populating a symbol list (CAgnEntryModel::GetSymbolInstanceListL()). It is used as the background colour for the first symbol in each list item.

Parameters

const TRgb& aColor

The background colour for the agenda entry's symbol.

See also:


GetBackgroundColor()

TRgb GetBackgroundColor();

Support

Supported from 6.0

Description

Returns the background colour for the agenda entry's symbol, as set bySetBackgroundColorL().

Return value

TRgb

The background colour for the agenda entry's symbol.

[Top]


Creation date


SetCreationDateL()

void SetCreationDateL(TAgnDate aCreationDate);

Description

Sets the entry’s creation date. This corresponds to the DCREATED property in the vCalendar standard.

Parameters

TAgnDate aCreationDate

The entry’s creation date.


CreationDate()

TAgnDate CreationDate();

Description

Retrieves the entry’s creation date (as set bySetCreationDateL()), or the last modified date if no creation date has been set.

Return value

TAgnDate

The entry’s creation date, or the last modified date if no creation date has been set.

[Top]


Enumerations


Enum TType

TType

Description

Agenda entry type

EAppt

Appointment entry type.

ETodo

To-do entry type.

EEvent

Event entry type.

EAnniv

Anniversary entry type.


Enum TCopyHow

TCopyHow

Description

How entry's rich text object should be copied

EShallowCopy

When copying an agenda entry, indicates that the source entry's rich text object is large, and so is stored out of line. In this case, the copy only needs to copy the stream ID of the rich text object stored in the source.

EDeepCopy

When copying an agenda entry, indicates that the source entry's rich text object is stored inline, so that the copy needs to create a new stream and copy the rich text object into it.