Location:
agmentry.h
Link against: agnmodel.lib
CAgnEntry
Supported from 5.0
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.
|
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()
virtual void CopyFromL(CAgnEntry* aSource,const MPictureFactory* aPictureFactory,TCopyHow aCopyHow)=0;
Requirements:
An implementation of this function should copy the entry
details from aSource
into this object.
|
virtual void CopyFromL(CAgnEntry* aSource,const MPictureFactory* aPictureFactory)=0;
Requirements:
An implementation of this function should copy the entry details
from aSource
into this object.
|
virtual TTime InstanceStartDate() const=0;
Requirements:
An implementation of this function should return the start date/time of an instance of the entry.
|
virtual TTime InstanceEndDate() const=0;
Requirements:
An implementation of this function should return the end date/time of an instance of the entry.
|
virtual TTimeIntervalMinutes DisplayTime() const=0;
Requirements:
An implementation of this function should return the entry's display time.
|
~CAgnEntry();
The destructor frees all resources owned by the entry, prior to its destruction.
const CAgnAnniv* CastToAnniv() const;
CAgnAnniv* CastToAnniv();
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.
|
const CAgnAppt* CastToAppt() const;
CAgnAppt* CastToAppt();
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.
|
const CAgnEvent* CastToEvent() const;
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.
|
const CAgnTodo* CastToTodo() const;
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.
|
void ClearAlarm();
Removes the alarm from an entry. Any alarm sound name which has been set
using SetAlarmSoundNameL()
is deleted.
TPtrC AlarmSoundName() const;
Returns the name of the alarm sound as set
bySetAlarmSoundName()
, or null if the entry isn't
alarmed.
|
void SetAlarmSoundNameL(const TDesC& aAlarmSoundName);
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.
|
virtual void SetLastChangedDate();
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.
TAgnUniqueId UniqueId() const;
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.
|
void SetUniqueId(TAgnUniqueId aUId);
Sets the entry’s unique ID.
|
const TAgnReplicationData& ReplicationData() const;
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.
|
void SetReplicationData(const TAgnReplicationData& aReplicationData);
Sets the entry’s replication data.
|
TStreamId StoreComponentsL(CStreamStore& aStore);
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.
|
|
void RestoreComponentsL(const CStreamStore& aStore);
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).
|
void ExternalizeL(RWriteStream& aStream)const;
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.
|
void InternalizeL(RReadStream& aStream);
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.
|
CStreamStore* OpenRichTextStoreL();
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.
|
CStreamStore* OpenEmbeddedStoreL();
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.
|
void CloseEmbeddedStore();
Deletes the embedded store. If the agenda model is in client mode, just sets the store to NULL.
CStreamStore* EmbeddedStore() const;
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.
|
void LoadAllComponentsL(const MPictureFactory* aPictureFactory);
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.
|
void SetRichTextStreamId(TStreamId aId);
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.
|
TStreamId RichTextStreamId() const;
Retrieves the ID for the embedded stream store in which the entry’s rich text has been stored.
|
TAgnDate InstanceDate() const;
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()
).
|
void SetInstanceDate(TAgnDate aDate);
Sets the instance date.
|
TAgnEntryId EntryId() const;
Retrieves the entry’s ID.
|
void SetId(TAgnEntryId aId);
Sets the entry ID.
|
TAgnInstanceId InstanceId() const;
Retrieves the instance ID.
|
void SetIdAndInstanceDate(TAgnEntryId aId,TAgnDate aDate);
Sets the entry ID and the instance date. Together these two details make up the instance ID.
|
void SetIdAndInstanceDate(const TAgnInstanceId& aInstanceId);
Sets the instance ID.
|
void SetInstanceId(const TAgnInstanceId& aInstanceId);
Sets the instance ID.
|
void SetRptDefL(const CAgnRptDef* aRptDef);
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.
|
void MakeInstanceNonRepeating();
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.
CRichText* RichTextL();
Returns a pointer to the rich text owned by the entry.
|
TBool CompareL(CAgnEntry* aEntry,TIncludeIdWhenComparing aCompareId);
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.
|
|
TPtrC Location();
Retrieves the contents of the entry’s location field.
|
void SetLocationL(const TDesC& aLocation);
Sets the contents of the entry’s location field. Sets the entry's has extended property.
|
TBool HasAttendees();
Returns true if one or more attendees have been added to the entry, false if not.
|
TInt AttendeeCount();
Retrieves the number of attendees that have been added to the entry.
|
CAgnAttendee* FetchAttendee(TInt aIndex);
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.
|
|
void AddAttendeeL(CAgnAttendee* aAttendee);
Appends an attendee to the entry’s list of attendees.
|
void DeleteAttendee(TInt aIndex);
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.
|
TBool HasCategory();
Supported from 6.0
Returns a Boolean to indicate whether the entry has any categories.
|
TInt CategoryCount();
Supported from 6.0
Returns the number of categories owned by the entry.
|
void AddCategoryL(CAgnCategory* aCategory);
Supported from 6.0
Appends a category to the entry's list of categories. The entry takes ownership of the category specified.
|
CAgnCategory* FetchCategory(TInt aIndex);
Supported from 6.0
Fetches the category at aIndex
.
|
|
void DeleteCategory(TInt aIndex);
Supported from 6.0
Deletes the category at aIndex
.
|
void SetBackgroundColorL(const TRgb& aColor);
Supported from 6.0
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.
|
TRgb GetBackgroundColor();
Supported from 6.0
Returns the background colour for the agenda entry's symbol, as set
bySetBackgroundColorL()
.
|
void SetCreationDateL(TAgnDate aCreationDate);
Sets the entry’s creation date. This corresponds to the DCREATED property in the vCalendar standard.
|
TAgnDate CreationDate();
Retrieves the entry’s creation date (as set
bySetCreationDateL()
), or the last modified date if no creation
date has been set.
|
TType
Agenda entry type
|
TCopyHow
How entry's rich text object should be copied
|