1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
23 #include <config_options.h>
26 #include <vcl/graph.hxx>
28 #include <svtools/svtdllapi.h>
30 namespace com :: sun :: star :: awt
{ class XToolkit
; }
31 namespace com :: sun :: star :: frame
{ class XModel
; }
32 namespace com :: sun :: star :: lang
{ class XComponent
; }
33 namespace com :: sun :: star :: view
{ class XRenderable
; }
35 namespace com::sun::star
{
45 class SVT_DLLPUBLIC DocumentToGraphicRenderer
47 const css::uno::Reference
<css::lang::XComponent
>& mxDocument
;
56 css::uno::Reference
<css::frame::XModel
> mxModel
;
57 css::uno::Reference
<css::frame::XController
> mxController
;
58 css::uno::Reference
<css::view::XRenderable
> mxRenderable
;
59 css::uno::Reference
<css::awt::XToolkit
> mxToolkit
;
60 css::uno::Any maSelection
;
62 std::vector
<OUString
> maChapterNames
;
64 bool hasSelection() const;
66 /** Always something even if hasSelection() is false (in which case the
67 selection is mxDocument).
69 css::uno::Any
getSelection() const;
71 sal_Int32
getCurrentPageWriter();
74 DocumentToGraphicRenderer(const css::uno::Reference
<css::lang::XComponent
>& xDocument
, bool bSelectionOnly
);
75 ~DocumentToGraphicRenderer();
77 sal_Int32
getCurrentPage();
78 sal_Int32
getPageCount();
80 * Get list of chapter names for a page, current page is set by
83 const std::vector
<OUString
>& getChapterNames() const;
85 Size
getDocumentSizeInPixels( sal_Int32 nCurrentPage
);
87 Size
getDocumentSizeIn100mm(sal_Int32 nCurrentPage
, Point
* pDocumentPosition
= nullptr,
88 Point
* pCalcPagePosition
= nullptr, Size
*pCalcPageSize
= nullptr);
90 Graphic
renderToGraphic( sal_Int32 nCurrentPage
, Size aDocumentSizePixel
,
91 Size aTargetSizePixel
, Color aPageColor
, bool bExtOutDevData
);
93 /** Determine whether rxController has a css::view::XSelectionSupplier at
94 which either a css::drawing::XShapes or css::drawing::XShape is
95 selected. XShapes has precedence over XShape.
97 Call only if the SelectionOnly property was set.
99 static bool isShapeSelected(
100 css::uno::Reference
< css::drawing::XShapes
> & rxShapes
,
101 css::uno::Reference
< css::drawing::XShape
> & rxShape
,
102 const css::uno::Reference
< css::frame::XController
> & rxController
);
104 bool isWriter() const;
106 bool isImpress() const;
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */