CAknsColorTableItemData Class Reference

API published in: S60 2nd Ed

Link against: aknskins.lib aknskinsrv.lib aknswallpaperutils.lib

Capability Information

Required Capabilities

None


#include <aknsitemdata.h>

Inherits CAknsImageItemData.


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.


Public Member Functions

virtual  ~CAknsColorTableItemData ()
  Destructor.
IMPORT_C void  SetColorsL (const TInt aNumberOfColors, const TAknsColorTableEntry *aColors)
  Sets color values for this item data instance.
IMPORT_C TInt  ColorIndexed (const TInt aIndex) const
  Returns the indexed color value.
IMPORT_C TRgb  ColorRgb (const TInt aIndex) const
  Returns the RGB color value.
IMPORT_C void  GetColorL (const TInt aIndex, TRgb &aColor) const
  Retrieves a color value (indexed or RGB) with bounds checking.

Static Public Member Functions

static IMPORT_C CAknsColorTableItemData NewL ()
  Two-phased constructor.

Protected Member Functions

  CAknsColorTableItemData (const TAknsItemType aType)
  C++ protected constructor.

Protected Attributes

TAknsColorTableEntry *  iColorArray
  Color array.
TInt  iColorArraySize

Constructor & Destructor Documentation

virtual CAknsColorTableItemData::~CAknsColorTableItemData  )  [virtual]
 

Destructor.

Destroys color value array.

CAknsColorTableItemData::CAknsColorTableItemData const TAknsItemType  aType  )  [protected]
 

C++ protected constructor.

Constructs a new CAknsColorItemData without an array.

Parameters:
aType  Item type of the new item data object. While this is always EAknsITColorTable for instances of this class, derived classes may specify another value.

Member Function Documentation

IMPORT_C TInt CAknsColorTableItemData::ColorIndexed const TInt  aIndex  )  const
 

Returns the indexed color value.

Parameters:
aIndex  Index 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.
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.
IMPORT_C TRgb CAknsColorTableItemData::ColorRgb const TInt  aIndex  )  const
 

Returns the RGB color value.

Parameters:
aIndex  Index 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.
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.
IMPORT_C void CAknsColorTableItemData::GetColorL const TInt  aIndex,
TRgb &  aColor
const
 

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

Parameters:
aIndex  Index of the color to be retrieved.
aColor  On return, contains the color as an RGB value. If the color is indexed, the appropriate mapping using current palette is used.
Exceptions:
If the given index is outside the bounds of the array, the method leaves with an error code.
static IMPORT_C CAknsColorTableItemData* CAknsColorTableItemData::NewL  )  [static]
 

Two-phased constructor.

Constructs a new CAknsColorTableItemData object. Values must be set separately using SetColorsL.

Returns:
Newly constructed CAknsColorTableItemData object.
Exceptions:
If allocation fails, function leaves with a system-wide error code.
IMPORT_C void CAknsColorTableItemData::SetColorsL const TInt  aNumberOfColors,
const TAknsColorTableEntry *  aColors
 

Sets color values for this item data instance.

Parameters:
aNumberOfColors  Number of colors in aColors.
aColors  Pointer to first color value. Values are copied into an internal array.

Field Documentation

TAknsColorTableEntry* CAknsColorTableItemData::iColorArray [protected]
 

Color array.

TInt CAknsColorTableItemData::iColorArraySize [protected]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top