LibreOffice
LibreOffice 24.2 SDK API Reference
Public Member Functions | List of all members
XSimpleCanvas Interface Reference

Provides the basic graphical output operations for a canvas. More...

import"XSimpleCanvas.idl";

Inheritance diagram for XSimpleCanvas:
XInterface

Public Member Functions

void selectFont ([in] string sFontName, [in]double size, [in] boolean bold, [in] boolean italic)
 Select a font. More...
 
void setPenColor ([in] com::sun::star::util::Color nsRgbaColor)
 Sets the color used by line and text operations. More...
 
void setFillColor ([in] com::sun::star::util::Color nsRgbaColor)
 Sets the fill color. More...
 
void setRectClip ([in] ::com::sun::star::geometry::RealRectangle2D aRect)
 Sets the clip to the specified rectangle. More...
 
void setTransformation ([in] ::com::sun::star::geometry::AffineMatrix2D aTransform)
 Set the current transform matrix. More...
 
void drawPixel ([in] ::com::sun::star::geometry::RealPoint2D aPoint)
 Sets a single pixel on the canvas. More...
 
void drawLine ([in] ::com::sun::star::geometry::RealPoint2D aStartPoint, [in] ::com::sun::star::geometry::RealPoint2D aEndPoint)
 Draws a line on the canvas. More...
 
void drawRect ([in] ::com::sun::star::geometry::RealRectangle2D aRect)
 Draws a rectangle on the canvas. More...
 
void drawPolyPolygon ([in] XPolyPolygon2D xPolyPolygon)
 Draws a poly-polygon on the canvas. More...
 
void drawText ([in] StringContext aText, [in] ::com::sun::star::geometry::RealPoint2D aOutPos, [in] byte nTextDirection)
 Draws text on the canvas. More...
 
void drawBitmap ([in] XBitmap xBitmap, [in] ::com::sun::star::geometry::RealPoint2D aLeftTop)
 Draws the bitmap on the canvas. More...
 
XGraphicDevice getDevice ()
 Request the associated graphic device for this canvas. More...
 
XCanvas getCanvas ()
 Query the underlying XCanvas. More...
 
FontMetrics getFontMetrics ()
 Request the font metrics of the current font. More...
 
XCanvasFont getCurrentFont ()
 Retrieve currently selected font. More...
 
com::sun::star::util::Color getCurrentPenColor ()
 Retrieve color currently used for lines. More...
 
com::sun::star::util::Color getCurrentFillColor ()
 Retrieve color currently used for fills. More...
 
com::sun::star::geometry::RealRectangle2D getCurrentClipRect ()
 Retrieve current clip rect. More...
 
com::sun::star::geometry::AffineMatrix2D getCurrentTransformation ()
 Retrieve current transformation matrix. More...
 
ViewState getCurrentViewState ()
 Retrieve view state. More...
 
RenderState getCurrentRenderState ([in] boolean bUseFillColor)
 Retrieve render state. More...
 
- Public Member Functions inherited from XInterface
any queryInterface ([in] type aType)
 queries for a new interface to an existing UNO object. More...
 
void acquire ()
 increases the reference counter by one. More...
 
void release ()
 decreases the reference counter by one. More...
 

Detailed Description

Provides the basic graphical output operations for a canvas.

This interface is a simplified version of the XCanvas interface. It holds explicit state, i.e. the pen and fill color, the current transformation, clip and font are persistently remembered.

In contrast to the XCanvas interface, XSimpleCanvas does not distinguish between stroke and fill operations; instead, switching between stroke and fill (or taking both) works by setting appropriate pen and fill colors.

Member Function Documentation

◆ drawBitmap()

void drawBitmap ( [in] XBitmap  xBitmap,
[in] ::com::sun::star::geometry::RealPoint2D  aLeftTop 
)

Draws the bitmap on the canvas.

Parameters
xBitmapBitmap to render
aLeftTopLeft, top position of the bitmap on the destination canvas.

◆ drawLine()

void drawLine ( [in] ::com::sun::star::geometry::RealPoint2D  aStartPoint,
[in] ::com::sun::star::geometry::RealPoint2D  aEndPoint 
)

Draws a line on the canvas.

◆ drawPixel()

