Location:
TXTFRMAT.H
class TLogicalRgb : public TRgb;
Provides support for system colours, in addition to literal colours, in text formatting.
The base class TRgb
stores the 24-bit literal colour value using a TUint32. TLogicalRgb uses the MSB from iValue2 data member as an 8-bit index.
The purpose of the index is to allow applications to use logical colours. If the index is zero, the value is not a logical
colour; it is treated as an ordinary TRgb
value. If the index is non zero (1-255), the colour should be translated by the application into a system colour. Indices
254 and 255 are reserved for the system foreground and background colours, respectively and should be translated into them.
Translation from index to RGB colour occurs in the implementation of MFormParam::SystemColor().
All colours in the Text and Text Attributes API are stored using TLogicalRgb values and are initialised to either TLogicalRgb::ESystemForegroundColor
or TLogicalRgb::ESystemBackgroundColor
.
This system allows an application to set its text colours once, perhaps using the system-wide colour scheme, rather than having
to set the colours each time a text object is created. It is also compatible with legacy code which expects TRgb
rather than TLogicalRgb values: for example, the logical foreground and background colours have their bottom three bytes
filled with black and white respectively so that code which expects TRgb
values can still use them.
TRgb
- 24-bit RGB colour value with 8 bits each for red, green and blue
TLogicalRgb
- Provides support for system colours, in addition to literal colours, in text formatting
Defined in TLogicalRgb
:
ESystemBackgroundColor
, ESystemBackgroundIndex
, ESystemForegroundColor
, ESystemForegroundIndex
, ESystemSelectionBackgroundColor
, ESystemSelectionBackgroundIndex
, ESystemSelectionForegroundColor
, ESystemSelectionForegroundIndex
, SetSystemColorIndex()
, SystemColorIndex()
, TLogicalRgb()
, TLogicalRgb()
, TLogicalRgb()
, TLogicalRgb()
, TSystemColor
, anonymous
Inherited from TRgb
:
Alpha()
,
Blue()
,
Color16()
,
Color16M()
,
Color16MA()
,
Color16MAP()
,
Color16MU()
,
Color256()
,
Color4K()
,
Color64K()
,
Difference()
,
ExternalizeL()
,
Gray16()
,
Gray2()
,
Gray256()
,
Gray4()
,
Green()
,
Internal()
,
InternalizeL()
,
Red()
,
SetAlpha()
,
SetBlue()
,
SetGreen()
,
SetInternal()
,
SetRed()
,
Value()
,
_Color16M()
,
_Color16MA()
,
_Color16MAP()
,
_Color16MU()
,
_Color4K()
,
_Color64K()
,
_Gray16()
,
_Gray2()
,
_Gray256()
,
_Gray4()
,
operator &()
,
operator &=()
,
operator!=()
,
operator==()
,
operator^()
,
operator^=()
,
operator|()
,
operator|=()
,
operator~()
inline TLogicalRgb(TUint32 aValue);
Constructs the object with a 32-bit integer. The index is stored in the MSB of iValue2 data member. A TRgb
value may be stored in the base TRgb
class.
|
inline TLogicalRgb(TSystemColor aValue);
Constructs the object with a TSystemColor value.
|
inline TLogicalRgb(const TRgb &aRgb);
Constructs a new TLogicalRgb object from an existing one.
|
inline TUint SystemColorIndex() const;
Returns the logical colour's index value. Zero indicates that the value is not a logical colour; it is an ordinary TRgb
value. 254 and 255 indicate the system foreground and background colours, respectively.
|
inline void SetSystemColorIndex(TUint aIndex);
Sets the logical colour's index value.
|
n/a
|
TSystemColor
Used to construct TLogicalRgb objects which should use either the system foreground or background colour.
|