Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: agmlists.h
Link against: agnmodel.lib

Class CAgnSymbolList

CAgnSymbolList

Support

Supported from 5.0

Description

A list of the days in a month which have entry symbols.

Each list item consists of the day number (0 to 30) and either one or two entry symbols for that day. A list item can hold a maximum of two symbols — if a day has more than two entry symbols, only the first two symbols are used. If a day does not have any symbols, there is no list entry for it. If a month does not have any symbols, there is no list. The list also stores the month and year of interest. You can iterate through the list using NextDay() or PreviousDay(). The list is populated using CAgnEntryModel::GetSymbolInstanceList() or CAgnModel::PopulateSymbolInstanceListL().

Derivation

CAgnSymbolListA list of the days in a month which have entry symbols
CBaseBase class for all classes to be instantiated on the heap

Defined in CAgnSymbolList:
Count(), DayNumber(), FirstSymbol(), Month(), MoreSymbols(), NewL(), NextDay(), NumSymbols(), NumSymbolsForDay(), PreviousDay(), SecondSymbol(), SetIteratorToStart(), SetMonth(), SetYear(), SetYearAndMonth(), TListItem, Year(), operator[](), ~CAgnSymbolList()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CAgnSymbolList* NewL(TTimeIntervalYears aYear,TMonth aMonth);

Description

Allocates and constructs a new symbol list with the specified month and year. The list iterator is set to the start of the list.

Parameters

TTimeIntervalYears aYear

The year.

TMonth aMonth

The month.

Return value

CAgnSymbolList*

Pointer to the newly created list.


~CAgnSymbolList()

virtual ~CAgnSymbolList();

Description

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

[Top]


Iteration


SetIteratorToStart()

void SetIteratorToStart();

Description

Sets the list iterator to the first item in the list (the first symbol on the first day). This function is called during construction.


NextDay()

TBool NextDay(TUint& aDayNum);

Description

Gets the day number of the next list item (if there is one) and returns True, otherwise returns False. If the iterator is positioned on the first symbol of the day and there is a second symbol for the day, then gets the day number of that day and the iterator moves to the second symbol.

Parameters

TUint& aDayNum

On return, the day number.

Return value

TBool

True if there is a next day or if the iterator moves to a second symbol on the same day, otherwise False. False is also returned if the list is empty.


PreviousDay()

TBool PreviousDay(TUint& aDayNum);

Description

Moves backwards through the list and gets the day number of the previous list item (if there is one) and returns True, otherwise returns False. If the iterator is positioned on the second symbol of the day, then the day number returned is of that day and the iterator moves to the first symbol. If the previous day has two symbols, the iterator is moved to the second symbol, otherwise the iterator is moved to the first symbol.

Parameters

TUint& aDayNum

On return, the day number.

Return value

TBool

True if there is a previous day or if the iterator moves to the first symbol on the same day, otherwise False. False is also returned if the list is empty.

[Top]


Set list details


SetMonth()

void SetMonth(TMonth aMonth);

Description

Sets the month for the list.

Parameters

TMonth aMonth

The month.


SetYear()

void SetYear(TTimeIntervalYears aYear);

Description

Sets the year for the list.

Parameters

TTimeIntervalYears aYear

The year.


SetYearAndMonth()

void SetYearAndMonth(TTimeIntervalYears aYear,TMonth aMonth);

Description

Sets the year and the month for the list.

Parameters

TTimeIntervalYears aYear

The year.

TMonth aMonth

The month.

[Top]


Get list details


Count()

TInt Count() const;

Description

Returns the number of items in the list.

Return value

TInt

The number of items in the list.


DayNumber()

TUint DayNumber(TInt aIndex) const;

Description

Returns the day number for the indexed list item.

Parameters

TInt aIndex

The index.

Return value

TUint

The day number for the indexed list item.


Month()

TMonth Month() const;

Description

Gets the month.

Return value

TMonth

The month.


Year()

TTimeIntervalYears Year() const;

Description

Gets the year.

Return value

TTimeIntervalYears

The year.


FirstSymbol()

TChar FirstSymbol(TInt aIndex) const;

Description

Returns the first symbol for the indexed list item.

Parameters

