LibreOffice Module svtools (master) 1
DocumentToGraphicRenderer.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
21#pragma once
22
23#include <vector>
24
25#include <vcl/graph.hxx>
26
27#include <svtools/svtdllapi.h>
28
29namespace com :: sun :: star :: awt { class XToolkit; }
30namespace com :: sun :: star :: frame { class XModel; }
31namespace com :: sun :: star :: lang { class XComponent; }
32namespace com :: sun :: star :: view { class XRenderable; }
33
34namespace com::sun::star {
35 namespace drawing {
36 class XShapes;
37 class XShape;
38 }
39 namespace frame {
40 class XController;
41 }
42}
43
45{
46 const css::uno::Reference<css::lang::XComponent>& mxDocument;
47
48 enum DocType {
53 };
54
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;
62
63 bool hasSelection() const;
64
68 css::uno::Any getSelection() const;
69
70 sal_Int32 getCurrentPageWriter();
71
72public:
73 DocumentToGraphicRenderer(const css::uno::Reference<css::lang::XComponent>& xDocument, bool bSelectionOnly);
75
76 sal_Int32 getCurrentPage();
77 sal_Int32 getPageCount();
82 const std::vector<OUString>& getChapterNames() const;
83
84 Size getDocumentSizeInPixels( sal_Int32 nCurrentPage );
85
86 Size getDocumentSizeIn100mm(sal_Int32 nCurrentPage, Point* pDocumentPosition = nullptr,
87 Point* pCalcPagePosition = nullptr, Size *pCalcPageSize = nullptr);
88
89 Graphic renderToGraphic( sal_Int32 nCurrentPage, Size aDocumentSizePixel,
90 Size aTargetSizePixel, Color aPageColor, bool bExtOutDevData);
91
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 );
102
103 bool isWriter() const;
104 bool isCalc() const;
105 bool isImpress() const;
106};
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const css::uno::Reference< css::lang::XComponent > & mxDocument
std::vector< OUString > maChapterNames
css::uno::Reference< css::awt::XToolkit > mxToolkit
css::uno::Reference< css::view::XRenderable > mxRenderable
css::uno::Reference< css::frame::XModel > mxModel
css::uno::Reference< css::frame::XController > mxController
UNKNOWN
sal_Int32 getPageCount(const uno::Reference< frame::XModel > &xModel)
#define SVT_DLLPUBLIC
Definition: svtdllapi.h:27