CAlfTextVisual Class Reference

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" ) ); * 
alfclient.lib
Since
S60 v3.2

Inherits from

Nested Classes and Structures

Public Member Functions
CAlfTextVisual()
~CAlfTextVisual()
IMPORT_C CAlfTextVisual *AddNewL(CAlfControl &, CAlfLayout *)
IMPORT_C TAlfBackgroundTypeBackgroundType()
IMPORT_C voidConstructL(CAlfControl &)
IMPORT_C voidEnableShadow(TBool)
IMPORT_C CAlfVisual *FindTag(const TDesC8 &)
IMPORT_C TIntMaxLineCount()
IMPORT_C TAlfTimedPointOffset()
voidPrepareForUpdateMesh()
voidReleaseMesh()
IMPORT_C voidRemoveAndDestroyAllD()
IMPORT_C voidSetAlign(TAlfAlignHorizontal, TAlfAlignVertical)
IMPORT_C voidSetColor(TRgb)
IMPORT_C voidSetColor(const TAknsItemID &, const TInt)
IMPORT_C voidSetColor(const TDesC &, const TDesC &)
IMPORT_C voidSetHighlightRange(TInt, TInt, TRgb &, TRgb &)
IMPORT_C voidSetLineSpacing(TInt, TLineSpacingUnits)
IMPORT_C voidSetMaxLineCount(TInt)
IMPORT_C voidSetOffset(const TAlfTimedPoint &)
IMPORT_C voidSetShadowOpacity(const TAlfTimedValue &)
IMPORT_C voidSetStyle(TAlfPreconfiguredTextStyle, TAlfBackgroundType)
IMPORT_C voidSetTextL(const TDesC &)
IMPORT_C voidSetTextStyle(TInt)
IMPORT_C voidSetWrapping(TLineWrap)
IMPORT_C TAlfTimedValueShadowOpacity()
IMPORT_C TAlfPreconfiguredTextStyleStyle()
IMPORT_C TRectSubstringExtents(TUint, TUint)
IMPORT_C const TDesC &Text()
IMPORT_C TSizeTextExtents()
IMPORT_C TIntTextStyle()
IMPORT_C voidUpdateChildrenLayout(TInt)
voidUpdateMesh(TBool)
IMPORT_C TLineWrapWrapping()
Protected Member Functions
IMPORT_C voidDoRemoveAndDestroyAllD()
IMPORT_C voidPropertyOwnerExtension(const TUid &, TAny **)
Inherited Functions
CAlfPropertyOwner::CAlfPropertyOwner()
CAlfPropertyOwner::CopyProperty(const CAlfPropertyOwner &,const TDesC8 &)
CAlfPropertyOwner::PropertyClear()
CAlfPropertyOwner::PropertyFindInteger(const TDesC8 &,TInt *)const
CAlfPropertyOwner::PropertyFindString(const TDesC8 &,TDesC **)const
CAlfPropertyOwner::PropertyRemove(const TDesC8 &)
CAlfPropertyOwner::PropertySetIntegerL(const TDesC8 &,TInt,TInt,TInt)
CAlfPropertyOwner::PropertySetStringL(const TDesC8 &,const TDesC &)
CAlfPropertyOwner::~CAlfPropertyOwner()
CAlfVisual::AlignByOrigin(TAlfRealRect &)const
CAlfVisual::Brushes()
CAlfVisual::CAlfVisual()
CAlfVisual::ClearFlag(TAlfVisualFlags)
CAlfVisual::ClearFlags(TUint)
CAlfVisual::Clipping()const
CAlfVisual::Comms()const
CAlfVisual::ConstructL(CAlfControl &,TInt,TInt,const TDesC8 &)
CAlfVisual::CopyValues(const CAlfVisual &,TInt,TInt)
CAlfVisual::DepthOffset()const
CAlfVisual::Display()const
CAlfVisual::DisplayRect()const
CAlfVisual::DisplayRectTarget()const
CAlfVisual::DisplayToLocal(const TAlfRealPoint &)const
CAlfVisual::DisplayToLocal(const TPoint &)const
CAlfVisual::DropShadowHandler()const
CAlfVisual::EffectiveOpacity()const
CAlfVisual::EnableBrushesL(TBool)
CAlfVisual::EnableDropShadowL(TBool)
CAlfVisual::EnableTransformationL(TBool)
CAlfVisual::Env()const
CAlfVisual::Flags()const
CAlfVisual::HasTactileFeedback(TInt)const
CAlfVisual::HorizontalOrigin()const
CAlfVisual::HorizontalPadding()const
CAlfVisual::Identifier()const
CAlfVisual::IsTagged()const
CAlfVisual::Layout()const
CAlfVisual::LocalToDisplay(const TAlfRealPoint &)const
CAlfVisual::LocalToDisplay(const TPoint &)const
CAlfVisual::MaxSize()const
CAlfVisual::MaxSizeInBaseUnits()const
CAlfVisual::Mimic(CAlfVisual &,TInt)
CAlfVisual::MinSize()const
CAlfVisual::MinSizeInBaseUnits()const
CAlfVisual::Move(const TAlfRealPoint &,TInt)
CAlfVisual::Move(const TPoint &,TInt)
CAlfVisual::MoveToFront(TInt)
CAlfVisual::Opacity()const
CAlfVisual::Owner()const
CAlfVisual::Padding()const
CAlfVisual::PaddingAsMetric()const
CAlfVisual::PaddingInPixels()const
CAlfVisual::Pause(TInt)
CAlfVisual::Pos()const
CAlfVisual::RemoveTactileFeedback(TInt)
CAlfVisual::Resume(TInt)
CAlfVisual::SetCenteredPosAndSize(const TAlfRealPoint &,const TAlfRealSize &,TInt)
CAlfVisual::SetCenteredPosAndSize(const TPoint &,const TSize &,TInt)
CAlfVisual::SetClipping(TBool)
CAlfVisual::SetDepthOffset(const TAlfTimedValue &)
CAlfVisual::SetDisplay(CAlfDisplay *)
CAlfVisual::SetEffectL(const TDesC &)
CAlfVisual::SetFlag(TAlfVisualFlags)
CAlfVisual::SetFlags(TUint)
CAlfVisual::SetGroupEffectL(const TDesC &,TInt)
CAlfVisual::SetLayout(CAlfLayout *)
CAlfVisual::SetMaxSize(const TAlfRealSize &)
CAlfVisual::SetMaxSize(const TSize &)
CAlfVisual::SetMinSize(const TAlfRealSize &)
CAlfVisual::SetMinSize(const TSize &)
CAlfVisual::SetOpacity(const TAlfTimedValue &)
CAlfVisual::SetOrigin(TAlfVisualHOrigin,TAlfVisualVOrigin)
CAlfVisual::SetOwner(CAlfControl &)
CAlfVisual::SetPadding(TInt)
CAlfVisual::SetPadding(const TAlfBoxMetric &)
CAlfVisual::SetPadding(const TPoint &)
CAlfVisual::SetPos(const TAlfRealPoint &,TInt)
CAlfVisual::SetPos(const TAlfTimedPoint &)
CAlfVisual::SetRect(const TAlfRealRect &,TInt)
CAlfVisual::SetSize(const TAlfRealSize &,TInt)
CAlfVisual::SetSize(const TAlfTimedPoint &)
CAlfVisual::SetTactileFeedbackL(TInt,TInt)
CAlfVisual::SetTagL(const TDesC8 &)
CAlfVisual::Size()const
CAlfVisual::Tag()const
CAlfVisual::TagMatches(const TDesC8 &)const
CAlfVisual::Transformation()
CAlfVisual::VerticalOrigin()const
CAlfVisual::VerticalPadding()const
CAlfVisual::~CAlfVisual()
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTLineSpacingUnits { EPixels, ETwips }
enumTLineWrap { ELineWrapManual, ELineWrapTruncate, ELineWrapBreak }
Private Attributes
TTextVisualPrivateData *iTextVisualData

