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 <map>
29#include <memory>
30
31class Graphic;
32class GDIMetaFile;
33class SdrObject;
34
35namespace vcl
36{
37
38/*
39 A PDFExtOutDevBookmarkEntry is being created by the EditEngine if
40 a bookmark URL has been parsed. The Application is requested to take
41 care of each bookmark entry by emptying out the bookmark vector.
42*/
44{
47 sal_Int32 nLinkId;
48
51 sal_Int32 nDestId;
52
55 OUString aBookmark;
56
58 :nLinkId( -1 )
59 ,nDestId( -1 )
60 {
61 }
62};
63
64/*
65 Class that is being set at the OutputDevice allowing the
66 application to send enhanced PDF commands like CreateLink
67*/
68struct PageSyncData;
69struct GlobalSyncData;
71{
72
74
86 bool mbExportNDests; //i56629
87 sal_Int32 mnPage;
89 css::lang::Locale maDocLocale;
90
91 std::unique_ptr<PageSyncData> mpPageSyncData;
92 std::unique_ptr<GlobalSyncData> mpGlobalSyncData;
93
94 std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
95 std::vector<OUString> maChapterNames;
96 // map from annotation SdrObject to annotation index
97 ::std::map<SdrObject const*, ::std::vector<sal_Int32>> m_ScreenAnnotations;
98
99public:
100
101 PDFExtOutDevData( const OutputDevice& rOutDev );
102 virtual ~PDFExtOutDevData() override;
103
104 bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction, const GDIMetaFile& rMtf );
105 void ResetSyncData();
106
107 void PlayGlobalActions( PDFWriter& rWriter );
108
109 bool GetIsExportNotes() const { return mbExportNotes;}
110 void SetIsExportNotes( const bool bExportNotes );
111
112 bool GetIsExportNotesInMargin() const { return mbExportNotesInMargin;}
113 void SetIsExportNotesInMargin( const bool bExportNotesInMargin );
114
115 bool GetIsExportNotesPages() const { return mbExportNotesPages;}
116 void SetIsExportNotesPages( const bool bExportNotesPages );
117
118 bool GetIsExportTaggedPDF() const { return mbTaggedPDF;}
119 void SetIsExportTaggedPDF( const bool bTaggedPDF );
120
121 bool GetIsExportTransitionEffects() const { return mbTransitionEffects;}
122 void SetIsExportTransitionEffects( const bool bTransitionalEffects );
123
124 bool GetIsExportFormFields() const { return mbExportFormFields;}
125 void SetIsExportFormFields( const bool bExportFormFields );
126
127 bool GetIsExportBookmarks() const { return mbExportBookmarks;}
128 void SetIsExportBookmarks( const bool bExportBookmarks );
129
130 bool GetIsExportHiddenSlides() const { return mbExportHiddenSlides;}
131 void SetIsExportHiddenSlides( const bool bExportHiddenSlides );
132
133 void SetIsSinglePageSheets( const bool bSinglePageSheets );
134
135 bool GetIsExportNamedDestinations() const { return mbExportNDests;} //i56629
136 void SetIsExportNamedDestinations( const bool bExportNDests ); //i56629
137
138 // PageNumber, Compression is being set by the PDFExport
139 sal_Int32 GetCurrentPageNumber() const { return mnPage;}
140 void SetCurrentPageNumber( const sal_Int32 nPage );
141
142 bool GetIsLosslessCompression() const { return mbUseLosslessCompression;}
143 void SetIsLosslessCompression( const bool bLosslessCompression );
144
145 void SetCompressionQuality( const sal_Int32 nQuality );
146
147 bool GetIsReduceImageResolution() const { return mbReduceImageResolution;}
148 void SetIsReduceImageResolution( const bool bReduceImageResolution );
149
150 const css::lang::Locale& GetDocumentLocale() const { return maDocLocale;}
151 void SetDocumentLocale( const css::lang::Locale& rLoc );
152
153 std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks() { return maBookmarks;}
154 const std::vector<OUString>& GetChapterNames() const { return maChapterNames; }
155
156 const Graphic& GetCurrentGraphic() const;
157
162 void BeginGroup();
163
187 void EndGroup( const Graphic& rGraphic,
188 sal_uInt8 nTransparency,
189 const tools::Rectangle& rOutputRect,
190 const tools::Rectangle& rVisibleOutputRect );
191
193 bool HasAdequateCompression( const Graphic &rGraphic,
194 const tools::Rectangle &rOutputRect,
195 const tools::Rectangle &rVisibleOutputRect ) const;
196
197//--->i56629
215 sal_Int32 CreateNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr = -1 );
216
228 sal_Int32 RegisterDest();
229
232 void DescribeRegisteredDest( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
233
234//<---i56629
235
252 sal_Int32 CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
270 sal_Int32 CreateLink(const tools::Rectangle& rRect, OUString const& rAltText, sal_Int32 nPageNr = -1);
271
273 sal_Int32 CreateScreen(const tools::Rectangle& rRect, OUString const& rAltText, OUString const& rMimeType, sal_Int32 nPageNr, SdrObject const* pObj);
274
276 ::std::vector<sal_Int32> const& GetScreenAnnotIds(SdrObject const* pObj) const;
277
287 void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
300 void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
301
303 void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
305 void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
306
323 sal_Int32 CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID );
324
338 void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
339
380 sal_Int32 WrapBeginStructureElement(PDFWriter::StructElement eType, const OUString& rAlias = OUString());
381 sal_Int32 EnsureStructureElement(void const* key);
382 void InitStructureElement(sal_Int32 id, PDFWriter::StructElement eType, const OUString& rAlias);
383 void BeginStructureElement(sal_Int32 id);
384
389 void EndStructureElement();
409 bool SetCurrentStructureElement( sal_Int32 nElement );
415 sal_Int32 GetCurrentStructureElement() const;
416
430 void SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
444 void SetStructureAttributeNumerical( PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
455 void SetStructureBoundingBox( const tools::Rectangle& rRect );
456
460 void SetStructureAnnotIds(::std::vector<sal_Int32> const& rAnnotIds);
461
472 void SetActualText( const OUString& rText );
473
483 void SetAlternateText( const OUString& rText );
484
495 void SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec );
496
506 void CreateControl( const PDFWriter::AnyWidget& rControlType );
507};
508
509}
510
511#endif
512
513/* 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
::std::map< SdrObject const *, ::std::vector< sal_Int32 > > m_ScreenAnnotations
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