LibreOffice Module vcl (master) 1
pdfextoutdevdata.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#ifndef INCLUDED_VCL_PDFEXTOUTDEVDATA_HXX
21#define INCLUDED_VCL_PDFEXTOUTDEVDATA_HXX
22
23#include <vcl/dllapi.h>
24
25#include <vcl/pdfwriter.hxx>
26#include <vcl/extoutdevdata.hxx>
27#include <vector>
28#include <memory>
29
30class Graphic;
31class GDIMetaFile;
32
33namespace vcl
34{
35
36/*
37 A PDFExtOutDevBookmarkEntry is being created by the EditEngine if
38 a bookmark URL has been parsed. The Application is requested to take
39 care of each bookmark entry by emptying out the bookmark vector.
40*/
42{
45 sal_Int32 nLinkId;
46
49 sal_Int32 nDestId;
50
53 OUString aBookmark;
54
56 :nLinkId( -1 )
57 ,nDestId( -1 )
58 {
59 }
60};
61
62/*
63 Class that is being set at the OutputDevice allowing the
64 application to send enhanced PDF commands like CreateLink
65*/
66struct PageSyncData;
67struct GlobalSyncData;
69{
70
72
84 bool mbExportNDests; //i56629
85 sal_Int32 mnPage;
87 css::lang::Locale maDocLocale;
88
89 std::unique_ptr<PageSyncData> mpPageSyncData;
90 std::unique_ptr<GlobalSyncData> mpGlobalSyncData;
91
92 std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
93 std::vector<OUString> maChapterNames;
94
95public:
96
97 PDFExtOutDevData( const OutputDevice& rOutDev );
98 virtual ~PDFExtOutDevData() override;
99
100 bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf );
101 void ResetSyncData();
102
103 void PlayGlobalActions( PDFWriter& rWriter );
104
105 bool GetIsExportNotes() const { return mbExportNotes;}
106 void SetIsExportNotes( const bool bExportNotes );
107
108 bool GetIsExportNotesInMargin() const { return mbExportNotesInMargin;}
109 void SetIsExportNotesInMargin( const bool bExportNotesInMargin );
110
111 bool GetIsExportNotesPages() const { return mbExportNotesPages;}
112 void SetIsExportNotesPages( const bool bExportNotesPages );
113
114 bool GetIsExportTaggedPDF() const { return mbTaggedPDF;}
115 void SetIsExportTaggedPDF( const bool bTaggedPDF );
116
117 bool GetIsExportTransitionEffects() const { return mbTransitionEffects;}
118 void SetIsExportTransitionEffects( const bool bTransitionalEffects );
119
120 bool GetIsExportFormFields() const { return mbExportFormFields;}
121 void SetIsExportFormFields( const bool bExportFormFields );
122
123 bool GetIsExportBookmarks() const { return mbExportBookmarks;}
124 void SetIsExportBookmarks( const bool bExportBookmarks );
125
126 bool GetIsExportHiddenSlides() const { return mbExportHiddenSlides;}
127 void SetIsExportHiddenSlides( const bool bExportHiddenSlides );
128
129 void SetIsSinglePageSheets( const bool bSinglePageSheets );
130
131 bool GetIsExportNamedDestinations() const { return mbExportNDests;} //i56629
132 void SetIsExportNamedDestinations( const bool bExportNDests ); //i56629
133
134 // PageNumber, Compression is being set by the PDFExport
135 sal_Int32 GetCurrentPageNumber() const { return mnPage;}
136 void SetCurrentPageNumber( const sal_Int32 nPage );
137
138 bool GetIsLosslessCompression() const { return mbUseLosslessCompression;}
139 void SetIsLosslessCompression( const bool bLosslessCompression );
140
141 void SetCompressionQuality( const sal_Int32 nQuality );
142
143 bool GetIsReduceImageResolution() const { return mbReduceImageResolution;}
144 void SetIsReduceImageResolution( const bool bReduceImageResolution );
145
146 const css::lang::Locale& GetDocumentLocale() const { return maDocLocale;}
147 void SetDocumentLocale( const css::lang::Locale& rLoc );
148
149 std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks() { return maBookmarks;}
150 const std::vector<OUString>& GetChapterNames() const { return maChapterNames; }
151
152 const Graphic& GetCurrentGraphic() const;
153
158 void BeginGroup();
159
183 void EndGroup( const Graphic& rGraphic,
184 sal_uInt8 nTransparency,
185 const tools::Rectangle& rOutputRect,
186 const tools::Rectangle& rVisibleOutputRect );
187
189 bool HasAdequateCompression( const Graphic &rGraphic,
190 const tools::Rectangle &rOutputRect,
191 const tools::Rectangle &rVisibleOutputRect ) const;
192
193//--->i56629
211 sal_Int32 CreateNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr = -1 );
212
224 sal_Int32 RegisterDest();
225
228 void DescribeRegisteredDest( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
229
230//<---i56629
231
248 sal_Int32 CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
266 sal_Int32 CreateLink(const tools::Rectangle& rRect, OUString const& rAltText, sal_Int32 nPageNr = -1);
267
269 sal_Int32 CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr);
270
280 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
293 void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
294
296 void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
298 void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
299
316 sal_Int32 CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID );
317
331 void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
332
368 sal_Int32 BeginStructureElement( PDFWriter::StructElement eType, const OUString& rAlias = OUString() );
373 void EndStructureElement();
393 bool SetCurrentStructureElement( sal_Int32 nElement );
399 sal_Int32 GetCurrentStructureElement() const;
400
414 void SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
428 void SetStructureAttributeNumerical( PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
439 void SetStructureBoundingBox( const tools::Rectangle& rRect );
440
451 void SetActualText( const OUString& rText );
452
462 void SetAlternateText( const OUString& rText );
463
474 void SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec );
475
485 void CreateControl( const PDFWriter::AnyWidget& rControlType );
486};
487
488}
489
490#endif
491
492/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
std::unique_ptr< GlobalSyncData > mpGlobalSyncData
bool GetIsExportNotesInMargin() const
bool GetIsLosslessCompression() const
std::unique_ptr< PageSyncData > mpPageSyncData
std::vector< PDFExtOutDevBookmarkEntry > & GetBookmarks()
bool GetIsExportTaggedPDF() const
bool GetIsExportHiddenSlides() const
bool GetIsReduceImageResolution() const
css::lang::Locale maDocLocale
bool GetIsExportFormFields() const
std::vector< PDFExtOutDevBookmarkEntry > maBookmarks
bool GetIsExportBookmarks() const
bool GetIsExportNotesPages() const
std::vector< OUString > maChapterNames
bool GetIsExportNamedDestinations() const
const std::vector< OUString > & GetChapterNames() const
bool GetIsExportTransitionEffects() const
const css::lang::Locale & GetDocumentLocale() const
const OutputDevice & mrOutDev
sal_Int32 GetCurrentPageNumber() const
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_Int32 nLinkId
ID of the link pointing to the bookmark, or -1 if the entry denotes a destination instead of a link.
OUString aBookmark
link target name, respectively destination name
sal_Int32 nDestId
ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a n...
unsigned char sal_uInt8