android: Update app-specific/MIME type icons
[LibreOffice.git] / filter / source / pdf / pdfexport.hxx
blob5dbe15e3684690217ce4e1245e9b77af54aceea9
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 mbUseTaggedPDF;
48 sal_Int32 mnPDFTypeSelection;
49 bool mbPDFUACompliance;
50 bool mbExportNotes;
51 bool mbExportNotesInMargin;
52 bool mbExportPlaceholders;
53 bool mbUseReferenceXObject;
54 bool mbExportNotesPages;
55 bool mbExportOnlyNotesPages;
56 bool mbUseTransitionEffects;
57 bool mbExportBookmarks;
58 bool mbExportHiddenSlides;
59 bool mbSinglePageSheets;
60 sal_Int32 mnOpenBookmarkLevels;
62 bool mbUseLosslessCompression;
63 bool mbReduceImageResolution;
64 bool mbSkipEmptyPages;
65 bool mbAddStream;
66 sal_Int32 mnMaxImageResolution;
67 sal_Int32 mnQuality;
68 sal_Int32 mnFormsFormat;
69 bool mbExportFormFields;
70 bool mbAllowDuplicateFieldNames;
71 sal_Int32 mnProgressValue;
72 bool mbRemoveTransparencies;
74 bool mbIsRedactMode;
76 OUString msWatermark;
77 Color maWatermarkColor;
78 std::optional<sal_Int32> moWatermarkFontHeight;
79 OUString maWatermarkFontName;
80 std::optional<Degree10> moWatermarkRotateAngle;
81 OUString msTiledWatermark;
83 // these variable are here only to have a location in filter/pdf to set the default
84 // to be used by the macro (when the FilterData are set by the macro itself)
85 bool mbHideViewerToolbar;
86 bool mbHideViewerMenubar;
87 bool mbHideViewerWindowControls;
88 bool mbFitWindow;
89 bool mbCenterWindow;
90 bool mbOpenInFullScreenMode;
91 bool mbDisplayPDFDocumentTitle;
92 sal_Int32 mnPDFDocumentMode;
93 sal_Int32 mnPDFDocumentAction;
94 sal_Int32 mnZoom;
95 sal_Int32 mnInitialPage;
96 sal_Int32 mnPDFPageLayout;
98 bool mbEncrypt;
99 bool mbRestrictPermissions;
100 sal_Int32 mnPrintAllowed;
101 sal_Int32 mnChangesAllowed;
102 bool mbCanCopyOrExtract;
103 bool mbCanExtractForAccessibility;
105 // #i56629
106 bool mbExportRelativeFsysLinks;
107 sal_Int32 mnDefaultLinkAction;
108 bool mbConvertOOoTargetToPDFTarget;
109 bool mbExportBmkToDest;
110 void ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData,
111 const GDIMetaFile& rMtf );
113 bool mbSignPDF;
114 OUString msSignLocation;
115 OUString msSignContact;
116 OUString msSignReason;
117 OUString msSignPassword;
118 css::uno::Reference< css::security::XCertificate > maSignCertificate;
119 OUString msSignTSA;
121 void ImplWriteWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
122 void ImplWriteTiledWatermark( vcl::PDFWriter& rWriter, const Size& rPageSize );
123 css::uno::Reference<css::security::XCertificate> GetCertificateFromSubjectName(const std::u16string_view& rSubjectName) const;
126 public:
128 PDFExport( const css::uno::Reference< css::lang::XComponent >& rxSrcDoc,
129 const css::uno::Reference< css::task::XStatusIndicator >& xStatusIndicator,
130 const css::uno::Reference< css::task::XInteractionHandler >& xIH,
131 const css::uno::Reference< css::uno::XComponentContext >& xFact );
132 ~PDFExport();
134 bool ExportSelection( vcl::PDFWriter& rPDFWriter,
135 css::uno::Reference< css::view::XRenderable > const & rRenderable,
136 const css::uno::Any& rSelection,
137 const StringRangeEnumerator& rRangeEnum,
138 css::uno::Sequence< css::beans::PropertyValue >& rRenderOptions,
139 sal_Int32 nPageCount );
141 bool Export( const OUString& rFile, const css::uno::Sequence< css::beans::PropertyValue >& rFilterData );
143 void showErrors( const std::set<vcl::PDFWriter::ErrorCode>& );
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */