xref: /trunk/main/filter/source/pdf/pdfexport.hxx (revision 22e87013)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef PDFEXPORT_HXX
25 #define PDFEXPORT_HXX
26 
27 #include "pdffilter.hxx"
28 #include <tools/multisel.hxx>
29 #include <vcl/pdfwriter.hxx>
30 #include <vcl/pdfextoutdevdata.hxx>
31 #include <com/sun/star/view/XRenderable.hpp>
32 
33 class SvEmbeddedObject;
34 class GDIMetaFile;
35 class VirtualDevice;
36 class PolyPolygon;
37 class Gradient;
38 class BitmapEx;
39 class Point;
40 class Size;
41 
42 namespace vcl {	class PDFWriter; }
43 
44 // -------------
45 // - PDFExport -
46 // -------------
47 
48 class PDFExport
49 {
50 private:
51 
52 	Reference< XComponent >	mxSrcDoc;
53     Reference< lang::XMultiServiceFactory > mxMSF;
54 	Reference< task::XStatusIndicator > mxStatusIndicator;
55 	Reference< task::XInteractionHandler > mxIH;
56 
57 	sal_Bool				mbUseTaggedPDF;
58     sal_Int32               mnPDFTypeSelection;
59 	sal_Bool				mbExportNotes;
60 	sal_Bool				mbExportNotesPages;
61 	sal_Bool	            mbEmbedStandardFonts;
62 	sal_Bool				mbUseTransitionEffects;
63     sal_Bool                mbExportBookmarks;
64     sal_Int32               mnOpenBookmarkLevels;
65 
66 	sal_Bool				mbUseLosslessCompression;
67 	sal_Bool				mbReduceImageResolution;
68     sal_Bool                mbSkipEmptyPages;
69     sal_Bool                mbAddStream;
70 	sal_Int32				mnMaxImageResolution;
71 	sal_Int32				mnQuality;
72 	sal_Int32				mnFormsFormat;
73     sal_Bool                mbExportFormFields;
74     sal_Bool                mbAllowDuplicateFieldNames;
75 	sal_Int32				mnProgressValue;
76     sal_Bool                mbRemoveTransparencies;
77 
78     sal_Bool                mbWatermark;
79     uno::Any                maWatermark;
80 
81 //these variable are here only to have a location in filter/pdf to set the default
82 //to be used by the macro (when the FilterData are set by the macro itself)
83     sal_Bool				mbHideViewerToolbar;
84     sal_Bool				mbHideViewerMenubar;
85     sal_Bool				mbHideViewerWindowControls;
86     sal_Bool				mbFitWindow;
87     sal_Bool				mbCenterWindow;
88     sal_Bool				mbOpenInFullScreenMode;
89     sal_Bool				mbDisplayPDFDocumentTitle;
90     sal_Int32				mnPDFDocumentMode;
91     sal_Int32				mnPDFDocumentAction;
92     sal_Int32               mnZoom;
93     sal_Int32               mnInitialPage;
94     sal_Int32				mnPDFPageLayout;
95     sal_Bool				mbFirstPageLeft;
96 
97     sal_Bool				mbEncrypt;
98 	sal_Bool				mbRestrictPermissions;
99     sal_Int32				mnPrintAllowed;
100     sal_Int32				mnChangesAllowed;
101     sal_Bool				mbCanCopyOrExtract;
102     sal_Bool				mbCanExtractForAccessibility;
103 
104     SvtGraphicFill          maCacheFill;
105     sal_Int32               mnCachePatternId;
106 
107 //--->i56629
108 	sal_Bool				mbExportRelativeFsysLinks;
109     sal_Int32               mnDefaultLinkAction;
110 	sal_Bool				mbConvertOOoTargetToPDFTarget;
111     sal_Bool				mbExportBmkToDest;
112 //<---
113 	sal_Bool                ImplExportPage( ::vcl::PDFWriter& rWriter, ::vcl::PDFExtOutDevData& rPDFExtOutDevData,
114 												const GDIMetaFile& rMtf );
115     void                    ImplWriteWatermark( ::vcl::PDFWriter& rWriter, const Size& rPageSize );
116 public:
117 
118 					        PDFExport( const Reference< XComponent >& rxSrcDoc,
119 					                   const Reference< task::XStatusIndicator >& xStatusIndicator,
120 					                  const Reference< task::XInteractionHandler >& xIH,
121 					                   const Reference< lang::XMultiServiceFactory >& xFact );
122 					        ~PDFExport();
123 
124 	sal_Bool                ExportSelection( vcl::PDFWriter& rPDFWriter, Reference< com::sun::star::view::XRenderable >& rRenderable, Any& rSelection,
125                                 MultiSelection aMultiSelection, Sequence< PropertyValue >& rRenderOptions, sal_Int32 nPageCount );
126 
127 	sal_Bool                Export( const OUString& rFile, const Sequence< PropertyValue >& rFilterData );
128 
129     void                    showErrors( const std::set<vcl::PDFWriter::ErrorCode>& );
130 };
131 
132 #endif
133