Constructor & Destructor Documentation

CAlfTextVisual()

IMPORT_CCAlfTextVisual()

Constructor.

~CAlfTextVisual()

IMPORT_C~CAlfTextVisual()[virtual]

Destructor.

Member Functions Documentation

AddNewL(CAlfControl &, CAlfLayout *)

IMPORT_C CAlfTextVisual *AddNewL(CAlfControl &aOwnerControl,
CAlfLayout *aParentLayout = 0
)[static]

Constructor, which gives ownership to the control.

Parameters

CAlfControl & aOwnerControlThe control
CAlfLayout * aParentLayout = 0If given, the parent layout.

BackgroundType()

IMPORT_C TAlfBackgroundTypeBackgroundType()

Determines the background type of the text visual. This was set with a call to SetStyle().

ConstructL(CAlfControl &)

IMPORT_C voidConstructL(CAlfControl &aOwner)[virtual]

Second-phase constructor.

Parameters

CAlfControl & aOwner

DoRemoveAndDestroyAllD()

IMPORT_C voidDoRemoveAndDestroyAllD()[protected, virtual]

EnableShadow(TBool)

IMPORT_C voidEnableShadow(TBoolaDoEnable)

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.

SetShadowOpacity ShadowOpacity

Parameters

TBool aDoEnableTrue enables rasterized shadows, false disables.

