CAknsColorTableItemData Class Reference

#include <mw/AknsItemData.h>

Link against: AknSkins.lib

class CAknsColorTableItemData : public CAknsImageItemData

Inherits from

Detailed Description

Color table item data. Color table item data contains (in addition to base class members) color array of TRGB values. Item type for color item data is always EAknsITColorTable.

This is a public class with exported functions. The class is not intended for derivation outside the library.

Since
2.0

Member Attribute Documentation

iColorArray

TAknsColorTableEntry *iColorArray[protected]

Color array.

iColorArraySize

TInt iColorArraySize[protected]

Constructor & Destructor Documentation

CAknsColorTableItemData ( const TAknsItemType )

CAknsColorTableItemData(const TAknsItemTypeaType)[protected]

C++ protected constructor. Constructs a new CAknsColorItemData without an array.

ParameterDescription
aTypeItem type of the new item data object. While this is always EAknsITColorTable for instances of this class, derived classes may specify another value.

~CAknsColorTableItemData ( )

~CAknsColorTableItemData()[virtual]

Destructor. Destroys color value array.

Member Function Documentation

ColorIndexed ( const TInt )

IMPORT_C TIntColorIndexed(const TIntaIndex)const

Returns the indexed color value.

Since
2.0
Note:
This method does not perform any bounds checking. An access violation or panic will occur, if the given index is not within the bounds of the internal array. Use GetColorL instead, if such checking is required.
ParameterDescription
aIndexIndex of the color to be retrieved. This must be within 0 (inclusive) and aNumberOfColors (exclusive).

Returns: Color value as TInt. If the value is -1, RGB value should be queried instead.

ColorRgb ( const TInt )

IMPORT_C TRgbColorRgb(const TIntaIndex)const

Returns the RGB color value.

Since
2.0
Note:
This method does not perform any bounds checking. An access violation or panic will occur, if the given index is not within the bounds of the internal array. Use GetColorL instead, if such checking is required.
ParameterDescription
aIndexIndex of the color to be retrieved. This must be within 0 (inclusive) and aNumberOfColors (exclusive).

Returns: Color value as TRgb. Note that the value is only valid if ColorIndexed() returned -1.

GetColorL ( const TInt, TRgb & )

IMPORT_C voidGetColorL(const TIntaIndex,
TRgb &aColor
)const

Retrieves a color value (indexed or RGB) with bounds checking.

Since
2.6
Exceptions:
If the given index is outside the bounds of the array, the method leaves with an error code.
ParameterDescription
aIndexIndex of the color to be retrieved.
aColorOn return, contains the color as an RGB value. If the color is indexed, the appropriate mapping using current palette is used.

NewL ( )

IMPORT_C CAknsColorTableItemData *NewL()[static]

Two-phased constructor. Constructs a new CAknsColorTableItemData object. Values must be set separately using SetColorsL.

Exceptions:
If allocation fails, function leaves with a system-wide error code.

Returns: Newly constructed CAknsColorTableItemData object.

SetColorsL ( const TInt, const TAknsColorTableEntry * )

IMPORT_C voidSetColorsL(const TIntaNumberOfColors,
const TAknsColorTableEntry *aColors
)

Sets color values for this item data instance.

Since
2.0
ParameterDescription
aNumberOfColorsNumber of colors in aColors.
aColorsPointer to first color value. Values are copied into an internal array.