LibreOffice Module svtools (master) 1
|
#include <DocumentToGraphicRenderer.hxx>
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 |
Definition at line 44 of file DocumentToGraphicRenderer.hxx.
|
private |
Enumerator | |
---|---|
WRITER | |
CALC | |
IMPRESS | |
UNKNOWN |
Definition at line 48 of file DocumentToGraphicRenderer.hxx.
DocumentToGraphicRenderer::DocumentToGraphicRenderer | ( | const css::uno::Reference< css::lang::XComponent > & | xDocument, |
bool | bSelectionOnly | ||
) |
Definition at line 49 of file DocumentToGraphicRenderer.cxx.
References CALC, uno::Any::hasValue(), IMPRESS, isWriter(), maSelection, meDocType, mxController, mxDocument, mxModel, UNKNOWN, UNKNOWN, and WRITER.
DocumentToGraphicRenderer::~DocumentToGraphicRenderer | ( | ) |
Definition at line 102 of file DocumentToGraphicRenderer.cxx.
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.
sal_Int32 DocumentToGraphicRenderer::getCurrentPage | ( | ) |
Definition at line 257 of file DocumentToGraphicRenderer.cxx.
References getCurrentPageWriter(), hasSelection(), and isWriter().
Referenced by ExportDialog::GetGraphicStream(), and ExportDialog::GetOriginalSize().
|
private |
Definition at line 285 of file DocumentToGraphicRenderer.cxx.
References mxModel.
Referenced by getCurrentPage().
Size DocumentToGraphicRenderer::getDocumentSizeIn100mm | ( | sal_Int32 | nCurrentPage, |
Point * | pDocumentPosition = nullptr , |
||
Point * | pCalcPagePosition = nullptr , |
||
Size * | pCalcPageSize = nullptr |
||
) |
Definition at line 127 of file DocumentToGraphicRenderer.cxx.
References getSelection(), comphelper::makePropertyValue(), mxController, mxRenderable, and mxToolkit.
Referenced by getDocumentSizeInPixels(), and ExportDialog::GetOriginalSize().
Size DocumentToGraphicRenderer::getDocumentSizeInPixels | ( | sal_Int32 | nCurrentPage | ) |
Definition at line 106 of file DocumentToGraphicRenderer.cxx.
References Application::GetDefaultDevice(), getDocumentSizeIn100mm(), and OutputDevice::LogicToPixel().
Referenced by ExportDialog::GetGraphicStream().
sal_Int32 DocumentToGraphicRenderer::getPageCount | ( | ) |
Definition at line 269 of file DocumentToGraphicRenderer.cxx.
References getSelection(), comphelper::makePropertyValue(), mxController, mxRenderable, and mxToolkit.
|
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().
|
private |
Definition at line 112 of file DocumentToGraphicRenderer.cxx.
References maSelection.
Referenced by getCurrentPage(), and getSelection().
bool DocumentToGraphicRenderer::isCalc | ( | ) | const |
Definition at line 324 of file DocumentToGraphicRenderer.cxx.
bool DocumentToGraphicRenderer::isImpress | ( | ) | const |
Definition at line 332 of file DocumentToGraphicRenderer.cxx.
|
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().
bool DocumentToGraphicRenderer::isWriter | ( | ) | const |
Definition at line 316 of file DocumentToGraphicRenderer.cxx.
References meDocType, and WRITER.
Referenced by DocumentToGraphicRenderer(), and getCurrentPage().
Graphic DocumentToGraphicRenderer::renderToGraphic | ( | sal_Int32 | nCurrentPage, |
Size | aDocumentSizePixel, | ||
Size | aTargetSizePixel, | ||
Color | aPageColor, | ||
bool | bExtOutDevData | ||
) |
Definition at line 185 of file DocumentToGraphicRenderer.cxx.
References COL_TRANSPARENT(), OutputDevice::Erase(), OutputDevice::GetAntialiasing(), vcl::PDFExtOutDevData::GetChapterNames(), OutputDevice::GetMapMode(), VCLUnoHelper::GetOutputDevice(), getSelection(), Size::Height(), Size::IsEmpty(), maChapterNames, comphelper::makePropertyValue(), mm, mxController, mxModel, mxRenderable, mxToolkit, GDIMetaFile::Record(), OutputDevice::SetAntialiasing(), OutputDevice::SetBackground(), OutputDevice::SetExtOutDevData(), vcl::PDFExtOutDevData::SetIsExportBookmarks(), OutputDevice::SetMapMode(), GDIMetaFile::SetPrefSize(), GDIMetaFile::Stop(), Size::Width(), and GDIMetaFile::WindStart().
Referenced by ExportDialog::GetGraphicStream().
|
private |
Definition at line 61 of file DocumentToGraphicRenderer.hxx.
Referenced by getChapterNames(), and renderToGraphic().
|
private |
Definition at line 59 of file DocumentToGraphicRenderer.hxx.
Referenced by DocumentToGraphicRenderer(), getSelection(), and hasSelection().
|
private |
Definition at line 60 of file DocumentToGraphicRenderer.hxx.
Referenced by DocumentToGraphicRenderer(), isCalc(), isImpress(), and isWriter().
|
private |
Definition at line 56 of file DocumentToGraphicRenderer.hxx.
Referenced by DocumentToGraphicRenderer(), getDocumentSizeIn100mm(), getPageCount(), and renderToGraphic().
|
private |
Definition at line 46 of file DocumentToGraphicRenderer.hxx.
Referenced by DocumentToGraphicRenderer(), and getSelection().
|
private |
Definition at line 55 of file DocumentToGraphicRenderer.hxx.
Referenced by getCurrentPageWriter(), and renderToGraphic().
|
private |
Definition at line 57 of file DocumentToGraphicRenderer.hxx.
Referenced by getDocumentSizeIn100mm(), getPageCount(), and renderToGraphic().
|
private |
Definition at line 58 of file DocumentToGraphicRenderer.hxx.
Referenced by getDocumentSizeIn100mm(), getPageCount(), and renderToGraphic().