TInt aIndex

The index.

Return value

TChar

The first symbol for the indexed list item.


SecondSymbol()

TChar SecondSymbol(TInt aIndex) const;

Description

Returns the second symbol for the indexed list item.

Parameters

TInt aIndex

The index.

Return value

TChar

The second symbol for the indexed list item.


MoreSymbols()

TBool MoreSymbols(TInt aIndex) const;

Description

Tests whether there are more than two symbols for the day indicated by the indexed list item. Note that list items can only store a maximum of two entry symbols.

Parameters

TInt aIndex

The index.

Return value

TBool

ETrue if there are more than two symbols for the day, EFalse if not.


NumSymbols()

TUint NumSymbols(TInt aIndex) const;

Description

Returns the number of symbols for the indexed day.

Parameters

TInt aIndex

The index.

Return value

TUint

The number of symbols for the indexed day.


NumSymbolsForDay()

TUint NumSymbolsForDay(TUint aDayNum,TInt& aIndex);

Description

Returns the number of symbols and the index for the given day number.

Parameters

TUint aDayNum

The day number (0 - 30 inclusive).

TInt& aIndex

On return, the corresponding index (if the day number is valid) otherwise undefined.

Return value

TUint

The number of symbols if the day number is valid, otherwise zero.


operator[]()

const TListItem& operator[](TInt aIndex) const;

Description

Returns a list item using the supplied list index.

Parameters

TInt aIndex

The index.

Return value

TListItem&

The list item at the indexed position.

[Top]


Classes


Class TListItem

TListItem

Description

A single item in a symbol list.

A symbol list item is returned by CAgnSymbolList::operator[]().

Defined in CAgnSymbolList::TListItem:
DayNumber(), FirstSymbol(), FirstSymbolColor(), MoreSymbols(), NumSymbols(), SecondSymbol(), SetFirstSymbol(), SetFirstSymbolColor(), SetMoreSymbols(), SetNumSymbols(), SetSecondSymbol()

Set details

SetNumSymbols()


void SetNumSymbols(TUint aNumSymbols);

Description

Sets the number of entry symbols for the current list item.

Parameters

TUint aNumSymbols

The number of symbols.

SetMoreSymbols()


void SetMoreSymbols(TBool aMoreSymbols);

Description

Sets a flag to indicate whether there are more than two entry symbols for the current list item.

Parameters

TBool aMoreSymbols

True if there are more than two symbols, otherwise False.

SetFirstSymbol()


void SetFirstSymbol(TChar aSymbol);

Description

Sets the character as the first entry symbol for the current list item.

Parameters

TChar aSymbol

The symbol to set.

SetFirstSymbolColor()


void SetFirstSymbolColor(const TRgb& aColor);

Support

Supported from 6.0

Description

Sets the background colour for the first entry symbol for the current list item.

Note

Only the first entry symbol can have a background colour.

Return value

TRgb

The first symbol's background colour.

SetSecondSymbol()


void SetSecondSymbol(TChar aSymbol);

Description

Sets the character as the second entry symbol for the current list item.

Parameters

TChar aSymbol

The symbol to set.

Get details

DayNumber()


TUint DayNumber() const;

Description

Gets the day number of the current list item.

Return value

TUint

The day number.

NumSymbols()


TUint NumSymbols() const;

Description

Gets the number of symbols for the current list item.

Return value

TUint

The number of symbols.

MoreSymbols()


TBool MoreSymbols() const;

Description

Tests whether there are more than two entry symbols for the day of the current list item (list items can store a maximum of two entry symbols, but there may be more than two entry symbols on that day).

Return value

TBool

True if there are more than two symbols, otherwise False.

FirstSymbol()


TChar FirstSymbol() const;

Description

Get the first entry symbol for the current list item.

Return value

TChar

The first symbol.

FirstSymbolColor()


TRgb FirstSymbolColor() const;

Support

Supported from 6.0

Description

Get the background colour for the first symbol in the current list item, as set by SetFirstSymbolColor().

Return value

TRgb

The first entry symbol's background colour.

SecondSymbol()


TChar SecondSymbol() const;

Description

Get the second symbol for the current list item.

Return value

TChar

The second symbol.