Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: agmentry.h
Link against: agnmodel.lib

Class CAgnTodo

CAgnTodo

Support

Supported from 5.0

Description

A to-do entry or instance. A to-do entry represents a task or an action to be carried out. It has no start or end date or time. It does have a display time, which allows it to be displayed in views that contain times of day, such as day or week views. Also, it may optionally have a start date (the first date on which it is displayed in day or week views) and either a due date (to indicate the date by which the action should be carried out) or a crossed out date (the date the action was carried out). An undated to-do entry does not have a due date, a crossed out date or a start date. To-do details include the ID of the to-do list to which the to-do belongs and a priority.

All functions which set or change to-do details also set the last changed date for synchronisation purposes.

Derivation

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

Defined in CAgnTodo:
BasicTodo(), CopyFromL(), CrossOut(), CrossedOutDate(), DisplayDueDateAs(), DisplayTime(), DueDate(), Duration(), EAutomatic, EDate, EDays, EDontDisplay, InstanceEndDate(), InstanceStartDate(), IsAlarmSetFromDueDate(), IsAlarmSetFromStartDate(), IsDated(), MakeUndated(), NewL(), NewLC(), Priority(), SetAlarmFromDueDate(), SetAlarmFromStartDate(), SetDisplayDueDateAs(), SetDisplayTime(), SetDueDate(), SetDuration(), SetPriority(), SetTodoListId(), TDisplayDueDateAs, TodoListId(), Type(), UnCrossOut()

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 CAgnEntry:
AddAttendeeL(), AddCategoryL(), AlarmSoundName(), AttendeeCount(), CastToAnniv(), CastToAppt(), CastToEvent(), CastToTodo(), CategoryCount(), ClearAlarm(), CloseEmbeddedStore(), CompareL(), CreationDate(), DeleteAttendee(), DeleteCategory(), EAnniv, EAppt, EDeepCopy, EEvent, EShallowCopy, ETodo, EmbeddedStore(), EntryId(), ExternalizeL(), FetchAttendee(), FetchCategory(), GetBackgroundColor(), HasAttendees(), HasCategory(), InstanceDate(), InstanceId(), 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()

Inherited from CBase:
operator new()


Construction


NewL()

static CAgnTodo* NewL(const CParaFormatLayer* aParaFormatLayer,const CCharFormatLayer* aCharFormatLayer,TCreateHow aCreateHow = ECreateRichText);

Description

Allocates memory for and constructs a new to-do entry. If allocation is successful, it returns a pointer to the new object. A leave occurs if there is insufficient memory available.

Parameters

const CParaFormatLayer* aParaFormatLayer

Pointer to the format layer on which the entry's rich text paragraph formatting is based.

const CCharFormatLayer* aCharFormatLayer

Pointer to the format layer on which the entry's rich text character formatting is based.

TCreateHow aCreateHow = ECreateRichText

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

Return value

CAgnTodo*

Pointer to the new to-do entry.


NewLC()

static CAgnTodo* NewLC(const CParaFormatLayer* aParaFormatLayer,const CCharFormatLayer* aCharFormatLayer,TCreateHow aCreateHow = ECreateRichText);

Description

Allocates memory for and constructs a new to-do entry. If allocation is successful, it returns a pointer to the new object which is left on the clean-up stack. A leave occurs if there is insufficient memory available.

Parameters

const CParaFormatLayer* aParaFormatLayer

Pointer to the format layer on which the entry's rich text paragraph formatting is based.

const CCharFormatLayer* aCharFormatLayer

Pointer to the format layer on which the entry's rich text character formatting is based.

TCreateHow aCreateHow = ECreateRichText

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

Return value

CAgnTodo*

Pointer to the new to-do entry.

[Top]


Date and duration information


CrossedOutDate()

TTime CrossedOutDate() const;

Description

Returns the to-do entry’s crossed out date, i.e. the date on which the action required by the to-do entry was carried out. If the entry has not been crossed out, this function returns a null value.

Return value

TTime

The to-do entry’s crossed out date.


CrossOut()

void CrossOut(const TTime& aDate);

Description

