CEikLabel Class Reference

#include <mw/eiklabel.h>

Link against: ConnectionUiUtilities.lib

class CEikLabel : public CEikAlignedControl

Inherits from

Protected Attributes
const CFont *iFont
TInt iGapBetweenLines
TUint8 iLabFlags
TUint8 iNumberOfLines
HBufC *iText
Public Member Enumerations
enumTTextEmphasis { ENoEmphasis, EPartialEmphasis, EFullEmphasis }
Protected Member Enumerations
enumTLabelFlags { EUnderlining, EStrikethrough, EUseLogicalToVisualConversion }
Public Member Functions
CEikLabel()
~CEikLabel()
IMPORT_C TIntBufferReserveLength()
IMPORT_C TSizeCalcMinimumSize(TPtrC &)
virtual IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidCropText()
IMPORT_C voidDisablePictographs()
virtual IMPORT_C voidDraw(const TRect &)
voidDrawToContext(CBitmapContext &, const TRgb *)
IMPORT_C voidEnablePictographsL(CAknPictographInterface &)
const CFont *Font()
virtual IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
virtual IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
virtual IMPORT_C voidHandleResourceChange(TInt)
TBool IsStrikethrough()
TBool IsUnderlined()
IMPORT_C TBoolLogicalToVisualConversionUsed()
virtual IMPORT_C TSizeMinimumSize()
TUint8 NumberOfLines()
IMPORT_C TIntPixelGapBetweenLines()
IMPORT_C voidSetBrushStyle(CWindowGc::TBrushStyle)
IMPORT_C voidSetBrushStyleFromContext()
IMPORT_C voidSetBufferReserveLengthL(TInt)
IMPORT_C voidSetEmphasis(TTextEmphasis)
IMPORT_C voidSetFont(const CFont *)
IMPORT_C voidSetLabelAlignment(TInt)
IMPORT_C voidSetPixelGapBetweenLines(TInt)
IMPORT_C voidSetStrikethrough(TBool)
IMPORT_C voidSetTextL(const TDesC &)
IMPORT_C voidSetUnderlining(TBool)
const TDesC *Text()
IMPORT_C voidUseLogicalToVisualConversion(TBool)
Protected Member Functions
virtual IMPORT_C voidWriteInternalStateL(RWriteStream &)
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikAlignedControl::iAlignment
CEikAlignedControl::iMargin
Inherited Enumerations
CCoeControl:TZoomType
Inherited Functions
CAknControl::CAknControl()
CAknControl::~CAknControl()
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()
CCoeControl::AccumulatedZoom()const
CCoeControl::ActivateGc()const
CCoeControl::ActivateL()
CCoeControl::BackedUpWindow()const
CCoeControl::Background()const
CCoeControl::CCoeControl()
CCoeControl::CCoeControl(CCoeEnv *)
CCoeControl::CCoeControl(const CCoeControl &)
CCoeControl::CCoeControlArray
CCoeControl::CapturesPointer()const
CCoeControl::ClaimPointerGrab(TBool)
CCoeControl::ClaimPointerGrab(TInt,TBool)
CCoeControl::CloseWindow()
CCoeControl::ComponentArrayExists()const
CCoeControl::ComponentControl(TInt)const
CCoeControl::Components()
CCoeControl::Components()const
CCoeControl::ControlContext()const
CCoeControl::ControlEnv()const
CCoeControl::CopyControlContextFrom(const CCoeControl *)
CCoeControl::CountComponentControls()const
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &)
CCoeControl::CreateBackedUpWindowL(RWindowTreeNode &,TDisplayMode)
CCoeControl::CreateWindowL()
CCoeControl::CreateWindowL(RWindowGroup *)
CCoeControl::CreateWindowL(RWindowTreeNode &)
CCoeControl::CreateWindowL(const CCoeControl *)
CCoeControl::CustomGc()const
CCoeControl::DeactivateGc()const
CCoeControl::DrawBackground(const TRect &)const
CCoeControl::DrawDeferred()const
CCoeControl::DrawForeground(const TRect &)const
CCoeControl::DrawNow()const
CCoeControl::DrawNow(const TRect &)const
CCoeControl::DrawableWindow()const
CCoeControl::EnableDragEvents()
CCoeControl::EnableReportControlStateChange(TBool)
CCoeControl::EnableWindowTransparency()
CCoeControl::FindBackground()const
CCoeControl::FindFontProvider()const
CCoeControl::FocusChanged(TDrawNow)
CCoeControl::GetColor(TInt,TRgb &)const
CCoeControl::GetGc()const
CCoeControl::GetHelpContext(TCoeHelpContext &)const
CCoeControl::GrabbingComponent()const
CCoeControl::GrabbingComponent(TInt)const
CCoeControl::HandleComponentControlsResourceChange(TInt)
CCoeControl::HandleControlArrayEventL(CCoeControlArray::TEvent,const CCoeControlArray *,CCoeControl *,TInt)
CCoeControl::HandlePointerBufferReadyL()
CCoeControl::HandleRedrawEvent(const TRect &)const
CCoeControl::HasBorder()const
CCoeControl::HitTest()const
CCoeControl::IgnoreEventsUntilNextPointerUp()
CCoeControl::Index(const CCoeControl *)const
CCoeControl::InitComponentArrayL()
CCoeControl::InputCapabilities()const
CCoeControl::IsActivated()const
CCoeControl::IsBackedUp()const
CCoeControl::IsBeingDestroyed()const
CCoeControl::IsBlank()const
CCoeControl::IsDimmed()const
CCoeControl::IsFocused()const
CCoeControl::IsNonFocusing()const
CCoeControl::IsReadyToDraw()const
CCoeControl::IsVisible()const
CCoeControl::LayoutManager()const
CCoeControl::MakeVisible(TBool)
CCoeControl::MaximumWidth()const
CCoeControl::MopSupplyObject(TTypeUid)
CCoeControl::NotifyFontChange(const CCoeFontProvider *)
CCoeControl::Observer()const
CCoeControl::OfferKeyEventL(const TKeyEvent &,TEventCode)
CCoeControl::OverrideColorL(TInt,TRgb)
CCoeControl::OwnsWindow()const
CCoeControl::Parent()
CCoeControl::Parent()const
CCoeControl::Position()const
CCoeControl::PositionChanged()
CCoeControl::PositionRelativeToScreen()const
CCoeControl::PrepareForFocusGainL()
CCoeControl::PrepareForFocusLossL()
CCoeControl::ProcessPointerBufferReadyL()
CCoeControl::ProcessPointerEventL(const TPointerEvent &)
CCoeControl::Rect()const
CCoeControl::RecursivelyMergeInputCapabilities(TCoeInputCapabilities &)const
CCoeControl::RecursivelyMergedInputCapabilities()const
CCoeControl::RefetchPixelMappingL()
CCoeControl::RemoveFromParent()
CCoeControl::ReportEventL(MCoeControlObserver::TCoeEvent)
CCoeControl::RequestRelayout(const CCoeControl *)
CCoeControl::ResetGc()const
CCoeControl::ScreenFont(const TCoeFont &)const
CCoeControl::SetAdjacent(TInt)
CCoeControl::SetAllowStrayPointers()
CCoeControl::SetBackground(const MCoeControlBackground *)
CCoeControl::SetBlank()
CCoeControl::SetCanDrawOutsideRect()
CCoeControl::SetComponentsToInheritVisibility(TBool)
CCoeControl::SetContainerWindowL(RBackedUpWindow &)
CCoeControl::SetContainerWindowL(RWindow &)
CCoeControl::SetContainerWindowL(const CCoeControl &)
CCoeControl::SetControlContext(MCoeControlContext *)
CCoeControl::SetCornerAndSize(TGulAlignment,const TSize &)
CCoeControl::SetCustomGc(CWindowGc *)
CCoeControl::SetDimmed(TBool)
CCoeControl::SetExtent(const TPoint &,const TSize &)
CCoeControl::SetExtentToWholeScreen()
CCoeControl::SetFocus(TBool,TDrawNow)
CCoeControl::SetFocusing(TBool)
CCoeControl::SetFontProviderL(const CCoeFontProvider &)
CCoeControl::SetGc(CWindowGc *)const
CCoeControl::SetGloballyCapturing(TBool)
CCoeControl::SetHitTest(const MCoeControlHitTest *)
CCoeControl::SetLayoutManagerL(MCoeLayoutManager *)
CCoeControl::SetMaximumWidth(TInt)
CCoeControl::SetMopParent(MObjectProvider *)
CCoeControl::SetNeighbor(CCoeControl *)
CCoeControl::SetNonFocusing()
CCoeControl::SetObserver(MCoeControlObserver *)
CCoeControl::SetParent(CCoeControl *)
CCoeControl::SetPointerCapture(TBool)
CCoeControl::SetPosition(const TPoint &)
CCoeControl::SetRect(const TRect &)
CCoeControl::SetSize(const TSize &)
CCoeControl::SetSizeWithoutNotification(const TSize &)
CCoeControl::SetTextBaselineSpacing(TInt)
CCoeControl::SetUniqueHandle(TInt)
CCoeControl::SetZoomFactorL(TInt,TZoomType)
CCoeControl::Size()const
CCoeControl::SizeChanged()
CCoeControl::SystemGc()const
CCoeControl::TextBaselineOffset(const TSize &)const
CCoeControl::TextDrawer(TInt)const
CCoeControl::UniqueHandle()const
CCoeControl::Window()const
CCoeControl::WriteInternalStateNowL(RWriteStream &)const
CCoeControl::ZoomWithType()const
CCoeControl::operator=(const CCoeControl &)
CCoeControl::~CCoeControl()
CEikAlignedControl::CEikAlignedControl()
CEikAlignedControl::SetAlignment(TGulAlignmentValue)
CEikAlignedControl::SetAllMarginsTo(TInt)
CEikAlignedControl::~CEikAlignedControl()

