TDrawTextLayoutContext Class Reference

class TDrawTextLayoutContext

Parameters used by functions that draw text.

An object of this class is passed to CTextLayout::DrawL() and to InvertRangeL(). The draw context includes the view rectangle, the graphics context, the background colour and the margin widths.

You only need to use this class directly when you are using a CTextLayout object which is not owned by a CTextView object.

Public Member Functions
TDrawTextLayoutContext()
IMPORT_C TIntDisplayHeight()
IMPORT_C TBoolDrawGraphics()
TUint DrawMode()
IMPORT_C TBoolDrawText()
IMPORT_C TRectGutterMargin()
IMPORT_C TBoolIsGutterMargin()
IMPORT_C TBoolIsLabelMargin()
IMPORT_C TRectLabelMargin()
IMPORT_C TBoolParagraphFillTextOnly()
IMPORT_C CGraphicsContext *PictureGc()
IMPORT_C CGraphicsContext *PrimaryGc()
IMPORT_C voidSetBitmapGc(CBitmapContext *, CBitmapContext *)
IMPORT_C voidSetClipping(TBool)
IMPORT_C voidSetDrawGraphicsOnly()
voidSetDrawMode(TUint)
IMPORT_C voidSetDrawTextAndGraphics()
IMPORT_C voidSetDrawTextOnly()
IMPORT_C voidSetDrawToEveryPixel(TBool)
IMPORT_C voidSetGc(CGraphicsContext *, CGraphicsContext *)
IMPORT_C voidSetParagraphFillTextOnly(TBool)
IMPORT_C voidSetTextColorOverride(const TRgb *)
IMPORT_C voidSetWindowGc(CWindowGc *, CWindowGc *)
IMPORT_C TRectTextArea()
IMPORT_C const TRgb *TextOverrideColor()
IMPORT_C voidTextToWindow(TPoint &)
IMPORT_C voidTextToWindow(TRect &)
IMPORT_C TPointTopLeftText()
IMPORT_C TPointTopLeftTextArea()
IMPORT_C TRectTotalMargin()
IMPORT_C TBoolUseBackgroundColor()
IMPORT_C TBoolUseClippingRect()
IMPORT_C TBoolUseGcClear()
TBool UseWindowGc()
IMPORT_C voidWindowToText(TPoint &)
IMPORT_C voidWindowToText(TRect &)
Private Member Enumerations
enumTDrawMode {
EFDrawText = 0x001, EFDrawGraphics = 0x002, EFUseClippingRect = 0x004, EFUseWindowGc = 0x008, EFUseGcClear = 0x020, EFUseBackgroundColor = 0x040, EFUseOverrideTextColor = 0x080, EFParagraphFillTextOnly = 0x100, EFAllFlags = 0xfff
}
Public Attributes
TLogicalRgb iBackgroundColor
TInt iGutterMarginWidth
TInt iLabelMarginWidth
TInt iTextStartX
TRect iViewRect
Private Attributes
TUint iDrawMode
CGraphicsContext *iGc
TLogicalRgb iOverrideTextColor
CGraphicsContext *iPictureGc

Constructor & Destructor Documentation

TDrawTextLayoutContext()

IMPORT_CTDrawTextLayoutContext()

Member Functions Documentation

DisplayHeight()

IMPORT_C TIntDisplayHeight()const

DrawGraphics()

IMPORT_C TBoolDrawGraphics()const

DrawMode()

TUint DrawMode()const

DrawText()

IMPORT_C TBoolDrawText()const

GutterMargin()

IMPORT_C TRectGutterMargin()const

IsGutterMargin()

IMPORT_C TBoolIsGutterMargin()const

IsLabelMargin()

IMPORT_C TBoolIsLabelMargin()const

LabelMargin()

IMPORT_C TRectLabelMargin()const

ParagraphFillTextOnly()

IMPORT_C TBoolParagraphFillTextOnly()const

PictureGc()

IMPORT_C CGraphicsContext *PictureGc()const

PrimaryGc()

IMPORT_C CGraphicsContext *PrimaryGc()const

SetBitmapGc(CBitmapContext *, CBitmapContext *)

IMPORT_C voidSetBitmapGc(CBitmapContext *aGc,
CBitmapContext *aPictureGc = NULL
)

Parameters

CBitmapContext * aGc
CBitmapContext * aPictureGc = NULL

SetClipping(TBool)

IMPORT_C voidSetClipping(TBoolaClipping)