Sets the crossed out date for a to-do entry, i.e. the date on which the action required by the to-do entry was carried out. This function sets the entry's is crossed out property.

Parameters

const TTime& aDate

The to-do entry’s crossed out date.


UnCrossOut()

void UnCrossOut();

Description

Clears the crossed out date for a to-do entry as set by CrossOut(). This function unsets the entry's is crossed out property.


DueDate()

TTime DueDate() const;

Description

Returns the to-do entry’s due date as a TTime. Returns a null value if the due date has not been set.

Return value

TTime

The to-do entry’s due date.


SetDueDate()

void SetDueDate(const TTime& aDate);

Description

Sets the due date for a to-do entry. Because undated to-dos are possible, the due date can be set to a null value (Time::NullTTime()).

Parameters

const TTime& aDate

The to-do entry’s due date.


Duration()

TTimeIntervalDays Duration() const;

Description

Returns the to-do entry’s duration, i.e. the number of days between the start date and the due date. This function can be called on an entry if it is not repeating or on an individual instance if the entry is repeating. If the duration has not been set, this function returns zero.

Return value

TTimeIntervalDays

The to-do entry’s or instance’s duration.


SetDuration()

void SetDuration(TTimeIntervalDays aDuration);

Description

Set the to-do entry's duration, i.e. the number of days between the start date and the due date. This function can be called on an entry if it is not repeating or on an individual instance if the entry is repeating.

Parameters

TTimeIntervalDays aDuration

The to-do entry’s or instance’s duration.


InstanceStartDate()

virtual TTime InstanceStartDate() const;

Description

Returns the start date of an instance of the to-do, as set by SetInstanceDate() or SetIdAndInstanceDate(). If the instance date isn't set then the start date of the to-do entry is returned.

Return value

TTime

To-do instance’s start date. If the instance date isn’t set, then the to-do entry’s start date is returned.


InstanceEndDate()

virtual TTime InstanceEndDate() const;

Description

Returns the end date of an instance of the to-do as set by SetInstanceDate() or SetIdAndInstanceDate(). If the instance date isn't set then the to-do entry’s due date (and not of one of its instances) is returned.

Return value

TTime

To-do instance’s end date. If the instance date isn’t set, then the to-do entry’s due date is returned.


IsDated()

TBool IsDated() const;

Description

Retrieves whether the entry’s due date has been set.

Return value

TBool

ETrue if the to-do entry has a due date which is not null, EFalse if not.


MakeUndated()

void MakeUndated();

Description

Makes the to-do entry undated, thus clearing most of its fields. This function sets the due date and crossed out date to null, the duration to zero and clears any alarm and repeat details.

[Top]


Display information


DisplayTime()

virtual TTimeIntervalMinutes DisplayTime() const;

Description

Returns the to-do entry’s display time. This value is set by SetDisplayTime(). It is typically used in views as follows. If the to-do entry is NOT crossed out, it is displayed at the display time on the start date, and the due date (or the time remaining before the due date) is shown in brackets at the end of the entry. If the to-do entry IS crossed out, it is displayed at the display time on the crossed out date (if crossed out entries are displayed in the view), and it no longer has a due date.

Return value

TTimeIntervalMinutes

The to-do entry’s display time, in views other than the to-do view, in minutes from midnight at the beginning of the start date, (between zero and 1439 inclusive).


SetDisplayTime()

void SetDisplayTime(TTimeIntervalMinutes aDisplayTime);

Description

Sets the to-do entry’s display time. A to-do entry's display time is typically used in views as follows. If the to-do is not crossed out, it is displayed at the display time on the start date, and the due date (or the time remaining before the due date) is shown in brackets at the end of the entry. If the to-do entry IS crossed out, it is displayed at the display time on the crossed out date (if crossed out entries are displayed in the view), and it no longer has a due date.

This function clears the to-do entry’s has default display time property.

Parameters

TTimeIntervalMinutes aDisplayTime

The to-do entry’s display time, in views other than the to-do view, in minutes from midnight at the beginning of the start date. This value must be between zero and 1439 inclusive, otherwise a panic is raised.


DisplayDueDateAs()

TDisplayDueDateAs DisplayDueDateAs() const;

