class CAlfTextVisual : public CAlfVisual |
Text visual for text drawing. Text visual shows one or more lines of text.
CAlfTextVisual* textVisual = CAlfTextVisual::AddNewL( control ); textVisual->SetTextL( _L( "Hello" ) ); *
Public Member Functions | |
---|---|
CAlfTextVisual () | |
~CAlfTextVisual () | |
IMPORT_C CAlfTextVisual * | AddNewL ( CAlfControl &, CAlfLayout *) |
IMPORT_C TAlfBackgroundType | BackgroundType () |
IMPORT_C void | ConstructL ( CAlfControl &) |
IMPORT_C void | EnableShadow ( TBool ) |
IMPORT_C CAlfVisual * | FindTag (const TDesC8 &) |
IMPORT_C TInt | MaxLineCount () |
IMPORT_C TAlfTimedPoint | Offset () |
void | PrepareForUpdateMesh () |
void | ReleaseMesh () |
IMPORT_C void | RemoveAndDestroyAllD () |
IMPORT_C void | SetAlign ( TAlfAlignHorizontal , TAlfAlignVertical ) |
IMPORT_C void | SetColor ( TRgb ) |
IMPORT_C void | SetColor (const TAknsItemID &, const TInt ) |
IMPORT_C void | SetColor (const TDesC &, const TDesC &) |
IMPORT_C void | SetHighlightRange ( TInt , TInt , TRgb &, TRgb &) |
IMPORT_C void | SetLineSpacing ( TInt , TLineSpacingUnits ) |
IMPORT_C void | SetMaxLineCount ( TInt ) |
IMPORT_C void | SetOffset (const TAlfTimedPoint &) |
IMPORT_C void | SetShadowOpacity (const TAlfTimedValue &) |
IMPORT_C void | SetStyle ( TAlfPreconfiguredTextStyle , TAlfBackgroundType ) |
IMPORT_C void | SetTextL (const TDesC &) |
IMPORT_C void | SetTextStyle ( TInt ) |
IMPORT_C void | SetWrapping ( TLineWrap ) |
IMPORT_C TAlfTimedValue | ShadowOpacity () |
IMPORT_C TAlfPreconfiguredTextStyle | Style () |
IMPORT_C TRect | SubstringExtents ( TUint , TUint ) |
IMPORT_C const TDesC & | Text () |
IMPORT_C TSize | TextExtents () |
IMPORT_C TInt | TextStyle () |
IMPORT_C void | UpdateChildrenLayout ( TInt ) |
void | UpdateMesh ( TBool ) |
IMPORT_C TLineWrap | Wrapping () |
Protected Member Functions | |
---|---|
IMPORT_C void | DoRemoveAndDestroyAllD () |
IMPORT_C void | PropertyOwnerExtension (const TUid &, TAny **) |
Public Member Enumerations | |
---|---|
enum | TLineSpacingUnits { EPixels , ETwips } |
enum | TLineWrap { ELineWrapManual , ELineWrapTruncate , ELineWrapBreak } |
Private Attributes | |
---|---|
TTextVisualPrivateData * | iTextVisualData |
IMPORT_C CAlfTextVisual * | AddNewL | ( | CAlfControl & | aOwnerControl, |
CAlfLayout * | aParentLayout = 0 | |||
) | [static] |
Constructor, which gives ownership to the control.
CAlfControl & aOwnerControl | The control |
CAlfLayout * aParentLayout = 0 | If given, the parent layout. |
IMPORT_C TAlfBackgroundType | BackgroundType | ( | ) |
Determines the background type of the text visual. This was set with a call to SetStyle() .
IMPORT_C void | ConstructL | ( | CAlfControl & | aOwner | ) | [virtual] |
Second-phase constructor.
CAlfControl & aOwner |
IMPORT_C void | DoRemoveAndDestroyAllD | ( | ) | [protected, virtual] |
From CAlfVisual CAlfVisual
IMPORT_C void | EnableShadow | ( | TBool | aDoEnable | ) |
Use CAlfDropShadow
Enables or disables the text shadow. The rasterized text shadow is a special implementation of shadow that looks good with text. If this value is false, then the text will not have a rasterized shadow.
TBool aDoEnable | True enables rasterized shadows, false disables. |
IMPORT_C CAlfVisual * | FindTag | ( | const TDesC8 & | aTag | ) | [virtual] |
Finds a visual whose tag descriptor contains a specific tag.
CAlfVisual::FindTag() is the basic implementation that checks if this visual's tag matches the specified tag. CAlfLayout::FindTag() extends the search into child visuals, covering recursively entire visual hierarchies.
Todo: how should several visuals with matching tag to be handled ??
CAlfVisual::Tag() CAlfVisual::SetTagL() CAlfVisual::IsTagged() CAlfLayout::FindTag()
const TDesC8 & aTag | Tag to look for. If this tag is found as a part of a visual's colon-separated tag descriptor, it is treated as a match and the visual is returned. The tag to look for cannot contain separator characters (:). |
IMPORT_C TInt | MaxLineCount | ( | ) | const |
Determines the maximum number of line displayed by the text visual.
IMPORT_C void | PropertyOwnerExtension | ( | const TUid & | aExtensionUid, |
TAny ** | aExtensionParams | |||
) | [protected, virtual] |
! future proofing
IMPORT_C void | SetAlign | ( | TAlfAlignHorizontal | aAlignHorizontal, |
TAlfAlignVertical | aAlignVertical | |||
) |
Sets the alignment of the text visual.
TAlfAlignHorizontal aAlignHorizontal | Horizontal alignment. |
TAlfAlignVertical aAlignVertical | Vertical alignment. |
IMPORT_C void | SetColor | ( | TRgb | aColor | ) |
Sets the color of the text.
TRgb aColor | Text color. |
IMPORT_C void | SetColor | ( | const TAknsItemID & | aId, |
const TInt | aIndex | |||
) |
Sets the color of the text via skin id.
const TAknsItemID & aId | |
const TInt aIndex | Index within the color group |
IMPORT_C void | SetColor | ( | const TDesC & | aTextColorTable, |
const TDesC & | aColorIndex | |||
) |
Sets the color of the text via skin id.
IMPORT_C void | SetHighlightRange | ( | TInt | aStart, |
TInt | aEnd, | |||
TRgb & | aHighlightColor, | |||
TRgb & | aHighlightTextColor | |||
) |
Sets highlighting for a part of Text Start and end index of text to be highlighted, are ordinal indices. In case of multiple language, bidirectional text (e.g. English + Arabic), mixed text selection for highlight, might give strange results. e.g.TextVisual text : "E n g l i s h c i b a r A" ( Arabic script is read/written from right to left. Assume 'c i b a r A' is Arabic script ) and highlight range : 5-9. Expected result : "i s h" and "r A" should get highlighted Actual Result: "i s h c i" Hence, it is recommended to use different text visuals in case of selection of bidirectional text.
IMPORT_C void | SetLineSpacing | ( | TInt | aLineSpacing, |
TLineSpacingUnits | aUnits = EPixels | |||
) |
Sets the line spacing for multiline text visual when the text wraps around.
TInt aLineSpacing | Line spacing between lines in multiline text visual. aUnits Defines the units of the line spacing. |
TLineSpacingUnits aUnits = EPixels |
IMPORT_C void | SetMaxLineCount | ( | TInt | aMaxLineCount | ) |
Sets the maximum number of lines displayed by the text visual. The default is KMaxTInt.
TInt aMaxLineCount |
IMPORT_C void | SetOffset | ( | const TAlfTimedPoint & | aOffset | ) |
Sets offset for the text.
const TAlfTimedPoint & aOffset | text offset. |
IMPORT_C void | SetShadowOpacity | ( | const TAlfTimedValue & | aShadowOpacity | ) |
Use CAlfDropShadow
Sets shadow opacity. Changes the opacity of the text soft shadow. Currently SetShadowStrength is only implemented in the OpenGL renderer, and will have no effect in BitGDI.
const TAlfTimedValue & aShadowOpacity | Shadow opacity |
IMPORT_C void | SetStyle | ( | TAlfPreconfiguredTextStyle | aStyle, |
TAlfBackgroundType | aBackgroundType = EAlfBackgroundTypeLight | |||
) |
Sets the default text style of the text visual. This style describbes the size and colour of the rendered text. Parameters passed here can be overridden by call to SetFontSpec(). SetFontSpec()
TAlfPreconfiguredTextStyle aStyle | Text style. |
TAlfBackgroundType aBackgroundType = EAlfBackgroundTypeLight | Text background type. Affects the color of the text. Defaults to EAlfBackgroundTypeLight (ie, black text will be used). |
IMPORT_C void | SetTextL | ( | const TDesC & | aText | ) |
Set the text shown in the visual. The text may contain formatting codes to change the size, color, and alignment of the text.
const TDesC & aText | Descriptor containing the text. |
IMPORT_C void | SetTextStyle | ( | TInt | aTextStyleId | ) |
Sets the default text style of the text visual. This style describes the style the text is rendered with. The text style has to be created with the text style manager. If the given text style does not exist, the text style is reverted back to default text style. CAlfTextStyleManager
TInt aTextStyleId | Text style ID provided by the text style manager. |
IMPORT_C void | SetWrapping | ( | TLineWrap | aWrap | ) |
Sets the line wrapping mode.
TLineWrap aWrap | Line wrapping mode. |
IMPORT_C TAlfTimedValue | ShadowOpacity | ( | ) |
Use CAlfDropShadow
Returns shadow opacity.
IMPORT_C TRect | SubstringExtents | ( | TUint | aStart, |
TUint | aEnd | |||
) | const |
Determines the size of the text in the visual. Text must have been updated / or drawn to be able to use these extents.
UpdateMeshL()
IMPORT_C TSize | TextExtents | ( | ) | const |
Determines the size of the text in the visual. Text must have been updated / or drawn to be able to use these extents.
UpdateMeshL()
IMPORT_C TInt | TextStyle | ( | ) | const |
Accesses the text style id of the text visual.
This API should be used in preference to Style
IMPORT_C void | UpdateChildrenLayout | ( | TInt | aTransitionTime = 0 | ) | [virtual] |
Update the layout of all children. Subclasses can call this to recalculate the layout of all children.
TInt aTransitionTime = 0 | Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime() |
void | UpdateMesh | ( | TBool | aSynchronousUpdate = EFalse | ) |
TBool aSynchronousUpdate = EFalse |
EPixels |
Line spacing is given in pixels |
ETwips |
Line spacing is given in twips |
ELineWrapManual |
Lines must be broken manually with line break characters. If the visual does not use clipping, long text lines will go outside the visual. |
ELineWrapTruncate |
Lines that do not fit in the visual's content area are truncated with an ellipsis (...). |
ELineWrapBreak |
Lines are broken to the visual's content area. |
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.