void drawPixel ( [in] ::com::sun::star::geometry::RealPoint2D  aPoint)

Sets a single pixel on the canvas.

◆ drawPolyPolygon()

void drawPolyPolygon ( [in] XPolyPolygon2D  xPolyPolygon)

Draws a poly-polygon on the canvas.

◆ drawRect()

void drawRect ( [in] ::com::sun::star::geometry::RealRectangle2D  aRect)

Draws a rectangle on the canvas.

◆ drawText()

void drawText ( [in] StringContext  aText,
[in] ::com::sun::star::geometry::RealPoint2D  aOutPos,
[in] byte  nTextDirection 
)

Draws text on the canvas.

Parameters
aTextText to render. The text color is the current pen color.
aOutPosOutput position of the text. This is the left or right edge, depending on nTextDirection. Output position is always relative to the font baseline.
nTextDirectionA value from the TextDirection collection, denoting the main writing direction for this string. The main writing direction determines the origin of the text output, i.e. the left edge for left-to-right and the right edge for right-to-left text.

◆ getCanvas()

XCanvas getCanvas ( )

Query the underlying XCanvas.

Returns
the canvas interface this object is internally based on.

◆ getCurrentClipRect()

Retrieve current clip rect.

◆ getCurrentFillColor()

com::sun::star::util::Color getCurrentFillColor ( )

Retrieve color currently used for fills.

◆ getCurrentFont()

XCanvasFont getCurrentFont ( )

Retrieve currently selected font.

Returns
the font instance that's currently used for rendering text.

◆ getCurrentPenColor()

com::sun::star::util::Color getCurrentPenColor ( )

Retrieve color currently used for lines.

◆ getCurrentRenderState()

RenderState getCurrentRenderState ( [in] boolean  bUseFillColor)

Retrieve render state.

Parameters
bUseFillColorWhen true, the Color member of the RenderState is initialized with the current fill color; when false, the current pen color is used.
Returns
the render state, that would generate matching output, when rendering to an XCanvas instead.

◆ getCurrentTransformation()

com::sun::star::geometry::AffineMatrix2D getCurrentTransformation ( )

Retrieve current transformation matrix.

◆ getCurrentViewState()

ViewState getCurrentViewState ( )

Retrieve view state.

Returns
the view state, that would generate matching output, when rendering to an XCanvas instead.

◆ getDevice()

XGraphicDevice getDevice ( )

Request the associated graphic device for this canvas.

A graphic device provides methods specific to the underlying output device capabilities, which are common for all canvases rendering to such a device. This includes device resolution, color space, or bitmap formats.

Returns
the associated XGraphicDevice.

◆ getFontMetrics()

FontMetrics getFontMetrics ( )

Request the font metrics of the current font.

Returns
the font metrics of the currently selected font.

◆ selectFont()

void selectFont ( [in] string  sFontName,
[in] double  size,
[in] boolean  bold,
[in] boolean  italic 
)

Select a font.

This method selects the specified font (or a close substitute) as the current font for text output.

Parameters
sFontNameThe name of the font (like e.g. Arial)
sizeThe size of the font (note that this is not the usual points unit, but in the same coordinate system as the other rendering operations - usually, device pixel).
boldWhen true, selected font is bold.
italicWhen true, selected font is italic

◆ setFillColor()

void setFillColor ( [in] com::sun::star::util::Color  nsRgbaColor)

Sets the fill color.

To disable filling, simply set this color to something with zero alpha (i.e. fully transparent).

Parameters
nsRgbaColorRGBA color tuple, interpreted in the sRGB color space.

◆ setPenColor()

void setPenColor ( [in] com::sun::star::util::Color  nsRgbaColor)

Sets the color used by line and text operations.

To disable stroking, simply set this color to something with zero alpha (i.e. fully transparent).

Parameters
nsRgbaColorRGBA color tuple, interpreted in the sRGB color space.

◆ setRectClip()

void setRectClip ( [in] ::com::sun::star::geometry::RealRectangle2D  aRect)

Sets the clip to the specified rectangle.

◆ setTransformation()

void setTransformation ( [in] ::com::sun::star::geometry::AffineMatrix2D  aTransform)

Set the current transform matrix.


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