CEikLabel Class Reference

class CEikLabel : public CEikAlignedControl

Enables one or more lines of text to be displayed.

Public Member Functions
CEikLabel ()
~CEikLabel ()
IMPORT_C TInt BufferReserveLength ()
IMPORT_C TSize CalcMinimumSize ( TPtrC &)
IMPORT_C void ConstructFromResourceL ( TResourceReader &)
IMPORT_C void CropText ()
IMPORT_C void DisablePictographs ()
IMPORT_C void Draw (const TRect &)
void DrawToContext ( CBitmapContext &, const TRgb *)
IMPORT_C void EnablePictographsL (CAknPictographInterface &)
const CFont * Font ()
IMPORT_C void GetColorUseListL ( CArrayFix < TCoeColorUse > &)
IMPORT_C void HandlePointerEventL (const TPointerEvent &)
IMPORT_C void HandleResourceChange ( TInt )
TBool IsStrikethrough ()
TBool IsUnderlined ()
IMPORT_C TBool LogicalToVisualConversionUsed ()
IMPORT_C TSize MinimumSize ()
TUint8 NumberOfLines ()
IMPORT_C TInt PixelGapBetweenLines ()
IMPORT_C void SetBrushStyle ( CWindowGc::TBrushStyle )
IMPORT_C void SetBrushStyleFromContext ()
IMPORT_C void SetBufferReserveLengthL ( TInt )
IMPORT_C void SetEmphasis ( TTextEmphasis )
IMPORT_C void SetFont (const CFont *)
IMPORT_C void SetLabelAlignment ( TInt )
IMPORT_C void SetPixelGapBetweenLines ( TInt )
IMPORT_C void SetStrikethrough ( TBool )
IMPORT_C void SetTextL (const TDesC &)
IMPORT_C void SetUnderlining ( TBool )
const TDesC * Text ()
IMPORT_C void UseLogicalToVisualConversion ( TBool )
Protected Member Functions
IMPORT_C void WriteInternalStateL ( RWriteStream &)
Private Member Functions
TBool CheckAndCreateExtension ()
void ConvertColorsForOutlineEffect ( TRgb &, TRgb &)
IMPORT_C void * ExtensionInterface ( TUid )
TInt HeightInPixels ()
TInt HeightInPixels (const TDesC &)
IMPORT_C void Reserved_2 ()
void SetupGcForEmphasis ( 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
enum TTextEmphasis { ENoEmphasis  = 0x00, EPartialEmphasis  = 0x10, EFullEmphasis  = 0x20 }
Protected Member Enumerations
enum TLabelFlags { 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_C CEikLabel ( )

C++ default constructor.

~CEikLabel()

IMPORT_C ~CEikLabel ( )

Destructor.

Member Functions Documentation

BufferReserveLength()

IMPORT_C TInt BufferReserveLength ( ) const

Gets the buffer reserve length.

CalcMinimumSize(TPtrC &)

IMPORT_C TSize CalcMinimumSize ( TPtrC & aText ) const

Gets the minimum size required to draw the specified text.

Parameters

TPtrC & aText The text to be drawn.

CheckAndCreateExtension()

TBool CheckAndCreateExtension ( ) [private]

ConstructFromResourceL(TResourceReader &)

IMPORT_C void ConstructFromResourceL ( TResourceReader & aReader ) [virtual]

From CCoeControl .

Constructs the control from a resource file.

Parameters

TResourceReader & aReader Interprets resource data read from a resource file.

ConvertColorsForOutlineEffect(TRgb &, TRgb &)

void ConvertColorsForOutlineEffect ( TRgb & aFillColor,
TRgb & aOutlineColor
) const [private]

Parameters

TRgb & aFillColor
TRgb & aOutlineColor

CropText()

IMPORT_C void CropText ( )

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

DisablePictographs()

IMPORT_C void DisablePictographs ( )

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 void Draw ( 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 & aRect The region of the control to be redrawn. Co-ordinates are relative to the control's origin (top left corner).

DrawToContext(CBitmapContext &, const TRgb *)

void DrawToContext ( CBitmapContext & aContext,
const TRgb * aOverrideColor
) const

Parameters

CBitmapContext & aContext
const TRgb * aOverrideColor

EnablePictographsL(CAknPictographInterface &)

IMPORT_C void EnablePictographsL ( 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 & aInterface Used pictograph interface owned by the caller.

ExtensionInterface(TUid)

IMPORT_C void * ExtensionInterface ( TUid aInterface ) [private, virtual]

Parameters

TUid aInterface

Font()

const CFont * Font ( ) const [inline]

Gets the label s font.

GetColorUseListL(CArrayFix< TCoeColorUse > &)

IMPORT_C void GetColorUseListL ( 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 > & aColorUseList The colour list.

HandlePointerEventL(const TPointerEvent &)

IMPORT_C void HandlePointerEventL ( 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 & aPointerEvent The pointer event.

HandleResourceChange(TInt)

IMPORT_C void HandleResourceChange ( TInt aType ) [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 aType A 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 TBool LogicalToVisualConversionUsed ( ) const

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

MinimumSize()

IMPORT_C TSize MinimumSize ( ) [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 TInt PixelGapBetweenLines ( ) const

Gets the number of pixels between two lines of text.

Reserved_2()

IMPORT_C void Reserved_2 ( ) [private, virtual]

SetBrushStyle(CWindowGc::TBrushStyle)

IMPORT_C void SetBrushStyle ( CWindowGc::TBrushStyle aBrushStyle )

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

Parameters

CWindowGc::TBrushStyle aBrushStyle A brush style.

SetBrushStyleFromContext()

IMPORT_C void SetBrushStyleFromContext ( )

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 void SetBufferReserveLengthL ( TInt aLength )

Sets the buffer reserve length.

Parameters

TInt aLength The buffer reserve length.

SetEmphasis(TTextEmphasis)

IMPORT_C void SetEmphasis ( TTextEmphasis aEmphasis )

Sets the label's text emphasis.

Parameters

TTextEmphasis aEmphasis The label's text emphasis.

SetFont(const CFont *)

IMPORT_C void SetFont ( const CFont * aFont )

Sets the label s font.

Parameters

const CFont * aFont The label's font.

SetLabelAlignment(TInt)

IMPORT_C void SetLabelAlignment ( TInt aAlignment )

Sets the labels alignment. Overwrites alignment set via CEikAlignedControl .

Parameters

TInt aAlignment Should be one of { ELayoutAlignNone, ELayoutAlignCenter, ELayoutAlignLeft, ELayoutAlignRight, ELayoutAlignBidi } defined in Avkon.hrh.

SetPixelGapBetweenLines(TInt)

IMPORT_C void SetPixelGapBetweenLines ( TInt aGap )

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

Parameters

TInt aGap Pixels gap to set between lines.

SetStrikethrough(TBool)

IMPORT_C void SetStrikethrough ( TBool aStrikethrough )

Sets the label strike-through.

Parameters

TBool aStrikethrough ETrue 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 void SetTextL ( const TDesC & aText )

Sets the label s text.

panic
EEikPanicLabelNullText Panics if label text has not been defined.

Parameters

const TDesC & aText The label s text.

SetUnderlining(TBool)

IMPORT_C void SetUnderlining ( TBool aUnderLining )

Sets the label underlining.

Parameters

TBool aUnderLining ETrue to set the label as underlined. EFalse to set the label as not underlined.

SetupGcForEmphasis(CGraphicsContext &)

void SetupGcForEmphasis ( CGraphicsContext & aGc ) const [private]

Parameters

CGraphicsContext & aGc

Text()

const TDesC * Text ( ) const [inline]

Gets the label s text.

UseLogicalToVisualConversion(TBool)

IMPORT_C void UseLogicalToVisualConversion ( TBool aUseConversion )

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 aUseConversion Whether label should perform logical to visual conversion or not.

WidthInPixels(TPtrC &)

TInt WidthInPixels ( TPtrC & aText ) const [private]

Parameters

TPtrC & aText

WriteInternalStateL(RWriteStream &)

IMPORT_C void WriteInternalStateL ( 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 & aWriteStream The 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.