Description

Returns how the to-do entry’s due date should be displayed, as set by SetDisplayDueDateAs(). By default, the due date is displayed as EAutomatic.

Return value

TDisplayDueDateAs

Indicates how the due date should be displayed.


SetDisplayDueDateAs()

void SetDisplayDueDateAs(TDisplayDueDateAs aDisplayAs);

Description

Sets the display mode of the to-do entry’s due date.

Parameters

TDisplayDueDateAs aDisplayAs

Display mode of to-do entry’s due date.

[Top]


Priority information


Priority()

TUint Priority() const;

Description

Returns the priority of a to-do entry as set by SetPriority(). The default value is zero.

Return value

TUint

The priority of the to-do entry.


SetPriority()

void SetPriority(TUint aPriority);

Description

Sets the priority for a to-do entry.

Parameters

TUint aPriority

The priority of the to-do entry.

[Top]


To-do entry specific details


BasicTodo()

const TAgnBasicTodo& BasicTodo() const;

Description

Returns the entry details specific to the to-do entry, e.g. the due and crossed out dates and the display time. Note that these details should normally be set and retrieved using other functions in this class.

Return value

TAgnBasicTodo&

The to-do specific entry details.

[Top]


To-do list ID


TodoListId()

TAgnTodoListId TodoListId() const;

Description

Returns the ID of the to-do list to which the to-do entry belongs, as set by SetTodoListId().

Return value

TAgnTodoListId

Identifies the to-do list to which the entry belongs.


SetTodoListId()

void SetTodoListId(TAgnTodoListId aTodoListId);

Description

Sets the ID of the to-do list to which the to-do entry belongs. All to-do entries must belong to a to-do list.

Parameters

TAgnTodoListId aTodoListId

Identifies the to-do list to which the entry belongs.

[Top]


Entry type


Type()

virtual TType Type() const;

Description

Returns the type of entry as a to-do. Used after retrieving an entry or instance of an unknown type into a CAgnEntry. You then have to cast the entry to its proper type in order to use the functions provided by the concrete class. Functions provided by CAgnEntry can be used without casting the entry.

Return value

TType

The entry type (ETodo).

[Top]


Copy


CopyFromL()

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

Description

Copies the to-do entry and general entry details from aSource into this object  — any previous contents are lost.

Parameters

CAgnEntry* aSource

Pointer to an agenda entry object containing details common to all entries and optionally those specific to to-do entries.

const MPictureFactory* aPictureFactory

Pointer to a picture header factory. This argument only needs to be specified if the source entry contains embedded pictures.

[Top]


Alarm information


IsAlarmSetFromDueDate()

TBool IsAlarmSetFromDueDate() const;

Description

Retrieves whether the alarm date is set relative to the entry’s due date as set by SetAlarmFromDueDate(). By default, the alarm is set relative to the due date.

Return value

TBool

ETrue if an alarm has been set from the to-do entry’s due date, EFalse if not.


SetAlarmFromDueDate()

void SetAlarmFromDueDate();

Description

Sets the alarm date to be a number of days relative to the to-do entry’s due date, rather than from its start date. This function should be called after calling CAgnBasicEntry::SetAlarm().


IsAlarmSetFromStartDate()

TBool IsAlarmSetFromStartDate() const;

Description

Retrieves whether the alarm date is set relative to the entry’s start date as set by SetAlarmFromStartDate(). By default, the alarm is set relative to the due date.

Return value

TBool

ETrue if an alarm has been set from the to-do entry’s start date, EFalse if not.


SetAlarmFromStartDate()

void SetAlarmFromStartDate();

Description

Sets the alarm date to be a number of days from the to-do entry’s start date rather than its due date. This function should be called after calling CAgnBasicEntry::SetAlarm().

[Top]


Enumerations


Enum TDisplayDueDateAs

TDisplayDueDateAs

Description

Due date display mode

EAutomatic

Display the due date as a date. When the current date is within one week of the due date, then display due date using the format "Next Wed".

EDate

Always display the due date as a date.

EDays

Display the due date as the number of days between the current date and the due date.

EDontDisplay

Never display the due date.