CEikLabel Class Reference

class CEikLabel : public CEikAlignedControl

Enables one or more lines of text to be displayed.

Public Member Functions
CEikLabel()
~CEikLabel()
IMPORT_C TIntBufferReserveLength()
IMPORT_C TSizeCalcMinimumSize(TPtrC &)
IMPORT_C voidConstructFromResourceL(TResourceReader &)
IMPORT_C voidCropText()
IMPORT_C voidDisablePictographs()
IMPORT_C voidDraw(const TRect &)
voidDrawToContext(CBitmapContext &, const TRgb *)
IMPORT_C voidEnablePictographsL(CAknPictographInterface &)
const CFont *Font()
IMPORT_C voidGetColorUseListL(CArrayFix< TCoeColorUse > &)
IMPORT_C voidHandlePointerEventL(const TPointerEvent &)
IMPORT_C voidHandleResourceChange(TInt)
TBool IsStrikethrough()
TBool IsUnderlined()
IMPORT_C TBoolLogicalToVisualConversionUsed()
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
IMPORT_C voidWriteInternalStateL(RWriteStream &)
Private Member Functions
TBool CheckAndCreateExtension()
voidConvertColorsForOutlineEffect(TRgb &, TRgb &)
IMPORT_C void *ExtensionInterface(TUid)
TInt HeightInPixels()
TInt HeightInPixels(const TDesC &)
IMPORT_C voidReserved_2()
voidSetupGcForEmphasis(CGraphicsContext &)
TInt WidthInPixels(TPtrC &)
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::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()
Public Member Enumerations
enumTTextEmphasis { ENoEmphasis = 0x00, EPartialEmphasis = 0x10, EFullEmphasis = 0x20 }
Protected Member Enumerations
enumTLabelFlags { EUnderlining = 0x02, EStrikethrough = 0x04, EUseLogicalToVisualConversion = 0x08 }
Inherited Enumerations
CCoeControl:TZoomType
Protected Attributes
const CFont *iFont
TInt iGapBetweenLines
TUint8 iLabFlags
TUint8 iNumberOfLines
HBufC *iText
Private Attributes
CEikLabelExtension *iExtension
TInt iReserveLength
TInt iSpare
Inherited Attributes
CCoeControl::iCoeEnv
CCoeControl::iContext
CCoeControl::iPosition
CCoeControl::iSize
CEikAlignedControl::iAlignment
CEikAlignedControl::iMargin

Constructor & Destructor Documentation

CEikLabel()

IMPORT_CCEikLabel()

C++ default constructor.

~CEikLabel()

IMPORT_C~CEikLabel()

Destructor.

Member Functions Documentation

BufferReserveLength()

IMPORT_C TIntBufferReserveLength()const

Gets the buffer reserve length.

CalcMinimumSize(TPtrC &)

IMPORT_C TSizeCalcMinimumSize(TPtrC &aText)const

Gets the minimum size required to draw the specified text.

Parameters

TPtrC & aTextThe text to be drawn.

CheckAndCreateExtension()

TBool CheckAndCreateExtension()[private]

ConstructFromResourceL(TResourceReader &)

IMPORT_C voidConstructFromResourceL(TResourceReader &aReader)[virtual]

From CCoeControl.

Constructs the control from a resource file.

Parameters

TResourceReader & aReaderInterprets resource data read from a resource file.

ConvertColorsForOutlineEffect(TRgb &, TRgb &)

voidConvertColorsForOutlineEffect(TRgb &aFillColor,
TRgb &aOutlineColor
)const [private]

Parameters

TRgb & aFillColor
TRgb & aOutlineColor

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]

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.

Parameters

const TRect & 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

Parameters

CBitmapContext & aContext
const TRgb * aOverrideColor

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

Parameters

CAknPictographInterface & aInterfaceUsed pictograph interface owned by the caller.

ExtensionInterface(TUid)

IMPORT_C void *ExtensionInterface(TUidaInterface)[private, virtual]

From CAknControl.

Parameters

TUid aInterface

Font()

const CFont *Font()const [inline]

Gets 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.

Gets the list of logical colors employed in the drawing of the control, paired with an explanation of how they are used. Appends the list to aColorUseList.