FindTag(const TDesC8 &)

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()

Parameters

const TDesC8 & aTagTag 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 (:).

MaxLineCount()

IMPORT_C TIntMaxLineCount()const

Determines the maximum number of line displayed by the text visual.

Offset()

IMPORT_C TAlfTimedPointOffset()const

Gets offset for the text.

PrepareForUpdateMesh()

voidPrepareForUpdateMesh()

Internal utils

PropertyOwnerExtension(const TUid &, TAny **)

IMPORT_C voidPropertyOwnerExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

! future proofing

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

ReleaseMesh()

voidReleaseMesh()

RemoveAndDestroyAllD()

IMPORT_C voidRemoveAndDestroyAllD()[virtual]

SetAlign(TAlfAlignHorizontal, TAlfAlignVertical)

IMPORT_C voidSetAlign(TAlfAlignHorizontalaAlignHorizontal,
TAlfAlignVerticalaAlignVertical
)

Sets the alignment of the text visual.

Parameters

TAlfAlignHorizontal aAlignHorizontalHorizontal alignment.
TAlfAlignVertical aAlignVerticalVertical alignment.

SetColor(TRgb)

IMPORT_C voidSetColor(TRgbaColor)

Sets the color of the text.

Parameters

TRgb aColorText color.

SetColor(const TAknsItemID &, const TInt)

IMPORT_C voidSetColor(const TAknsItemID &aId,
const TIntaIndex
)

Sets the color of the text via skin id.

Parameters

const TAknsItemID & aId
const TInt aIndexIndex within the color group

SetColor(const TDesC &, const TDesC &)

IMPORT_C voidSetColor(const TDesC &aTextColorTable,
const TDesC &aColorIndex
)

Sets the color of the text via skin id.

Parameters

const TDesC & aTextColorTableSkin-id name of the color group to use
const TDesC & aColorIndexIndex within the color group

SetHighlightRange(TInt, TInt, TRgb &, TRgb &)