Detailed Description

Enables one or more lines of text to be displayed.

Member Attribute Documentation

iFont

const CFont *iFont[protected]

The label s font.

iGapBetweenLines

TInt iGapBetweenLines[protected]

The number of pixels between lines of text.

iLabFlags

TUint8 iLabFlags[protected]

The label s flags. These are used to set text emphasis and characteristics, such as underlining, and strikethrough.

iNumberOfLines

TUint8 iNumberOfLines[protected]

The label s number of lines of text.

iText

HBufC *iText[protected]

The label s text.

Member Enumeration Documentation

Enum TLabelFlags

Determines whether text is drawn with underlining or strike-through.

EnumeratorValueDescription
EUnderlining0x02

Text is drawn with underlining.

EStrikethrough0x04

Text is drawn with strike-through.

EUseLogicalToVisualConversion0x08

Determines that bi-directional algorithm still needs to be run against the set text string. This flag allows app to do logical-to-visual conversion in the application side -- since the bi-directional algorithm can only be run once for every text string, we need flagging like this to control whether the algorithm is run inside label or whether the application has already run it and we should not return the algorithm.

Enum TTextEmphasis

Determines text emphasis.

EnumeratorValueDescription
ENoEmphasis0x00

No emphasis.

EPartialEmphasis0x10