Parameters

TBool aClipping

SetDrawGraphicsOnly()

IMPORT_C voidSetDrawGraphicsOnly()

SetDrawMode(TUint)

voidSetDrawMode(TUintaDrawMode)

Parameters

TUint aDrawMode

SetDrawTextAndGraphics()

IMPORT_C voidSetDrawTextAndGraphics()

SetDrawTextOnly()

IMPORT_C voidSetDrawTextOnly()

SetDrawToEveryPixel(TBool)

IMPORT_C voidSetDrawToEveryPixel(TBoolaDrawToEveryPixel)

Parameters

TBool aDrawToEveryPixel

SetGc(CGraphicsContext *, CGraphicsContext *)

IMPORT_C voidSetGc(CGraphicsContext *aGc,
CGraphicsContext *aPictureGc = NULL
)

Parameters

CGraphicsContext * aGc
CGraphicsContext * aPictureGc = NULL

SetParagraphFillTextOnly(TBool)

IMPORT_C voidSetParagraphFillTextOnly(TBoolaFillTextOnly)

Parameters

TBool aFillTextOnly

SetTextColorOverride(const TRgb *)

IMPORT_C voidSetTextColorOverride(const TRgb *aOverrideColor)

Parameters

const TRgb * aOverrideColor

SetWindowGc(CWindowGc *, CWindowGc *)

IMPORT_C voidSetWindowGc(CWindowGc *aGc,
CWindowGc *aPictureGc = NULL
)

Parameters

CWindowGc * aGc
CWindowGc * aPictureGc = NULL

TextArea()

IMPORT_C TRectTextArea()const

TextOverrideColor()

IMPORT_C const TRgb *TextOverrideColor()const

TextToWindow(TPoint &)

IMPORT_C voidTextToWindow(TPoint &aTextAreaPos)const

Parameters

TPoint & aTextAreaPos

TextToWindow(TRect &)

IMPORT_C voidTextToWindow(TRect &aRect)const

Parameters

TRect & aRect

TopLeftText()

IMPORT_C TPointTopLeftText()const

TopLeftTextArea()

IMPORT_C TPointTopLeftTextArea()const

TotalMargin()

IMPORT_C TRectTotalMargin()const

UseBackgroundColor()

IMPORT_C TBoolUseBackgroundColor()const

UseClippingRect()

IMPORT_C TBoolUseClippingRect()const

UseGcClear()

IMPORT_C TBoolUseGcClear()const

UseWindowGc()

TBool UseWindowGc()const

WindowToText(TPoint &)

IMPORT_C voidWindowToText(TPoint &aWinPos)const

Parameters

TPoint & aWinPos

WindowToText(TRect &)

IMPORT_C voidWindowToText(TRect &aRect)const

Parameters

TRect & aRect

Member Enumerations Documentation

Enum TDrawMode

Enumerators

EFDrawText = 0x001
EFDrawGraphics = 0x002
EFUseClippingRect = 0x004
EFUseWindowGc = 0x008
EFUseGcClear = 0x020
EFUseBackgroundColor = 0x040
EFUseOverrideTextColor = 0x080
EFParagraphFillTextOnly = 0x100
EFAllFlags = 0xfff

Member Data Documentation

TLogicalRgb iBackgroundColor

TLogicalRgb iBackgroundColor

The background colour for the view rectangle. The background colour is used to fill the parts of the view rectangle in which text cannot appear, for example, below the last line of the document and in the label, line cursor and left text margins.

TUint iDrawMode

TUint iDrawMode[private]

CGraphicsContext * iGc

CGraphicsContext *iGc[private]

TInt iGutterMarginWidth

TInt iGutterMarginWidth

The gutter margin width (also known as the line cursor margin width). By default zero.

TInt iLabelMarginWidth

TInt iLabelMarginWidth

The label margin width. By default zero. Must have the same value as the label margin width as set in the text layout object.

TLogicalRgb iOverrideTextColor

TLogicalRgb iOverrideTextColor[private]

CGraphicsContext * iPictureGc

CGraphicsContext *iPictureGc[private]

TInt iTextStartX

TInt iTextStartX

The horizontal offset between window coordinates and text layout coordinates.

TRect iViewRect

TRect iViewRect

The view rectangle (specified in window coordinates). This is used to set the area in which text can be drawn. Text can only be drawn within the intersection between the text area and the aDrawRect parameter passed to CTextLayout::DrawL() or InvertRangeL().