Since
ER5U

Parameters

CArrayFix< TCoeColorUse > & 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().

Parameters

const TPointerEvent & aPointerEventThe pointer event.

HandleResourceChange(TInt)

IMPORT_C voidHandleResourceChange(TIntaType)[virtual]

From CCoeControl.

Handles a change to the control's resources.

Handles a change to the control's resources of type aType which are shared across the environment, e.g. colors or fonts.

Since
ER5U

Parameters

TInt aTypeA message UID value.

HeightInPixels()

TInt HeightInPixels()const [private]

HeightInPixels(const TDesC &)

TInt HeightInPixels(const TDesC &aText)const [private]

Parameters

const TDesC & aText

IsStrikethrough()

TBool IsStrikethrough()const [inline]

Tests label strike-through.

IsUnderlined()

TBool IsUnderlined()const [inline]

Tests whether the label is underlined.

LogicalToVisualConversionUsed()

IMPORT_C TBoolLogicalToVisualConversionUsed()const

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

MinimumSize()

IMPORT_C TSizeMinimumSize()[virtual]

From CCoeControl.

Sets the control's minimum required size.

NumberOfLines()

TUint8 NumberOfLines()[inline]

Gets the number of lines of text in the label.

PixelGapBetweenLines()

IMPORT_C TIntPixelGapBetweenLines()const

Gets the number of pixels between two lines of text.

Reserved_2()

IMPORT_C voidReserved_2()[private, virtual]

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.

Parameters

CWindowGc::TBrushStyle 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.

Parameters

TInt aLengthThe buffer reserve length.

SetEmphasis(TTextEmphasis)

IMPORT_C voidSetEmphasis(TTextEmphasisaEmphasis)

Sets the label's text emphasis.

Parameters

TTextEmphasis aEmphasisThe label's text emphasis.

SetFont(const CFont *)

IMPORT_C voidSetFont(const CFont *aFont)

Sets the label s font.

Parameters

const CFont * aFontThe label's font.

SetLabelAlignment(TInt)

IMPORT_C voidSetLabelAlignment(TIntaAlignment)

Sets the labels alignment. Overwrites alignment set via CEikAlignedControl.

Parameters

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

Parameters

TInt aGapPixels gap to set between lines.

SetStrikethrough(TBool)

IMPORT_C voidSetStrikethrough(TBoolaStrikethrough)

Sets the label strike-through.

Parameters

TBool 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.

Parameters

const TDesC & aTextThe label s text.

SetUnderlining(TBool)

IMPORT_C voidSetUnderlining(TBoolaUnderLining)

Sets the label underlining.

Parameters

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

SetupGcForEmphasis(CGraphicsContext &)

voidSetupGcForEmphasis(CGraphicsContext &aGc)const [private]

Parameters

CGraphicsContext & aGc

Text()

const TDesC *Text()const [inline]

Gets 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.

Parameters

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

WidthInPixels(TPtrC &)

TInt WidthInPixels(TPtrC &aText)const [private]

Parameters

TPtrC & aText

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.

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

Parameters

RWriteStream & aWriteStreamThe write stream.

Member Enumerations Documentation

Enum TLabelFlags

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

Enumerators

EUnderlining = 0x02

Text is drawn with underlining.

EStrikethrough = 0x04

Text is drawn with strike-through.

EUseLogicalToVisualConversion = 0x08

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.

Enumerators

ENoEmphasis = 0x00

No emphasis.

EPartialEmphasis = 0x10

Partial emphasis.

EFullEmphasis = 0x20

Full emphasis.

Member Data Documentation

CEikLabelExtension * iExtension

CEikLabelExtension *iExtension[private]

const CFont * iFont

const CFont *iFont[protected]

The label s font.

TInt iGapBetweenLines

TInt iGapBetweenLines[protected]

The number of pixels between lines of text.

TUint8 iLabFlags

TUint8 iLabFlags[protected]

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

TUint8 iNumberOfLines

TUint8 iNumberOfLines[protected]

The label s number of lines of text.

TInt iReserveLength

TInt iReserveLength[private]

TInt iSpare

TInt iSpare[private]

HBufC * iText

HBufC *iText[protected]

The label s text.