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 
30 class Graphic;
31 class GDIMetaFile;
32 
33 namespace 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  ,aBookmark()
59  {
60  }
61 };
62 
63 /*
64  Class that is being set at the OutputDevice allowing the
65  application to send enhanced PDF commands like CreateLink
66 */
67 struct PageSyncData;
68 struct GlobalSyncData;
70 {
71 
73 
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 
95 public:
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 GetIsExportNotesPages() const { return mbExportNotesPages;}
109  void SetIsExportNotesPages( const bool bExportNotesPages );
110 
111  bool GetIsExportTaggedPDF() const { return mbTaggedPDF;}
112  void SetIsExportTaggedPDF( const bool bTaggedPDF );
113 
114  bool GetIsExportTransitionEffects() const { return mbTransitionEffects;}
115  void SetIsExportTransitionEffects( const bool bTransitionalEffects );
116 
117  bool GetIsExportFormFields() const { return mbExportFormFields;}
118  void SetIsExportFormFields( const bool bExportFormFields );
119 
120  bool GetIsExportBookmarks() const { return mbExportBookmarks;}
121  void SetIsExportBookmarks( const bool bExportBookmarks );
122 
123  bool GetIsExportHiddenSlides() const { return mbExportHiddenSlides;}
124  void SetIsExportHiddenSlides( const bool bExportHiddenSlides );
125 
126  void SetIsSinglePageSheets( const bool bSinglePageSheets );
127 
128  bool GetIsExportNamedDestinations() const { return mbExportNDests;} //i56629
129  void SetIsExportNamedDestinations( const bool bExportNDests ); //i56629
130 
131  // PageNumber, Compression is being set by the PDFExport
132  sal_Int32 GetCurrentPageNumber() const { return mnPage;}
133  void SetCurrentPageNumber( const sal_Int32 nPage );
134 
135  bool GetIsLosslessCompression() const { return mbUseLosslessCompression;}
136  void SetIsLosslessCompression( const bool bLosslessCompression );
137 
138  void SetCompressionQuality( const sal_Int32 nQuality );
139 
140  bool GetIsReduceImageResolution() const { return mbReduceImageResolution;}
141  void SetIsReduceImageResolution( const bool bReduceImageResolution );
142 
143  const css::lang::Locale& GetDocumentLocale() const { return maDocLocale;}
144  void SetDocumentLocale( const css::lang::Locale& rLoc );
145 
146  std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks() { return maBookmarks;}
147  const std::vector<OUString>& GetChapterNames() const { return maChapterNames; }
148 
149  const Graphic& GetCurrentGraphic() const;
150 
155  void BeginGroup();
156 
180  void EndGroup( const Graphic& rGraphic,
181  sal_uInt8 nTransparency,
182  const tools::Rectangle& rOutputRect,
183  const tools::Rectangle& rVisibleOutputRect );
184 
186  bool HasAdequateCompression( const Graphic &rGraphic,
187  const tools::Rectangle &rOutputRect,
188  const tools::Rectangle &rVisibleOutputRect ) const;
189 
190 //--->i56629
208  sal_Int32 CreateNamedDest( const OUString& sDestName, const tools::Rectangle& rRect, sal_Int32 nPageNr = -1 );
209 
221  sal_Int32 RegisterDest();
222 
225  void DescribeRegisteredDest( sal_Int32 nDestId, const tools::Rectangle& rRect, sal_Int32 nPageNr, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
226 
227 //<---i56629
228 
245  sal_Int32 CreateDest( const tools::Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::DestAreaType::XYZ );
260  sal_Int32 CreateLink( const tools::Rectangle& rRect, sal_Int32 nPageNr = -1 );
261 
263  sal_Int32 CreateScreen(const tools::Rectangle& rRect, sal_Int32 nPageNr);
264 
274  void SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
287  void SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
288 
290  void SetScreenURL(sal_Int32 nScreenId, const OUString& rURL);
292  void SetScreenStream(sal_Int32 nScreenId, const OUString& rURL);
293 
310  sal_Int32 CreateOutlineItem( sal_Int32 nParent, const OUString& rText, sal_Int32 nDestID );
311 
325  void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
326 
362  sal_Int32 BeginStructureElement( PDFWriter::StructElement eType, const OUString& rAlias = OUString() );
367  void EndStructureElement();
387  bool SetCurrentStructureElement( sal_Int32 nElement );
393  sal_Int32 GetCurrentStructureElement() const;
394 
408  void SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
422  void SetStructureAttributeNumerical( PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
433  void SetStructureBoundingBox( const tools::Rectangle& rRect );
434 
445  void SetActualText( const OUString& rText );
446 
456  void SetAlternateText( const OUString& rText );
457 
468  void SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec );
469 
479  void CreateControl( const PDFWriter::AnyWidget& rControlType );
480 };
481 
482 }
483 
484 #endif
485 
486 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const std::vector< OUString > & GetChapterNames() 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...
std::unique_ptr< GlobalSyncData > mpGlobalSyncData
bool GetIsExportNamedDestinations() const
bool GetIsLosslessCompression() const
bool GetIsExportHiddenSlides() const
std::vector< OUString > maChapterNames
bool GetIsExportTransitionEffects() const
bool GetIsExportTaggedPDF() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
bool GetIsExportNotes() const
bool GetIsExportNotesPages() const
std::vector< PDFExtOutDevBookmarkEntry > maBookmarks
sal_Int32 nDestId
ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a n...
css::lang::Locale maDocLocale
std::unique_ptr< PageSyncData > mpPageSyncData
unsigned char sal_uInt8
std::vector< PDFExtOutDevBookmarkEntry > & GetBookmarks()
sal_Int32 GetCurrentPageNumber() const
bool GetIsExportBookmarks() const
OUString aBookmark
link target name, respectively destination name
const OutputDevice & mrOutDev
const css::lang::Locale & GetDocumentLocale() const
bool GetIsReduceImageResolution() const
bool GetIsExportFormFields() const