Partial emphasis.

EFullEmphasis0x20

Full emphasis.

Constructor & Destructor Documentation

CEikLabel ( )

IMPORT_CCEikLabel()

C++ default constructor.

~CEikLabel ( )

IMPORT_C~CEikLabel()

Destructor.

Member Function Documentation

BufferReserveLength ( )

IMPORT_C TIntBufferReserveLength()const

Gets the buffer reserve length.

Returns: The buffer reserve length.

CalcMinimumSize ( TPtrC & )

IMPORT_C TSizeCalcMinimumSize(TPtrC &aText)const

Gets the minimum size required to draw the specified text.

ParameterDescription
aTextThe text to be drawn.

Returns: The minimum size required to draw the text.

ConstructFromResourceL ( TResourceReader & )

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

Reimplemented from CCoeControl::ConstructFromResourceL(TResourceReader &)

From CCoeControl.

Constructs the control from a resource file.

ParameterDescription
aReaderInterprets resource data read from a resource file.

CropText ( )

IMPORT_C voidCropText()

Sets a flag to indicate that the text needs to be truncated with 3 dots.

DisablePictographs ( )

IMPORT_C voidDisablePictographs()

Disables pictograph drawing in the label text. Only effective in Japanese variant. By default, it is disabled.

Since
S60 2.6

