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 .
25 #include <vcl/graph.hxx>
27 #include <svtools/svtdllapi.h>
29 namespace com :: sun :: star :: awt
{ class XToolkit
; }
30 namespace com :: sun :: star :: frame
{ class XModel
; }
31 namespace com :: sun :: star :: lang
{ class XComponent
; }
32 namespace com :: sun :: star :: view
{ class XRenderable
; }
34 namespace com::sun::star
{
44 class SVT_DLLPUBLIC DocumentToGraphicRenderer
46 const css::uno::Reference
<css::lang::XComponent
>& mxDocument
;
55 css::uno::Reference
<css::frame::XModel
> mxModel
;
56 css::uno::Reference
<css::frame::XController
> mxController
;
57 css::uno::Reference
<css::view::XRenderable
> mxRenderable
;
58 css::uno::Reference
<css::awt::XToolkit
> mxToolkit
;
59 css::uno::Any maSelection
;
61 std::vector
<OUString
> maChapterNames
;
63 bool hasSelection() const;
65 /** Always something even if hasSelection() is false (in which case the
66 selection is mxDocument).
68 css::uno::Any
getSelection() const;
70 sal_Int32
getCurrentPageWriter();
73 DocumentToGraphicRenderer(const css::uno::Reference
<css::lang::XComponent
>& xDocument
, bool bSelectionOnly
);
74 ~DocumentToGraphicRenderer();
76 sal_Int32
getCurrentPage();
77 sal_Int32
getPageCount();
79 * Get list of chapter names for a page, current page is set by
82 const std::vector
<OUString
>& getChapterNames() const;
84 Size
getDocumentSizeInPixels( sal_Int32 nCurrentPage
);
86 Size
getDocumentSizeIn100mm(sal_Int32 nCurrentPage
, Point
* pDocumentPosition
= nullptr,
87 Point
* pCalcPagePosition
= nullptr, Size
*pCalcPageSize
= nullptr);
89 Graphic
renderToGraphic( sal_Int32 nCurrentPage
, Size aDocumentSizePixel
,
90 Size aTargetSizePixel
, Color aPageColor
, bool bExtOutDevData
);
92 /** Determine whether rxController has a css::view::XSelectionSupplier at
93 which either a css::drawing::XShapes or css::drawing::XShape is
94 selected. XShapes has precedence over XShape.
96 Call only if the SelectionOnly property was set.
98 static bool isShapeSelected(
99 css::uno::Reference
< css::drawing::XShapes
> & rxShapes
,
100 css::uno::Reference
< css::drawing::XShape
> & rxShape
,
101 const css::uno::Reference
< css::frame::XController
> & rxController
);
103 bool isWriter() const;
105 bool isImpress() const;
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */