CColorList Class Reference

#include <mw/gulcolor.h>

Link against: egul.lib

class CColorList : public CBase

Inherits from

Detailed Description

A palette that maps logical colours (TLogicalColor) to physical (TRgb) values. It also supports independent sections for applications: a section is identified by an application UID, and the mappings are held as a colour array (CColorArray).

A colour list also supports mapping for both four-grey and 256-colour schemes; the 256-colour scheme will be used and will look good if the screen mode supports 16 or more colours. Otherwise, the four-grey scheme will be used.

Constructor & Destructor Documentation

~CColorList ( )

IMPORT_C~CColorList()

Destructor.

Member Function Documentation

AddColorArrayL ( TUid, CColorArray * )

IMPORT_C voidAddColorArrayL(TUidaApp,
CColorArray *aArray
)

Creates a new entry in the colour list with the specified application UID and its colour array.

Parameters
aAppThe UID of the application.
aArrayThe application's colour array. The colour list takes ownership.

Color ( TLogicalColor )

IMPORT_C TRgbColor(TLogicalColoraColor)const

Gets the physical colour (TRgb) equivalent of a logical colour.

Parameters
aColorLogical colour value.
Return Value
The physical colour equivalent of aColor.
Panic Codes
EGUL3 The logical color specified is not found in the colour list.

Color ( TUid, TInt )

IMPORT_C TRgbColor(TUidaApp,
TIntaColor
)const

Gets the physical colour (TRgb) equivalent of a logical colour from the specified application's colour array.

Parameters
aAppThe UID of the application.
aColorA logical colour supported by the application.
Return Value
The physical colour equivalent of the logical colour.
Panic Codes
EGUL6 The specified application does not have an entry in the colour list.

ColorArray ( TUid )

IMPORT_C CColorArray *ColorArray(TUidaApp)const

Gets an application's colour array.

Parameters
aAppThe UID of the application.
Return Value
The specified application's colour array. The caller does not take ownership.
Panic Codes
EGUL6 The specified application does not have an entry in the colour list.

ContainsColorArray ( TUid )

IMPORT_C TBoolContainsColorArray(TUidaApp)const

Tests whether the specified application has an entry in the colour list.

Parameters
aAppThe UID of the application.
Return Value
True if a colour array is found for the application, false if not.

Count ( )

IMPORT_C TIntCount()const

Gets the number of colors in the list.

Return Value
The number of colors in the list

DeleteColorArray ( TUid )

IMPORT_C voidDeleteColorArray(TUidaApp)

Deletes the entry in the colour list for the specified application, and deletes the application's colour array.

Parameters
aAppThe UID of the application whose entry is deleted from the colour list.
Panic Codes
EGUL6 The specified application does not have an entry in the colour list.

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises the colour list to a write stream.

Parameters
aStreamStream to which the object should be externalised.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalises the colour list from a read stream.

Parameters
aStreamStream from which the object should be internalised.

MergeL ( const CColorList & )

IMPORT_C voidMergeL(const CColorList &aList)

Merges the specified CColorList with target object.

Parameters
aListA reference to the colour list object, set by calling CColorList::AddColorArray()

NewL ( CArrayFix< TRgb > * )

IMPORT_C CColorList *NewL(CArrayFix< TRgb > *aColors)[static]

Allocates and constructs a new colour list.

Parameters
aColorsThe array of physical colours to store in the list. The colour list takes ownership.
Return Value
The colour list.

NewLC ( )

IMPORT_C CColorList *NewLC()[static]

Allocates and constructs a new colour list and puts the pointer to the new colour list object onto the cleanup stack.

Return Value
The colour list.

SetColor ( TLogicalColor, TRgb )

IMPORT_C voidSetColor(TLogicalColoraLogicalColor,
TRgbaColor
)

Sets the TRgb colour value that a logical colour maps to.

Parameters
aLogicalColorThe logical colour that needs to be set.
aColorThe TRgb colour value.