class THuiTextStyle |
THuiTextStyle presents an abstract text style implementation. Its main purpose is to act as an encapsulation of a particular text style.
Derived platform dependant classes will implement their own version of this class
Protected Attributes | |
---|---|
THuiFont | iFont |
TInt | iFontStyleId |
TInt | iLocalDefinitionFlags |
Private Attributes | |
---|---|
TRgb | iBackgroundColor |
TRect | iClipRect |
TBool | iClippingEnabled |
TInt | iId |
TBool | iIsStrikeThrough |
TBool | iIsUnderline |
TInt | iParentId |
TRgb | iTextColor |
IMPORT_C | THuiTextStyle | ( | const THuiTextStyle & | aTextStyle | ) |
Copy constructor.
const THuiTextStyle & aTextStyle |
THuiTextStyle | ( | TInt | aFontStyleId = 0, |
TInt | aParentId = -1 | ||
) |
Constructs a text style that uses font according to font ID provided by font manager. Uses a default text style when parameters are not set.
IMPORT_C const THuiFont & | Font | ( | ) | const |
Returns THuiFont associated with this logical text style.
IMPORT_C void | GetTypeface | ( | TTypeface & | aTypeface | ) | const |
Get the typeface that would be used for this text style
TTypeface & aTypeface | Returned typeface structure |
IMPORT_C TInt | Id | ( | ) | const |
A unique toolkit specific ID assigned by the text style manager. The text style can be accessed anytime through the CHuiTextStyleManager::TextStyle - method based on this unique ID. The default text style has always ID 0.
CHuiTextStyleManager::CreatePlatformTextStyleL
TSize | LineExtentsL | ( | const TDesC & | aTextLine | ) |
Retrieves the dimensions in pixels occupied by rasterization of the given string using this text style.
const TDesC & aTextLine | String that is used in calculation of rasterization dimensions. |
TInt | LocalDefinitionFlags | ( | ) | const |
Retrieves the flags that describe which text style attributes are set/defined locally in this particular text style, and which come from the parent. Each flag can be used to set/reset a bit in definitions flags member variable. If a flag, KTextColorDefined for example, is set, it means that the respective text style attribute is defined locally. If the flag is not set, the respective attribute value will be looked from the parent.
KTextColorDefined as an example.
IMPORT_C TInt | ParentId | ( | ) | const |
Retrieves a toolkit specific ID of the parent text style. The text styles are cascaded. The parent of a text style is EHuiTextStyleNormal by default.
CHuiTextStyleManager::CreatePlatformTextStyleL
void | RasterizeLineL | ( | const TDesC & | aTextLine, |
CHuiTexture & | aTargetTexture | |||
) |
Rasterizes a single line of text using this style. Rasterization is done to the texture given as a parameter. Caller has to assure that the the texture is of correct dimentions and pixel format.
const TDesC & aTextLine | The line of text to rasterize. |
CHuiTexture & aTargetTexture | Reference to a texture that the text is going to be rasterized to. |
IMPORT_C void | SetBackgroundColor | ( | const TRgb & | aBackgroundColor | ) |
const TRgb & aBackgroundColor |
IMPORT_C void | SetFont | ( | THuiFont | aFont | ) | [virtual] |
Sets a THuiFont object associated with this logical text style.
THuiFont aFont | A HuiFont that willl be used in this text style. |
void | SetId | ( | TInt | aId | ) |
Text style manager is setting this ID when a new text style is created. CHuiTextStyleManager::CreatePlatformTextStyleL
TInt aId | A Unique toolkit specific ID for this text style. This text style can be accessed anytime through the CHuiTextStyleManager::TextStyle - method using this ID. |
void | SetLocalDefinitionFlags | ( | TInt | aLocalDefinitionFlags | ) |
Sets the flags that describe which text style attributes are set/defined locally in this particular text style, and which come from the parent. SetId
TInt aLocalDefinitionFlags | Will set all the text style attribute flags. |
IMPORT_C void | SetParentId | ( | TInt | aParentId | ) |
Sets a toolkit specific ID of the parent text style. The text styles are cascaded. Setting a parent ID will cause the text style to get all the text style attributes that are not locally defined from the parent.
TInt aParentId | A toolkit specific ID of the parent text style. |
IMPORT_C void | SetPosture | ( | TBool | aIsItalic | ) |
Sets the text style text posture attribute.
TBool aIsItalic | The new text style text posture. If ETrue, the text is italic, otherwise upright. |
IMPORT_C void | SetStrikeThrough | ( | TBool | aIsStrikeThrough | ) |
Sets the text style text strike through attribute.
TBool aIsStrikeThrough | The new text style text strike through attribute. If ETrue, the text is strike through, otherwise normal. |
IMPORT_C void | SetStrokeWeight | ( | TBool | aIsBold | ) |
Sets the text style text stroke weight attribute.
TBool aIsBold | The new text style text stroke weight. If ETrue, the text is bold, otherwise normal. |
IMPORT_C void | SetTextColor | ( | const TRgb & | aTextColour | ) |
Sets the text style text color attribute.
const TRgb & aTextColour | A new text color of the text style. |
IMPORT_C void | SetTextPaneHeightInPixels | ( | TInt | aTextPaneHeight, |
TBool | aIsDecoratedSize = EFalse | |||
) |
Sets the text style text pane height in pixels.
This means that the text size (i.e. the return value from calling TextSizeInPixels ) will be in general smaller than the text pane height, as the text pane is intended to match the font's maximum extent.
In order to convert a height from a metric value into pixels, use CHuiVisual::LocalToDisplay .
TInt aTextPaneHeight | The new text style text pane height in pixels. |
TBool aIsDecoratedSize = EFalse | If true, the decoration size is subtracted from the text pane height to ensure that the rasterized text will fit into the reserved area including the decoration. The decoration here means various effects that can be added to the text, for example a shadow. |
IMPORT_C void | SetTextSizeInPixels | ( | TInt | aTextSizeInPix, |
TBool | aIsDecoratedSize = EFalse | |||
) |
Sets the text style text size attribute in pixels.
TInt aTextSizeInPix | The new text style text size in pixels. |
TBool aIsDecoratedSize = EFalse | If true, the decoration size is subtracted from the text size to ensure that the rasterized text will fit into the reserved area including the decoration. The decoration here means various effects that can be added to the text, for example a shadow . |
IMPORT_C void | SetTextSizeInTwips | ( | TInt | aTextSizeInTwips, |
TBool | aIsDecoratedSize = EFalse | |||
) |
Sets the text style text size attribute in twips.
TInt aTextSizeInTwips | The new text style text size in twips. |
TBool aIsDecoratedSize = EFalse | If true, the decoration size is subtracted from the text size to ensure that the rasterized text will fit into the reserved area including the decoration. The decoration here means various effects that can be added to the text, for example a shadow . |
IMPORT_C void | SetUnderline | ( | TBool | aIsUnderline | ) |
Sets the text style text underline attribute.
TBool aIsUnderline | The new text style text underline attribute. If ETrue, the text is underlined, otherwise normal. |
IMPORT_C TBool | StrikeThrough | ( | ) | const |
Retrieves text style text strike through attribute.
IMPORT_C TInt | TextSizeInPixels | ( | TBool | aIsDecoratedSize = EFalse | ) |
Retrieves text style text size attribute in pixels.
TBool aIsDecoratedSize = EFalse | If true, the decoration size (the area reserved for decoration) is added to the actual text size. The decoration here means various effects that can be added to the text, for example a shadow. |
IMPORT_C TInt | TextSizeInTwips | ( | TBool | aIsDecoratedSize = EFalse | ) |
Retrieves text style text size attribute in twips.
TBool aIsDecoratedSize = EFalse | If true, the decoration size (the area reserved for decoration) is added to the actual text size. The decoration here means various effects that can be added to the text, for example a shadow. |
TInt | iId | [private] |
A unique toolkit specific ID for the text style. The text style can be accessed anytime through the CHuiTextStyleManager based on this unique ID. The default text style has always ID 0.
TInt | iParentId | [private] |
Toolkit specific ID of the parent text style. The text styles are cascaded. The parent of a text style is EHuiTextStyleNormal by default.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.