LibreOffice Module svtools (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
DocumentToGraphicRenderer Class Reference

#include <DocumentToGraphicRenderer.hxx>

Collaboration diagram for DocumentToGraphicRenderer:
[legend]

Public Member Functions

 DocumentToGraphicRenderer (const css::uno::Reference< css::lang::XComponent > &xDocument, bool bSelectionOnly)
 
 ~DocumentToGraphicRenderer ()
 
sal_Int32 getCurrentPage ()
 
sal_Int32 getPageCount ()
 
const std::vector< OUString > & getChapterNames () const
 Get list of chapter names for a page, current page is set by renderToGraphic(). More...
 
Size getDocumentSizeInPixels (sal_Int32 nCurrentPage)
 
Size getDocumentSizeIn100mm (sal_Int32 nCurrentPage, Point *pDocumentPosition=nullptr, Point *pCalcPagePosition=nullptr, Size *pCalcPageSize=nullptr)
 
Graphic renderToGraphic (sal_Int32 nCurrentPage, Size aDocumentSizePixel, Size aTargetSizePixel, Color aPageColor, bool bExtOutDevData)
 
bool isWriter () const
 
bool isCalc () const
 
bool isImpress () const
 

Static Public Member Functions

static bool isShapeSelected (css::uno::Reference< css::drawing::XShapes > &rxShapes, css::uno::Reference< css::drawing::XShape > &rxShape, const css::uno::Reference< css::frame::XController > &rxController)
 Determine whether rxController has a css::view::XSelectionSupplier at which either a css::drawing::XShapes or css::drawing::XShape is selected. More...
 

Private Types

enum  DocType {
  WRITER ,
  CALC ,
  IMPRESS ,
  UNKNOWN
}
 

Private Member Functions

bool hasSelection () const
 
css::uno::Any getSelection () const
 Always something even if hasSelection() is false (in which case the selection is mxDocument). More...
 
sal_Int32 getCurrentPageWriter ()
 

Private Attributes

const css::uno::Reference< css::lang::XComponent > & mxDocument
 
css::uno::Reference< css::frame::XModel > mxModel
 
css::uno::Reference< css::frame::XController > mxController
 
css::uno::Reference< css::view::XRenderable > mxRenderable
 
css::uno::Reference< css::awt::XToolkit > mxToolkit
 
css::uno::Any maSelection
 
DocType meDocType
 
std::vector< OUString > maChapterNames
 

Detailed Description

Definition at line 44 of file DocumentToGraphicRenderer.hxx.

Member Enumeration Documentation

◆ DocType

Enumerator
WRITER 
CALC 
IMPRESS 
UNKNOWN 

Definition at line 48 of file DocumentToGraphicRenderer.hxx.

Constructor & Destructor Documentation

◆ DocumentToGraphicRenderer()

DocumentToGraphicRenderer::DocumentToGraphicRenderer ( const css::uno::Reference< css::lang::XComponent > &  xDocument,
bool  bSelectionOnly 
)

◆ ~DocumentToGraphicRenderer()

DocumentToGraphicRenderer::~DocumentToGraphicRenderer ( )

Definition at line 102 of file DocumentToGraphicRenderer.cxx.

Member Function Documentation

◆ getChapterNames()

const std::vector< OUString > & DocumentToGraphicRenderer::getChapterNames ( ) const

Get list of chapter names for a page, current page is set by renderToGraphic().

Definition at line 252 of file DocumentToGraphicRenderer.cxx.

References maChapterNames.

◆ getCurrentPage()

sal_Int32 DocumentToGraphicRenderer::getCurrentPage ( )

◆ getCurrentPageWriter()

sal_Int32 DocumentToGraphicRenderer::getCurrentPageWriter ( )
private

Definition at line 285 of file DocumentToGraphicRenderer.cxx.

References mxModel.

Referenced by getCurrentPage().

◆ getDocumentSizeIn100mm()

Size DocumentToGraphicRenderer::getDocumentSizeIn100mm ( sal_Int32  nCurrentPage,
Point pDocumentPosition = nullptr,
Point pCalcPagePosition = nullptr,
Size pCalcPageSize = nullptr 
)

◆ getDocumentSizeInPixels()

Size DocumentToGraphicRenderer::getDocumentSizeInPixels ( sal_Int32  nCurrentPage)

◆ getPageCount()

sal_Int32 DocumentToGraphicRenderer::getPageCount ( )

◆ getSelection()

uno::Any DocumentToGraphicRenderer::getSelection ( ) const
private

Always something even if hasSelection() is false (in which case the selection is mxDocument).

Definition at line 117 of file DocumentToGraphicRenderer.cxx.

References hasSelection(), maSelection, and mxDocument.

Referenced by getDocumentSizeIn100mm(), getPageCount(), and renderToGraphic().

◆ hasSelection()

bool DocumentToGraphicRenderer::hasSelection ( ) const
private

Definition at line 112 of file DocumentToGraphicRenderer.cxx.

References maSelection.

Referenced by getCurrentPage(), and getSelection().

◆ isCalc()

bool DocumentToGraphicRenderer::isCalc ( ) const

Definition at line 324 of file DocumentToGraphicRenderer.cxx.

References CALC, and meDocType.

◆ isImpress()

bool DocumentToGraphicRenderer::isImpress ( ) const

Definition at line 332 of file DocumentToGraphicRenderer.cxx.

References IMPRESS, and meDocType.

◆ isShapeSelected()

bool DocumentToGraphicRenderer::isShapeSelected ( css::uno::Reference< css::drawing::XShapes > &  rxShapes,
css::uno::Reference< css::drawing::XShape > &  rxShape,
const css::uno::Reference< css::frame::XController > &  rxController 
)
static

Determine whether rxController has a css::view::XSelectionSupplier at which either a css::drawing::XShapes or css::drawing::XShape is selected.

XShapes has precedence over XShape.

Call only if the SelectionOnly property was set.

Definition at line 295 of file DocumentToGraphicRenderer.cxx.

Referenced by ExportDialog::GetGraphicSource().

◆ isWriter()

bool DocumentToGraphicRenderer::isWriter ( ) const

Definition at line 316 of file DocumentToGraphicRenderer.cxx.

References meDocType, and WRITER.

Referenced by DocumentToGraphicRenderer(), and getCurrentPage().

◆ renderToGraphic()

Graphic DocumentToGraphicRenderer::renderToGraphic ( sal_Int32  nCurrentPage,
Size  aDocumentSizePixel,
Size  aTargetSizePixel,
Color  aPageColor,
bool  bExtOutDevData 
)

Member Data Documentation

◆ maChapterNames

std::vector<OUString> DocumentToGraphicRenderer::maChapterNames
private

Definition at line 61 of file DocumentToGraphicRenderer.hxx.

Referenced by getChapterNames(), and renderToGraphic().

◆ maSelection

css::uno::Any DocumentToGraphicRenderer::maSelection
private

◆ meDocType

DocType DocumentToGraphicRenderer::meDocType
private

◆ mxController

css::uno::Reference<css::frame::XController> DocumentToGraphicRenderer::mxController
private

◆ mxDocument

const css::uno::Reference<css::lang::XComponent>& DocumentToGraphicRenderer::mxDocument
private

Definition at line 46 of file DocumentToGraphicRenderer.hxx.

Referenced by DocumentToGraphicRenderer(), and getSelection().

◆ mxModel

css::uno::Reference<css::frame::XModel> DocumentToGraphicRenderer::mxModel
private

Definition at line 55 of file DocumentToGraphicRenderer.hxx.

Referenced by getCurrentPageWriter(), and renderToGraphic().

◆ mxRenderable

css::uno::Reference<css::view::XRenderable> DocumentToGraphicRenderer::mxRenderable
private

◆ mxToolkit

css::uno::Reference<css::awt::XToolkit> DocumentToGraphicRenderer::mxToolkit
private

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