misc_extensions is now empty and can be removed
[LibreOffice.git] / filter / source / pdf / pdfexport.hxx
blob0e8e7fc429bcd8477b127e36fab0733e82a9484f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
22 #include <tools/multisel.hxx>
23 #include <vcl/pdfwriter.hxx>
24 #include <vcl/pdfextoutdevdata.hxx>
25 #include <com/sun/star/beans/PropertyValue.hpp>
26 #include <com/sun/star/lang/XComponent.hpp>
27 #include <com/sun/star/task/XInteractionHandler.hpp>
28 #include <com/sun/star/task/XStatusIndicator.hpp>
29 #include <com/sun/star/uno/Reference.hxx>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <com/sun/star/view/XRenderable.hpp>
33 class GDIMetaFile;
34 class Size;
36 namespace vcl { class PDFWriter; }
38 class PDFExport
40 private:
42 css::uno::Reference< css::lang::XComponent > mxSrcDoc;
43 css::uno::Reference< css::uno::XComponentContext > mxContext;
44 css::uno::Reference< css::task::XStatusIndicator > mxStatusIndicator;
45 css::uno::Reference< css::task::XInteractionHandler > mxIH;
47 bool mbUseLosslessCompression;
48 bool mbReduceImageResolution;
49 bool mbSkipEmptyPages;
50 sal_Int32 mnMaxImageResolution;
51 sal_Int32 mnQuality;
52 sal_Int32 mnProgressValue;
53 bool mbRemoveTransparencies;
55 bool mbIsRedactMode;
57 OUString msWatermark;
58 Color maWatermarkColor;
59 std::optional<sal_Int32> moWatermarkFontHeight;
60 OUString maWatermarkFontName;
61 std::optional<Degree10> moWatermarkRotateAngle;
62 OUString msTiledWatermark;
64 void ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData,
65 const GDIMetaFile& rMtf );
67 void ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
68 void ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
69 css::uno::Reference<css::security::XCertificate> GetCertificateFromSubjectName(std::u16string_view rSubjectName) const;
72 public:
74 PDFExport( const css::uno::Reference< css::lang::XComponent >& rxSrcDoc,
75 const css::uno::Reference< css::task::XStatusIndicator >& xStatusIndicator,
76 const css::uno::Reference< css::task::XInteractionHandler >& xIH,
77 const css::uno::Reference< css::uno::XComponentContext >& xFact );
78 ~PDFExport();
80 bool ExportSelection( vcl::PDFWriter& rPDFWriter,
81 css::uno::Reference< css::view::XRenderable > const & rRenderable,
82 const css::uno::Any& rSelection,
83 const StringRangeEnumerator& rRangeEnum,
84 css::uno::Sequence< css::beans::PropertyValue >& rRenderOptions,
85 sal_Int32 nPageCount );
87 bool Export( const OUString& rFile, const css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
89 void showErrors( const std::set<vcl::PDFWriter::ErrorCode>& );
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */