Location:
FRMTLAY.H
Link against: form.lib
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.
Defined in TDrawTextLayoutContext
:
DisplayHeight()
, DrawGraphics()
, DrawText()
, GutterMargin()
, IsGutterMargin()
, IsLabelMargin()
, LabelMargin()
, ParagraphFillTextOnly()
, PictureGc()
, PrimaryGc()
, SetBitmapGc()
, SetClipping()
, SetDrawGraphicsOnly()
, SetDrawTextAndGraphics()
, SetDrawTextOnly()
, SetDrawToEveryPixel()
, SetGc()
, SetParagraphFillTextOnly()
, SetTextColorOverride()
, SetWindowGc()
, TDrawTextLayoutContext()
, TextArea()
, TextOverrideColor()
, TextToWindow()
, TextToWindow()
, TopLeftText()
, TopLeftTextArea()
, TotalMargin()
, UseBackgroundColor()
, UseClippingRect()
, UseGcClear()
, WindowToText()
, WindowToText()
, iBackgroundColor
, iGutterMarginWidth
, iLabelMarginWidth
, iTextStartX
, iViewRect
IMPORT_C TDrawTextLayoutContext();
Default C++ constructor.
This constructs a fully initialized TDrawTextLayoutContext object. Its view rectangle, iLabelMarginWidth and iGutterMarginWidth and iTextStartX are all initialized to zero, the background colour is initialized to the default system background colour, text and graphics are set to be drawn and clipping is set. The graphics context is initialised to null.
IMPORT_C void SetGc(CGraphicsContext *aGc, CGraphicsContext *aPictureGc=0);
Sets the graphics context for drawing text and pictures.
|
IMPORT_C void SetBitmapGc(CBitmapContext *aGc, CBitmapContext *aPictureGc=0);
|
IMPORT_C void SetWindowGc(CWindowGc *aGc, CWindowGc *aPictureGc=0);
|
IMPORT_C void SetDrawToEveryPixel(TBool aDrawToEveryPixel);
Sets whether the background colour as specified by iBackgroundColor should be drawn.
|
IMPORT_C void SetTextColorOverride(const TRgb *aOverrideColor);
Overrides the existing text colour, so that when redrawn, all text has the colour specified, rather than the colour which is set in the text object. To return the text to its original colour, call this function again with an argument of null.
|
IMPORT_C void SetDrawTextOnly();
This function is obsolete. When a text object is drawn, all parts of it are drawn.
IMPORT_C void SetDrawGraphicsOnly();
This function is obsolete. When a text object is drawn, all parts of it are drawn.
IMPORT_C void SetDrawTextAndGraphics();
This function is obsolete. When a text object is drawn, all parts of it are drawn.
IMPORT_C void SetClipping(TBool aClipping);
Sets whether drawing should be clipped to the intersection of the draw rectangle (the aDrawRect parameter passed to CTextLayout::DrawL()
or InvertRangeL()) and the text area.
|
IMPORT_C void SetParagraphFillTextOnly(TBool aFillTextOnly);
Sets the horizontal extent of a paragraph to be filled with paragraph fill colour.
|
IMPORT_C const TRgb *TextOverrideColor() const;
If the text colour is overridden, this function gets the text override colour, as set by SetTextColorOverride()
.
|
IMPORT_C CGraphicsContext *PrimaryGc() const;
Gets the graphics context for drawing the text and pictures.
|
IMPORT_C TBool UseClippingRect() const;
Tests whether clipping is set to the intersection of the draw rectangle, (the aDrawRect parameter passed to CTextLayout::DrawL()
or InvertRangeL()) and the text area.
|
IMPORT_C TBool UseGcClear() const;
Tests if the graphics context for drawing is either CWindowGc
or CBitmapContext
.
|
IMPORT_C TBool DrawText() const;
Obsolete function. When a text object is drawn, all parts of it are drawn.
|
IMPORT_C TBool DrawGraphics() const;
Obsolete function. When a text object is drawn, all parts of it are drawn.
|
IMPORT_C TBool UseBackgroundColor() const;
Tests whether the background colour is used, as set by SetDrawToEveryPixel()
.
|
IMPORT_C TBool ParagraphFillTextOnly() const;
Tests whether the region filled with paragraph fill colour is the area within the paragraph only, or also the area within the left text margin.
|
IMPORT_C TRect TextArea() const;
Gets the text area. The text area is the view rectangle minus the label and gutter margins.
|
IMPORT_C TInt DisplayHeight() const;
Gets the display height in pixels. The display height is the same as the view rectangle height.
|
IMPORT_C TPoint TopLeftTextArea() const;
Gets the (window) coordinates of the top left hand corner of the text area.
|
IMPORT_C TRect TotalMargin() const;
Gets the area occupied by the label and gutter margins.
|
IMPORT_C TRect LabelMargin() const;
Gets the area occupied by the label margin.
|
IMPORT_C TBool IsLabelMargin() const;
Tests whether a label margin has been set.
|
IMPORT_C TRect GutterMargin() const;
Gets the area occupied by the gutter margin.
|
IMPORT_C TBool IsGutterMargin() const;
This function is identical to IsLabelMargin()
.
|
IMPORT_C TPoint TopLeftText() const;
Gets the window coordinates of the top left hand corner at which text may be drawn. This point has the same vertical coordinate as the top of the text area, but its horizontal coordinate is increased by the left text margin width (iTextStartX). This point is the origin for layout coordinates.
|
IMPORT_C void WindowToText(TPoint &aWinPos) const;
Converts a point in window coordinates to layout coordinates. Window coordinates have their origin at the top left corner
of the view window. Layout coordinates have their origin at the top left corner of the area within the view rectangle in which
text can appear, (this value is returned by TopLeftText()
).
|
IMPORT_C void WindowToText(TRect &aRect) const;
Converts a rectangle in window coordinates to layout coordinates. Window coordinates have their origin at the top left corner
of the view window. Layout coordinates have their origin at the top left corner of the area within the view rectangle in which
text can appear, (this value is returned by TopLeftText()
).
|
IMPORT_C void TextToWindow(TPoint &aTextAreaPos) const;
Converts a point in layout coordinates to window coordinates.
|
IMPORT_C void TextToWindow(TRect &aRect) const;
Converts a rectangle in layout coordinates to window coordinates.
|
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().
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.
TInt iGutterMarginWidth;
The gutter margin width (also known as the line cursor margin width). By default zero.
TInt iTextStartX;
The horizontal offset between window coordinates and text layout coordinates.
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.