Draw ( const TRect & )

IMPORT_C voidDraw(const TRect &aRect)const [virtual]

Reimplemented from CCoeControl::Draw(const TRect &)const

From CCoeControl.

Draw a control - called by window server. All controls, except blank controls, should implement this function. The default implementation draws a blank control.

This function is used for window server-initiated redrawing of controls, and for some application-initiated drawing. It should be implemented by each control, but is only called from within CCoeControl's member functions, and not from the derived class. For this reason it is a private member function of CCoeControl.

panic
EEikPanicLabelNullText Panics if label text has not been defined.
ParameterDescription
aRectThe region of the control to be redrawn. Co-ordinates are relative to the control's origin (top left corner).

DrawToContext ( CBitmapContext &, const TRgb * )

voidDrawToContext(CBitmapContext &aContext,
const TRgb *aOverrideColor
)const

EnablePictographsL ( CAknPictographInterface & )

IMPORT_C voidEnablePictographsL(CAknPictographInterface &aInterface)

Enables pictograph drawing in the label text. Only effective in Japanese variant. By default, it is disabled.

Since
S60 2.6
ParameterDescription
aInterfaceUsed pictograph interface owned by the caller.

Font ( )

const CFont *Font()const [inline]

Gets the label s font.

Returns: The label s font.

GetColorUseListL ( CArrayFix< TCoeColorUse > & )

IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &aColorUseList)const [virtual]

From CCoeControl.

Gets the list of logical colours used to draw the control.

ParameterDescription
aColorUseListThe colour list.

HandlePointerEventL ( const TPointerEvent & )

IMPORT_C voidHandlePointerEventL(const TPointerEvent &aPointerEvent)[virtual]

From CCoeControl.

Handles pointer events. This function gets called whenever a pointer event occurs in the control, i.e. when the pointer is within the control's extent, or when the control has grabbed the pointer. The control should implement this function to handle pointer events.

Note: events of type EButton1Down are processed before HandlePointerEventL() is called, in order to transfer keyboard focus to the control in which the EButton1Down event occurred.

If overriding HandlePointerEventL(), the implementation must include a base call to CCoeControl's HandlePointerEventL().

ParameterDescription
aPointerEventThe pointer event.

HandleResourceChange ( TInt )

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

From CCoeControl.

Handles a change to the control's resources.

ParameterDescription
aTypeA message UID value.

IsStrikethrough ( )

TBool IsStrikethrough()const [inline]

Tests label strike-through.

Returns: ETrue if the label is set to be drawn with a line through it. EFalse if the label is not set to be drawn with a line through it.

IsUnderlined ( )

TBool IsUnderlined()const [inline]

Tests whether the label is underlined.

Returns: ETrue if the label is set as underlined. EFalse if the label is not set as underlined.

LogicalToVisualConversionUsed ( )

IMPORT_C TBoolLogicalToVisualConversionUsed()const

Gets information whether label is performing logical to visual conversion or not.

Returns: ETrue if label does logical to visual conversion. EFalse if not.

MinimumSize ( )

IMPORT_C TSizeMinimumSize()[virtual]

Reimplemented from CCoeControl::MinimumSize()

From CCoeControl.

