TAknLayoutText Class Reference

API published in: S60 1st Ed

Link against: avkon.lib eikcore.lib

Capability Information

Required Capabilities

None


#include <aknutils.h>

Detailed Description

Low level drawing based on European LAF document (can be used by application's custom controls).

This class reads AVKON_LAYOUT_TEXT resources


Public Member Functions

IMPORT_C  TAknLayoutText ()
IMPORT_C void  LayoutText (const TRect &aParent, TInt aResourceId, const CFont *aCustomFont=0)
  Read resources and calculate information needed to draw text.
IMPORT_C void  LayoutText (const TRect &aParent, TResourceReader &aReader, const CFont *aCustomFont=0)
IMPORT_C void  LayoutText (const TRect &aParent, const AknLayoutUtils::SAknLayoutText &aLayout, const CFont *aCustomFont=0)
IMPORT_C void  LayoutText (const TRect &aParent, const TAknTextLineLayout &aLayout, const CFont *aCustomFont=0)
IMPORT_C void  LayoutText (const TRect &aParent, TInt fontid, TInt C, TInt l, TInt r, TInt B, TInt W, TInt J, const CFont *aCustomFont=0)
IMPORT_C void  DrawText (CGraphicsContext &aGc, const TDesC &aText) const
  Do the actual drawing, should be placed to control's Draw() method.
IMPORT_C void  DrawText (CGraphicsContext &aGc, const TDesC &aText, TBool aUseLogicalToVisualConversion) const
  In case of bidirectional text, which is already converted from logical to visual order, use this method with parameter aUseLogicalToVisualConversion EFalse.
IMPORT_C void  DrawText (CGraphicsContext &aGc, const TDesC &aText, TBool aUseLogicalToVisualConversion, const TRgb &aColor) const
IMPORT_C TRect  TextRect () const
  This returns rectangle that is used to draw the text.
const CFont *  Font () const
TRgb  Color () const
CGraphicsContext::TTextAlign  Align () const
TInt  BaselineOffset () const
  Returns the baseline position for the font set in this object.

Friends

class  CBubbleOutlookNumberEntry

Constructor & Destructor Documentation

IMPORT_C TAknLayoutText::TAknLayoutText  ) 
 

Member Function Documentation

CGraphicsContext::TTextAlign TAknLayoutText::Align  )  const [inline]
 
TInt TAknLayoutText::BaselineOffset  )  const
 

Returns the baseline position for the font set in this object.

This value, together with TextRect(), are the metrics that are used to parametrise a call to DrawText, for example: void CGraphicsContext::DrawText( const TDesC& aText, const TRect& aBox, TInt aBaselineOffset, TTextAlign aAlignment = ELeft, TInt aLeftMargin = 0);

TAknLayoutText's own DrawText methods are recommended, however.

Notice that this value is relative to the top of the TextRect() rectangle, which is generally made to bound all accents. Thus this offset value is usually larger than the CFont::AscentInPixels value.

Returns:
distance in pixels measured from the top of the textpane down to the baseline
TRgb TAknLayoutText::Color  )  const [inline]
 
IMPORT_C void TAknLayoutText::DrawText CGraphicsContext &  aGc,
const TDesC &  aText,
TBool  aUseLogicalToVisualConversion,
const TRgb &  aColor
const
 
IMPORT_C void TAknLayoutText::DrawText CGraphicsContext &  aGc,
const TDesC &  aText,
TBool  aUseLogicalToVisualConversion
const
 

In case of bidirectional text, which is already converted from logical to visual order, use this method with parameter aUseLogicalToVisualConversion EFalse.

IMPORT_C void TAknLayoutText::DrawText CGraphicsContext &  aGc,
const TDesC &  aText
const
 

Do the actual drawing, should be placed to control's Draw() method.

const CFont* TAknLayoutText::Font  )  const [inline]
 
IMPORT_C void TAknLayoutText::LayoutText const TRect &  aParent,
TInt  fontid,
TInt  C,
TInt  l,
TInt  r,
TInt  B,
TInt  W,
TInt  J,
const CFont *  aCustomFont = 0
 
IMPORT_C void TAknLayoutText::LayoutText const TRect &  aParent,
const TAknTextLineLayout &  aLayout,
const CFont *  aCustomFont = 0
 
IMPORT_C void TAknLayoutText::LayoutText const TRect &  aParent,
const AknLayoutUtils::SAknLayoutText aLayout,
const CFont *  aCustomFont = 0
 
IMPORT_C void TAknLayoutText::LayoutText const TRect &  aParent,
TResourceReader &  aReader,
const CFont *  aCustomFont = 0
 
IMPORT_C void TAknLayoutText::LayoutText const TRect &  aParent,
TInt  aResourceId,
const CFont *  aCustomFont = 0
 

Read resources and calculate information needed to draw text.

LayoutText() call should be placed to control's SizeChanged() method.

IMPORT_C TRect TAknLayoutText::TextRect  )  const
 

This returns rectangle that is used to draw the text.

This allows you to divide screen space for egul's TextUtils::ClearBetweenRect() without knowing exact coordinates => when coordinates change, your code does not need to change.


Friends And Related Function Documentation

friend class CBubbleOutlookNumberEntry [friend]
 

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top