Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: gulcolor.h
Link against: egul.lib

Class CColorArray

CColorArray

Support

Supported from 6.0

Description

Provides functions used to create a colour array, which contains a list of available colours.

The colour array is a dynamic array of mappings between logical and physical colours (TRgb values).

Derivation

CBaseBase class for all classes to be instantiated on the heap
CColorArrayProvides functions used to create a colour array, which contains a list of available colours

Defined in CColorArray:
AddL(), Color(), Contains(), Count(), ExternalizeL(), InternalizeL(), NewL(), NewLC(), Remove(), Reset(), SetColor(), ~CColorArray()

Inherited from CBase:
operator new()


Construction/destruction


NewL()

static CColorArray* NewL();

Description

Creates an array of colours.

Return value

CColorArray*

Pointer to the colour array.


NewLC()

static CColorArray* NewLC();

Description

Creates an array of colours and puts it on the cleanup stack.

Return value

CColorArray*

Pointer to the colour array.


NewLC()

static CColorArray* NewLC(const CColorArray& aArray);

Description

Creates an array of colours using an existing array and puts it on the cleanup stack.

Parameters

const CColorArray& aArray

The colour array to copy.

Return value

CColorArray*

Pointer to the colour array.


~CColorArray()

~CColorArray();

Description

Destructor.

[Top]


Setting and getting colors


Color()

TRgb Color(TInt aLogicalColor) const;

Description

Gets the physical (TRgb) colour which corresponds to a logical colour.

Parameters

TInt aLogicalColor

The logical colour.

Return value

TRgb

The TRgb colour.


SetColor()

void SetColor(TInt aLogicalColor,TRgb aColor);

Description

Sets a mapping in the colour array between the logical and physical colours specified.

A mapping must already exist for the logical colour.

Parameters

TInt aLogicalColor

The logical colour.

TRgb aColor

TRgb colour.


Contains()

TBool Contains(TInt aLogicalColor) const;

Description

Tests whether the colour array contains the logical colour specified.

Parameters

TInt aLogicalColor

The logical colour.

Return value

TBool

ETrue if the logical colour is contained in the colour array, otherwise EFalse.


Count()

TInt Count() const;

Description

Returns the number of elements held in the array.

Return value

TInt

The number of elements held in the array.

[Top]


Adding/removing colors


Reset()

void Reset();

Description

Resets the colour array.


AddL()

void AddL(TInt aLogicalColor,TRgb aColor);

Description

Adds a colour to the array, with its logical and TRgb colours.

A mapping cannot already exist in the array for the logical colour.

Parameters

TInt aLogicalColor

The logical colour.

TRgb aColor

The TRgb colour.


Remove()

void Remove(TInt aLogicalColor);

Description

Removes a colour from the array.

Parameters

TInt aLogicalColor

The logical colour to remove.

[Top]


Stream persistence


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises the colour array.

Parameters

RReadStream& aStream

Stream from which the the colour array should be internalised.


ExternalizeL()

void ExternalizeL(RWriteStream& aStream) const;

Description

Externalises the colour array.

Parameters

RWriteStream& aStream

Stream to which the the colour array should be externalised.