IMPORT_C voidSetHighlightRange(TIntaStart,
TIntaEnd,
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.

Parameters

TInt aStartStartng index of Highlighted text.
TInt aEndEnding index of Highlighted text.
TRgb & aHighlightColorBackground color of highlighted text.
TRgb & aHighlightTextColor

SetLineSpacing(TInt, TLineSpacingUnits)

IMPORT_C voidSetLineSpacing(TIntaLineSpacing,
TLineSpacingUnitsaUnits = EPixels
)

Sets the line spacing for multiline text visual when the text wraps around.

TLineSpacingUnits.

Parameters

TInt aLineSpacingLine spacing between lines in multiline text visual. aUnits Defines the units of the line spacing.
TLineSpacingUnits aUnits = EPixels

SetMaxLineCount(TInt)

IMPORT_C voidSetMaxLineCount(TIntaMaxLineCount)

Sets the maximum number of lines displayed by the text visual. The default is KMaxTInt.

Parameters

TInt aMaxLineCount

SetOffset(const TAlfTimedPoint &)

IMPORT_C voidSetOffset(const TAlfTimedPoint &aOffset)

Sets offset for the text.

Parameters

const TAlfTimedPoint & aOffsettext offset.

SetShadowOpacity(const TAlfTimedValue &)

IMPORT_C voidSetShadowOpacity(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.

EnableShadow

Parameters

const TAlfTimedValue & aShadowOpacityShadow opacity

SetStyle(TAlfPreconfiguredTextStyle, TAlfBackgroundType)

IMPORT_C voidSetStyle(TAlfPreconfiguredTextStyleaStyle,
TAlfBackgroundTypeaBackgroundType = 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()

Parameters

TAlfPreconfiguredTextStyle aStyleText style.
TAlfBackgroundType aBackgroundType = EAlfBackgroundTypeLightText background type. Affects the color of the text. Defaults to EAlfBackgroundTypeLight (ie, black text will be used).

SetTextL(const TDesC &)

IMPORT_C voidSetTextL(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.

Parameters

const TDesC & aTextDescriptor containing the text.

SetTextStyle(TInt)

IMPORT_C voidSetTextStyle(TIntaTextStyleId)

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

Parameters

TInt aTextStyleIdText style ID provided by the text style manager.

SetWrapping(TLineWrap)

IMPORT_C voidSetWrapping(TLineWrapaWrap)

Sets the line wrapping mode.

Parameters

TLineWrap aWrapLine wrapping mode.

ShadowOpacity()

IMPORT_C TAlfTimedValueShadowOpacity()

Use CAlfDropShadow

Returns shadow opacity.

Style()

IMPORT_C TAlfPreconfiguredTextStyleStyle()

Accesses the text style of the text visual.

SubstringExtents(TUint, TUint)

IMPORT_C TRectSubstringExtents(TUintaStart,
TUintaEnd
)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()

Parameters

TUint aStart
TUint aEnd

Text()

IMPORT_C const TDesC &Text()const

Returns the text of the visual.

TextExtents()

IMPORT_C TSizeTextExtents()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()

TextStyle()

IMPORT_C TIntTextStyle()const

Accesses the text style id of the text visual.

Note:

This API should be used in preference to Style

UpdateChildrenLayout(TInt)

IMPORT_C voidUpdateChildrenLayout(TIntaTransitionTime = 0)[virtual]

Update the layout of all children. Subclasses can call this to recalculate the layout of all children.

Parameters

TInt aTransitionTime = 0Time for layout transition in milliseconds. Any negative value uses value given in CAlfEnv::StaticSetLayoutTransitionTime()

UpdateMesh(TBool)

voidUpdateMesh(TBoolaSynchronousUpdate = EFalse)

Parameters

TBool aSynchronousUpdate = EFalse

Wrapping()

IMPORT_C TLineWrapWrapping()const

Determines the visual's line wrapping mode.

Member Enumerations Documentation

Enum TLineSpacingUnits

Enumerators

EPixels

Line spacing is given in pixels

ETwips

Line spacing is given in twips

Enum TLineWrap

Enumerators

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.

Member Data Documentation

TTextVisualPrivateData * iTextVisualData

TTextVisualPrivateData *iTextVisualData[private]