Sets the control's minimum required size.

Returns: Minimum size required by the control.

NumberOfLines ( )

TUint8 NumberOfLines()[inline]

Gets the number of lines of text in the label.

Returns: The number of lines of text.

PixelGapBetweenLines ( )

IMPORT_C TIntPixelGapBetweenLines()const

Gets the number of pixels between two lines of text.

Returns: The number of pixels between two lines of text.

SetBrushStyle ( CWindowGc::TBrushStyle )

IMPORT_C voidSetBrushStyle(CWindowGc::TBrushStyleaBrushStyle)

Sets the brush style to be used from aBrushStyle, this overwrites the brush style set via the Control Context.

ParameterDescription
aBrushStyleA brush style.

SetBrushStyleFromContext ( )

IMPORT_C voidSetBrushStyleFromContext()

Sets the brush style to be used from the Control Context, this overwrites the brush style set via the CEikLabel::SetBrushStyle().

SetBufferReserveLengthL ( TInt )

IMPORT_C voidSetBufferReserveLengthL(TIntaLength)

Sets the buffer reserve length.

ParameterDescription
aLengthThe buffer reserve length.

SetEmphasis ( TTextEmphasis )

IMPORT_C voidSetEmphasis(TTextEmphasisaEmphasis)

Sets the label's text emphasis.

ParameterDescription
aEmphasisThe label's text emphasis.

SetFont ( const CFont * )

IMPORT_C voidSetFont(const CFont *aFont)

Sets the label s font.

ParameterDescription
aFontThe label's font.

SetLabelAlignment ( TInt )

IMPORT_C voidSetLabelAlignment(TIntaAlignment)

Sets the labels alignment. Overwrites alignment set via CEikAlignedControl.

ParameterDescription
aAlignmentShould be one of { ELayoutAlignNone, ELayoutAlignCenter, ELayoutAlignLeft, ELayoutAlignRight, ELayoutAlignBidi } defined in Avkon.hrh.

SetPixelGapBetweenLines ( TInt )

IMPORT_C voidSetPixelGapBetweenLines(TIntaGap)

Sets the gap between lines. Gap has a particular definition here. It is defined to be: "baselines separation" - CFont::HeightInPixels()

ParameterDescription
aGapPixels gap to set between lines.

SetStrikethrough ( TBool )

IMPORT_C voidSetStrikethrough(TBoolaStrikethrough)

Sets the label strike-through.

ParameterDescription
aStrikethroughETrue to set the label to be drawn with a line through it. EFalse to set the label to not be drawn with a line through it.

SetTextL ( const TDesC & )

IMPORT_C voidSetTextL(const TDesC &aText)

Sets the label s text.

panic
EEikPanicLabelNullText Panics if label text has not been defined.
ParameterDescription
aTextThe label s text.

SetUnderlining ( TBool )

IMPORT_C voidSetUnderlining(TBoolaUnderLining)

Sets the label underlining.

ParameterDescription
aUnderLiningETrue to set the label as underlined. EFalse to set the label as not underlined.

Text ( )

const TDesC *Text()const [inline]

Gets the label s text.

Returns: The label s text.

UseLogicalToVisualConversion ( TBool )

IMPORT_C voidUseLogicalToVisualConversion(TBoolaUseConversion)

Enables or disables logical to visual conversion when label text is drawn. By default, it is enabled. If you perform the conversion yourself and give visual text (in scrictly left-to-right order) to label, you should disable the conversion in label. Note that label does not perform cropping if logical to visual conversion is disabled.

ParameterDescription
aUseConversionWhether label should perform logical to visual conversion or not.

WriteInternalStateL ( RWriteStream & )

IMPORT_C voidWriteInternalStateL(RWriteStream &aWriteStream)const [protected, virtual]

From CCoeControl.

Writes the internal state of the control and its components to a stream. Does nothing in release mode. Designed to be overidden and base called by subclasses.

ParameterDescription
aWriteStreamThe write stream.