xref: /aoo41x/main/vcl/inc/vcl/pdfextoutdevdata.hxx (revision 0d63794c)
1*0d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*0d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*0d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*0d63794cSAndrew Rist  * distributed with this work for additional information
6*0d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*0d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*0d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
9*0d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*0d63794cSAndrew Rist  *
11*0d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*0d63794cSAndrew Rist  *
13*0d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*0d63794cSAndrew Rist  * software distributed under the License is distributed on an
15*0d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*0d63794cSAndrew Rist  * specific language governing permissions and limitations
18*0d63794cSAndrew Rist  * under the License.
19*0d63794cSAndrew Rist  *
20*0d63794cSAndrew Rist  *************************************************************/
21*0d63794cSAndrew Rist 
22*0d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _VCL_PDFEXTOUTDEVDATA_HXX
25cdf0e10cSrcweir #define _VCL_PDFEXTOUTDEVDATA_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <vcl/dllapi.h>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include <vcl/pdfwriter.hxx>
30cdf0e10cSrcweir #include <vcl/extoutdevdata.hxx>
31cdf0e10cSrcweir #include <vcl/gdimtf.hxx>
32cdf0e10cSrcweir #include <vcl/mapmod.hxx>
33cdf0e10cSrcweir #include <tools/rtti.hxx>
34cdf0e10cSrcweir #include <vector>
35cdf0e10cSrcweir #include <deque>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class Graphic;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace vcl {	class PDFWriter; }
40cdf0e10cSrcweir 
41cdf0e10cSrcweir namespace vcl
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 
44cdf0e10cSrcweir /*
45cdf0e10cSrcweir 	A PDFExtOutDevBookmarkEntry is being created by the EditEngine if
46cdf0e10cSrcweir 	a bookmark URL has been parsed. The Application is requested to take
47cdf0e10cSrcweir 	care of each bookmark entry by emptying out the bookmark vector.
48cdf0e10cSrcweir */
49cdf0e10cSrcweir struct PDFExtOutDevBookmarkEntry
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     /** ID of the link pointing to the bookmark, or -1 if the entry denotes a destination instead of a link.
52cdf0e10cSrcweir     */
53cdf0e10cSrcweir 	sal_Int32		nLinkId;
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     /** ID of the named destination denoted by the bookmark, or -1 if the entry denotes a link instead of a named destination.
56cdf0e10cSrcweir     */
57cdf0e10cSrcweir     sal_Int32       nDestId;
58cdf0e10cSrcweir 
59cdf0e10cSrcweir     /** link target name, respectively destination name
60cdf0e10cSrcweir     */
61cdf0e10cSrcweir 	rtl::OUString	aBookmark;
62cdf0e10cSrcweir 
PDFExtOutDevBookmarkEntryvcl::PDFExtOutDevBookmarkEntry63cdf0e10cSrcweir     PDFExtOutDevBookmarkEntry()
64cdf0e10cSrcweir         :nLinkId( -1 )
65cdf0e10cSrcweir         ,nDestId( -1 )
66cdf0e10cSrcweir         ,aBookmark()
67cdf0e10cSrcweir     {
68cdf0e10cSrcweir     }
69cdf0e10cSrcweir };
70cdf0e10cSrcweir 
71cdf0e10cSrcweir /*
72cdf0e10cSrcweir  Class that is being set at the OutputDevice allowing the
73cdf0e10cSrcweir  application to send enhanced PDF commands like CreateLink
74cdf0e10cSrcweir */
75cdf0e10cSrcweir struct PageSyncData;
76cdf0e10cSrcweir struct GlobalSyncData;
77cdf0e10cSrcweir class VCL_DLLPUBLIC PDFExtOutDevData : public ExtOutDevData
78cdf0e10cSrcweir {
79cdf0e10cSrcweir 
80cdf0e10cSrcweir 	const OutputDevice& mrOutDev;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir     sal_Bool                        mbTaggedPDF;
83cdf0e10cSrcweir 	sal_Bool				    	mbExportNotes;
8454744b05SEike Rathke 	sal_Bool						mbExportNotesPages;
85cdf0e10cSrcweir 	sal_Bool					    mbTransitionEffects;
86cdf0e10cSrcweir 	sal_Bool					    mbUseLosslessCompression;
87cdf0e10cSrcweir 	sal_Bool					    mbReduceImageResolution;
88cdf0e10cSrcweir     sal_Bool                        mbExportFormFields;
89cdf0e10cSrcweir     sal_Bool                        mbExportBookmarks;
90cdf0e10cSrcweir     sal_Bool                        mbExportNDests; //i56629
91cdf0e10cSrcweir     sal_Int32                       mnFormsFormat;
92cdf0e10cSrcweir 	sal_Int32					    mnPage;
93cdf0e10cSrcweir     com::sun::star::lang::Locale    maDocLocale;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	PageSyncData*				mpPageSyncData;
96cdf0e10cSrcweir 	GlobalSyncData*				mpGlobalSyncData;
97cdf0e10cSrcweir 
98cdf0e10cSrcweir 	std::vector< PDFExtOutDevBookmarkEntry > maBookmarks;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir public :
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 	TYPEINFO();
103cdf0e10cSrcweir 	PDFExtOutDevData( const OutputDevice& rOutDev );
104cdf0e10cSrcweir 	virtual ~PDFExtOutDevData();
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	sal_Bool PlaySyncPageAct( PDFWriter& rWriter, sal_uInt32& rCurGDIMtfAction );
107cdf0e10cSrcweir 	void ResetSyncData();
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 	void PlayGlobalActions( PDFWriter& rWriter );
110cdf0e10cSrcweir 
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 
113cdf0e10cSrcweir 	sal_Bool	GetIsExportNotes() const;
114cdf0e10cSrcweir 	void		SetIsExportNotes( const sal_Bool bExportNotes );
115cdf0e10cSrcweir 
11654744b05SEike Rathke 	sal_Bool	GetIsExportNotesPages() const;
11754744b05SEike Rathke 	void		SetIsExportNotesPages( const sal_Bool bExportNotesPages );
11854744b05SEike Rathke 
119cdf0e10cSrcweir 	sal_Bool	GetIsExportTaggedPDF() const;
120cdf0e10cSrcweir 	void		SetIsExportTaggedPDF( const sal_Bool bTaggedPDF );
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	sal_Bool	GetIsExportTransitionEffects() const;
123cdf0e10cSrcweir 	void		SetIsExportTransitionEffects( const sal_Bool bTransitionalEffects );
124cdf0e10cSrcweir 
125cdf0e10cSrcweir     sal_Bool    GetIsExportFormFields() const;
126cdf0e10cSrcweir     void        SetIsExportFormFields( const sal_Bool bExportFormFields );
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 	sal_Int32	GetFormsFormat() const;
129cdf0e10cSrcweir 	void		SetFormsFormat( const sal_Int32 nFormsFormat );
130cdf0e10cSrcweir 
131cdf0e10cSrcweir     sal_Bool    GetIsExportBookmarks() const;
132cdf0e10cSrcweir     void        SetIsExportBookmarks( const sal_Bool bExportBookmarks );
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     sal_Bool    GetIsExportNamedDestinations() const; //i56629
135cdf0e10cSrcweir     void        SetIsExportNamedDestinations( const sal_Bool bExportNDests ); //i56629
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	// PageNumber, Compression is being set by the PDFExport
138cdf0e10cSrcweir 	sal_Int32	GetCurrentPageNumber() const;
139cdf0e10cSrcweir 	void		SetCurrentPageNumber( const sal_Int32 nPage );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 	sal_Bool	GetIsLosslessCompression() const;
142cdf0e10cSrcweir 	void		SetIsLosslessCompression( const sal_Bool bLosslessCompression );
143cdf0e10cSrcweir 
144cdf0e10cSrcweir 	sal_Bool	GetIsReduceImageResolution() const;
145cdf0e10cSrcweir 	void		SetIsReduceImageResolution( const sal_Bool bReduceImageResolution );
146cdf0e10cSrcweir 
147cdf0e10cSrcweir     const com::sun::star::lang::Locale& GetDocumentLocale() const;
148cdf0e10cSrcweir     void        SetDocumentLocale( const com::sun::star::lang::Locale& rLoc );
149cdf0e10cSrcweir 
150cdf0e10cSrcweir 	std::vector< PDFExtOutDevBookmarkEntry >& GetBookmarks();
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     /** Start a new group of render output
153cdf0e10cSrcweir 
154cdf0e10cSrcweir     	Use this method to group render output.
155cdf0e10cSrcweir      */
156cdf0e10cSrcweir     void		BeginGroup();
157cdf0e10cSrcweir 
158cdf0e10cSrcweir     /** End render output
159cdf0e10cSrcweir 
160cdf0e10cSrcweir     	This method ends grouped render output without
161cdf0e10cSrcweir         further actions.
162cdf0e10cSrcweir      */
163cdf0e10cSrcweir     void		EndGroup();
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     /** End render output
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     	This method ends grouped render output, that can be
168cdf0e10cSrcweir         represented by a GfxLink. This is typically used for
169cdf0e10cSrcweir         external graphic files, such as JPEGs, EPS files etc.
170cdf0e10cSrcweir         The BeginGroup/EndGroup calls must exactly enclose the
171cdf0e10cSrcweir         relevant OutputDevice calls issued to render the
172cdf0e10cSrcweir         graphic the normal way.
173cdf0e10cSrcweir 
174cdf0e10cSrcweir         @param rGraphic
175cdf0e10cSrcweir         The link to the original graphic
176cdf0e10cSrcweir 
177cdf0e10cSrcweir         @param nTransparency
178cdf0e10cSrcweir         Eight bit transparency value, with 0 denoting full opacity,
179cdf0e10cSrcweir         and 255 full transparency.
180cdf0e10cSrcweir 
181cdf0e10cSrcweir         @param rOutputRect
182cdf0e10cSrcweir         The output rectangle of the graphic.
183cdf0e10cSrcweir 
184cdf0e10cSrcweir         @param rVisibleOutputRect
185cdf0e10cSrcweir         The visible part of the output. This might be less than
186cdf0e10cSrcweir         rOutputRect, e.g. for cropped graphics.
187cdf0e10cSrcweir      */
188cdf0e10cSrcweir     void		EndGroup( const Graphic& 	rGraphic,
189cdf0e10cSrcweir                           sal_uInt8				nTransparency,
190cdf0e10cSrcweir                           const Rectangle& 	rOutputRect,
191cdf0e10cSrcweir                           const Rectangle& 	rVisibleOutputRect );
192cdf0e10cSrcweir //--->i56629
193cdf0e10cSrcweir     /** Create a new named destination to be used in a link to this document from another PDF document
194cdf0e10cSrcweir  (see PDF spec 1.4, 8.2.1)
195cdf0e10cSrcweir 
196cdf0e10cSrcweir     @parm sDestName
197cdf0e10cSrcweir     the name this destination will be addressed with from others PDF document
198cdf0e10cSrcweir 
199cdf0e10cSrcweir     @param rRect
200cdf0e10cSrcweir     target rectangle on page to be displayed if dest is jumped to
201cdf0e10cSrcweir 
202cdf0e10cSrcweir     @param nPageNr
203cdf0e10cSrcweir     number of page the dest is on (as returned by NewPage)
204cdf0e10cSrcweir     or -1 in which case the current page is used
205cdf0e10cSrcweir 
206cdf0e10cSrcweir     @param eType
207cdf0e10cSrcweir     what dest type to use
208cdf0e10cSrcweir 
209cdf0e10cSrcweir     @returns
210cdf0e10cSrcweir     the destination id (to be used in SetLinkDest) or
211cdf0e10cSrcweir     -1 if page id does not exist
212cdf0e10cSrcweir     */
213cdf0e10cSrcweir 	sal_Int32 CreateNamedDest( const String& sDestName,  const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir     /** registers a destination for which a destinatin ID needs to be known immediately, instead of later on setting it via
216cdf0e10cSrcweir         SetLinkDest.
217cdf0e10cSrcweir 
218cdf0e10cSrcweir         This is used in contexts where a destination is referenced by means other than a link.
219cdf0e10cSrcweir 
220cdf0e10cSrcweir         Later in the export process, a call to DescribeRegisteredDest must be made, providing the information about
221cdf0e10cSrcweir         the destination.
222cdf0e10cSrcweir 
223cdf0e10cSrcweir         @return
224cdf0e10cSrcweir             the unique Id of the destination
225cdf0e10cSrcweir     */
226cdf0e10cSrcweir     sal_Int32   RegisterDest();
227cdf0e10cSrcweir 
228cdf0e10cSrcweir     /** provides detailed information about a destination range which previously has been registered using RegisterDest.
229cdf0e10cSrcweir     */
230cdf0e10cSrcweir     void        DescribeRegisteredDest( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
231cdf0e10cSrcweir 
232cdf0e10cSrcweir //<---i56629
233cdf0e10cSrcweir 
234cdf0e10cSrcweir     /** Create a new destination to be used in a link
235cdf0e10cSrcweir 
236cdf0e10cSrcweir     @param rRect
237cdf0e10cSrcweir     target rectangle on page to be displayed if dest is jumped to
238cdf0e10cSrcweir 
239cdf0e10cSrcweir     @param nPageNr
240cdf0e10cSrcweir     number of page the dest is on (as returned by NewPage)
241cdf0e10cSrcweir     or -1 in which case the current page is used
242cdf0e10cSrcweir 
243cdf0e10cSrcweir     @param eType
244cdf0e10cSrcweir     what dest type to use
245cdf0e10cSrcweir 
246cdf0e10cSrcweir     @returns
247cdf0e10cSrcweir     the destination id (to be used in SetLinkDest) or
248cdf0e10cSrcweir     -1 if page id does not exist
249cdf0e10cSrcweir     */
250cdf0e10cSrcweir 	sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, PDFWriter::DestAreaType eType = PDFWriter::XYZ );
251cdf0e10cSrcweir     /** Create a new link on a page
252cdf0e10cSrcweir 
253cdf0e10cSrcweir     @param rRect
254cdf0e10cSrcweir     active rectangle of the link (that is the area that has to be
255cdf0e10cSrcweir     hit to activate the link)
256cdf0e10cSrcweir 
257cdf0e10cSrcweir     @param nPageNr
258cdf0e10cSrcweir     number of page the link is on (as returned by NewPage)
259cdf0e10cSrcweir     or -1 in which case the current page is used
260cdf0e10cSrcweir 
261cdf0e10cSrcweir     @returns
262cdf0e10cSrcweir     the link id (to be used in SetLinkDest, SetLinkURL) or
263cdf0e10cSrcweir     -1 if page id does not exist
264cdf0e10cSrcweir     */
265cdf0e10cSrcweir     sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
266cdf0e10cSrcweir     /** Set the destination for a link
267cdf0e10cSrcweir         <p>will change a URL type link to a dest link if necessary</p>
268cdf0e10cSrcweir 
269cdf0e10cSrcweir         @param nLinkId
270cdf0e10cSrcweir         the link to be changed
271cdf0e10cSrcweir 
272cdf0e10cSrcweir         @param nDestId
273cdf0e10cSrcweir         the dest the link shall point to
274cdf0e10cSrcweir         @returns
275cdf0e10cSrcweir         0 for success
276cdf0e10cSrcweir         -1 in case the link id does not exist
277cdf0e10cSrcweir         -2 in case the dest id does not exist
278cdf0e10cSrcweir     */
279cdf0e10cSrcweir     sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
280cdf0e10cSrcweir     /** Set the URL for a link
281cdf0e10cSrcweir         <p>will change a dest type link to an URL type link if necessary</p>
282cdf0e10cSrcweir         @param nLinkId
283cdf0e10cSrcweir         the link to be changed
284cdf0e10cSrcweir 
285cdf0e10cSrcweir         @param rURL
286cdf0e10cSrcweir         the URL the link shall point to.
287cdf0e10cSrcweir         there will be no error checking or any kind of
288cdf0e10cSrcweir         conversion done to this parameter execept this:
289cdf0e10cSrcweir         it will be output as 7bit Ascii. The URL
290cdf0e10cSrcweir         will appear literally in the PDF file produced
291cdf0e10cSrcweir 
292cdf0e10cSrcweir         @returns
293cdf0e10cSrcweir         0 for success
294cdf0e10cSrcweir         -1 in case the link id does not exist
295cdf0e10cSrcweir     */
296cdf0e10cSrcweir     sal_Int32 SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL );
297cdf0e10cSrcweir     /** Create a new outline item
298cdf0e10cSrcweir 
299cdf0e10cSrcweir         @param nParent
300cdf0e10cSrcweir         declares the parent of the new item in the outline hierarchy.
301cdf0e10cSrcweir         An invalid value will result in a new toplevel item.
302cdf0e10cSrcweir 
303cdf0e10cSrcweir         @param rText
304cdf0e10cSrcweir         sets the title text of the item
305cdf0e10cSrcweir 
306cdf0e10cSrcweir         @param nDestId
307cdf0e10cSrcweir         declares which Dest (created with CreateDest) the outline item
308cdf0e10cSrcweir         will point to
309cdf0e10cSrcweir 
310cdf0e10cSrcweir         @returns
311cdf0e10cSrcweir         the outline item id of the new item
312cdf0e10cSrcweir     */
313cdf0e10cSrcweir     sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const rtl::OUString& rText = rtl::OUString(), sal_Int32 nDestID = -1 );
314cdf0e10cSrcweir 
315cdf0e10cSrcweir     /** Set an outline item's parent
316cdf0e10cSrcweir 
317cdf0e10cSrcweir     @param nItem
318cdf0e10cSrcweir     specififies which item should be reparented.
319cdf0e10cSrcweir 
320cdf0e10cSrcweir     @param nNewParent
321cdf0e10cSrcweir     specifies which outline item will be the item's new parent.
322cdf0e10cSrcweir     Use 0 for reparenting to top level.
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     @returns
325cdf0e10cSrcweir     -1 if the item does not exist
326cdf0e10cSrcweir     -2 if the new parent does not exist, item will be reparented to top level.
327cdf0e10cSrcweir     */
328cdf0e10cSrcweir     sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
329cdf0e10cSrcweir 
330cdf0e10cSrcweir     /** Set an outline item's title text
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     @param nItem
333cdf0e10cSrcweir     specififies which item should get a new text
334cdf0e10cSrcweir 
335cdf0e10cSrcweir     @param rText
336cdf0e10cSrcweir     sets the title text of the item
337cdf0e10cSrcweir 
338cdf0e10cSrcweir     @returns
339cdf0e10cSrcweir     0 if the item exists and the text was changed
340cdf0e10cSrcweir     -1 if the item does not exist
341cdf0e10cSrcweir     */
342cdf0e10cSrcweir     sal_Int32 SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText );
343cdf0e10cSrcweir 
344cdf0e10cSrcweir     /** Set an outline item's destination
345cdf0e10cSrcweir 
346cdf0e10cSrcweir     @param nItem
347cdf0e10cSrcweir     specififies which item should get a new dest
348cdf0e10cSrcweir 
349cdf0e10cSrcweir     @param nDestID
350cdf0e10cSrcweir     specifies the item's new destination
351cdf0e10cSrcweir 
352cdf0e10cSrcweir     @returns
353cdf0e10cSrcweir     -1 if the item does not exist
354cdf0e10cSrcweir     -2 if the new dest does not exist, dest will remain unchanged
355cdf0e10cSrcweir     */
356cdf0e10cSrcweir     sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
357cdf0e10cSrcweir 
358cdf0e10cSrcweir     /** Create a new note on a page
359cdf0e10cSrcweir 
360cdf0e10cSrcweir     @param rRect
361cdf0e10cSrcweir     active rectangle of the note (that is the area that has to be
362cdf0e10cSrcweir     hit to popup the annotation)
363cdf0e10cSrcweir 
364cdf0e10cSrcweir     @param rNote
365cdf0e10cSrcweir     specifies the contents of the note
366cdf0e10cSrcweir 
367cdf0e10cSrcweir     @param nPageNr
368cdf0e10cSrcweir     number of page the note is on (as returned by NewPage)
369cdf0e10cSrcweir     or -1 in which case the current page is used
370cdf0e10cSrcweir     */
371cdf0e10cSrcweir 	void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
372cdf0e10cSrcweir 
373cdf0e10cSrcweir     /** begin a new logical structure element
374cdf0e10cSrcweir 
375cdf0e10cSrcweir     BeginStructureElement/EndStructureElement calls build the logical structure
376cdf0e10cSrcweir     of the PDF - the basis for tagged PDF. Structural elements are implemented
377cdf0e10cSrcweir     using marked content tags. Each structural element can contain sub elements
378cdf0e10cSrcweir     (e.g. a section can contain a heading and a paragraph). The structure hierarchy
379cdf0e10cSrcweir     is build automatically from the Begin/EndStructureElement calls.
380cdf0e10cSrcweir 
381cdf0e10cSrcweir     A structural element need not be contained on one page; e.g. paragraphs often
382cdf0e10cSrcweir     run from one page to the next. In this case the corresponding EndStructureElement
383cdf0e10cSrcweir     must be called while drawing the next page.
384cdf0e10cSrcweir 
385cdf0e10cSrcweir     BeginStructureElement and EndStructureElement must be called only after
386cdf0e10cSrcweir     <member scope="vcl">PDFWriter::NewPage</member> has been called and before
387cdf0e10cSrcweir     <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
388cdf0e10cSrcweir     number is an implicit context parameter for Begin/EndStructureElement.
389cdf0e10cSrcweir 
390cdf0e10cSrcweir     For pagination artifacts that are not part of the logical structure
391cdf0e10cSrcweir     of the document (like header, footer or page number) the special
392cdf0e10cSrcweir     StructElement <code>NonStructElement</code> exists. To place content
393cdf0e10cSrcweir     outside of the struture tree simply call
394cdf0e10cSrcweir     <code>BeginStructureElement( NonStructElement )</code> then draw your
395cdf0e10cSrcweir     content and then call <code>EndStructureElement()</code>. Any children
396cdf0e10cSrcweir     of a <code>NonStructElement</code> will not be part of the structure as well.
397cdf0e10cSrcweir 
398cdf0e10cSrcweir     @param eType
399cdf0e10cSrcweir     denotes what kind of element to begin (e.g. a heading or paragraph)
400cdf0e10cSrcweir 
401cdf0e10cSrcweir     @param rAlias
402cdf0e10cSrcweir     the specified alias will be used as structure tag. Also an entry in the PDF's
403cdf0e10cSrcweir     role map will be created mapping alias to regular structure type.
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     @returns
406cdf0e10cSrcweir     the id of the newly created structural element
407cdf0e10cSrcweir      */
408cdf0e10cSrcweir      sal_Int32 BeginStructureElement( PDFWriter::StructElement eType, const rtl::OUString& rAlias = rtl::OUString() );
409cdf0e10cSrcweir     /** end a logical structure element
410cdf0e10cSrcweir 
411cdf0e10cSrcweir     @see BeginStructureElement
412cdf0e10cSrcweir      */
413cdf0e10cSrcweir     void EndStructureElement();
414cdf0e10cSrcweir     /** set the current structure element
415cdf0e10cSrcweir 
416cdf0e10cSrcweir     <p>
417cdf0e10cSrcweir     For different purposes it may be useful to paint a structure element's
418cdf0e10cSrcweir     content discontinously. In that case an already existing structure element
419cdf0e10cSrcweir     can be appended to by using <code>SetCurrentStructureElement</code>. The
420cdf0e10cSrcweir     refenrenced structure element becomes the current structure element with
421cdf0e10cSrcweir     all consequences: all following structure elements are appended as children
422cdf0e10cSrcweir     of the current element.
423cdf0e10cSrcweir     </p>
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     @param nElement
426cdf0e10cSrcweir     the id of the new current structure element
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     @returns
429cdf0e10cSrcweir     <true/> if the current structure element could be set successfully
430cdf0e10cSrcweir     <false/> if the current structure element could not be changed
431cdf0e10cSrcweir     (e.g. if the passed element id is invalid)
432cdf0e10cSrcweir      */
433cdf0e10cSrcweir     bool SetCurrentStructureElement( sal_Int32 nElement );
434cdf0e10cSrcweir     /** get the current structure element id
435cdf0e10cSrcweir 
436cdf0e10cSrcweir     @returns
437cdf0e10cSrcweir     the id of the current structure element
438cdf0e10cSrcweir     */
439cdf0e10cSrcweir     sal_Int32 GetCurrentStructureElement();
440cdf0e10cSrcweir 
441cdf0e10cSrcweir     /** set a structure attribute on the current structural element
442cdf0e10cSrcweir 
443cdf0e10cSrcweir     SetStructureAttribute sets an attribute of the current structural element to a
444cdf0e10cSrcweir     new value. A consistency check is performed before actually setting the value;
445cdf0e10cSrcweir     if the check fails, the function returns <FALSE/> and the attribute remains
446cdf0e10cSrcweir     unchanged.
447cdf0e10cSrcweir 
448cdf0e10cSrcweir     @param eAttr
449cdf0e10cSrcweir     denotes what attribute to change
450cdf0e10cSrcweir 
451cdf0e10cSrcweir     @param eVal
452cdf0e10cSrcweir     the value to set the attribute to
453cdf0e10cSrcweir 
454cdf0e10cSrcweir     @returns
455cdf0e10cSrcweir     <TRUE/> if the value was valid and the change has been performed,
456cdf0e10cSrcweir     <FALSE/> if the attribute or value was invalid; attribute remains unchanged
457cdf0e10cSrcweir      */
458cdf0e10cSrcweir     bool SetStructureAttribute( PDFWriter::StructAttribute eAttr, PDFWriter::StructAttributeValue eVal );
459cdf0e10cSrcweir     /** set a structure attribute on the current structural element
460cdf0e10cSrcweir 
461cdf0e10cSrcweir     SetStructureAttributeNumerical sets an attribute of the current structural element
462cdf0e10cSrcweir     to a new numerical value. A consistency check is performed before actually setting
463cdf0e10cSrcweir     the value; if the check fails, the function returns <FALSE/> and the attribute
464cdf0e10cSrcweir     remains unchanged.
465cdf0e10cSrcweir 
466cdf0e10cSrcweir     @param eAttr
467cdf0e10cSrcweir     denotes what attribute to change
468cdf0e10cSrcweir 
469cdf0e10cSrcweir     @param nValue
470cdf0e10cSrcweir     the value to set the attribute to
471cdf0e10cSrcweir 
472cdf0e10cSrcweir     @returns
473cdf0e10cSrcweir     <TRUE/> if the value was valid and the change has been performed,
474cdf0e10cSrcweir     <FALSE/> if the attribute or value was invalid; attribute remains unchanged
475cdf0e10cSrcweir      */
476cdf0e10cSrcweir 	bool SetStructureAttributeNumerical( PDFWriter::StructAttribute eAttr, sal_Int32 nValue );
477cdf0e10cSrcweir     /** set the bounding box of a structural element
478cdf0e10cSrcweir 
479cdf0e10cSrcweir     SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
480cdf0e10cSrcweir     attribute can only be applied to <code>Table</code>, <code>Figure</code>,
481cdf0e10cSrcweir     <code>Form</code> and <code>Formula</code> elements, a call of this function
482cdf0e10cSrcweir     for other element types will be ignored and the BBox attribute not be set.
483cdf0e10cSrcweir 
484cdf0e10cSrcweir     @param rRect
485cdf0e10cSrcweir     the new bounding box for the structural element
486cdf0e10cSrcweir      */
487cdf0e10cSrcweir     void SetStructureBoundingBox( const Rectangle& rRect );
488cdf0e10cSrcweir 
489cdf0e10cSrcweir     /** set the ActualText attribute of a structural element
490cdf0e10cSrcweir 
491cdf0e10cSrcweir     ActualText contains the Unicode text without layout artifacts that is shown by
492cdf0e10cSrcweir     a structural element. For example if a line is ended prematurely with a break in
493cdf0e10cSrcweir     a word and continued on the next line (e.g. "happen-<newline>stance") the
494cdf0e10cSrcweir     corresponding ActualText would contain the unbroken line (e.g. "happenstance").
495cdf0e10cSrcweir 
496cdf0e10cSrcweir     @param rText
497cdf0e10cSrcweir     contains the complete logical text the structural element displays.
498cdf0e10cSrcweir      */
499cdf0e10cSrcweir     void SetActualText( const String& rText );
500cdf0e10cSrcweir 
501cdf0e10cSrcweir     /** set the Alt attribute of a strutural element
502cdf0e10cSrcweir 
503cdf0e10cSrcweir     Alt is s replacement text describing the contents of a structural element. This
504cdf0e10cSrcweir     is mainly used by accessibility applications; e.g. a screen reader would read
505cdf0e10cSrcweir     the Alt replacement text for an image to a visually impaired user.
506cdf0e10cSrcweir 
507cdf0e10cSrcweir     @param rText
508cdf0e10cSrcweir     contains the replacement text for the structural element
509cdf0e10cSrcweir     */
510cdf0e10cSrcweir     void SetAlternateText( const String& rText );
511cdf0e10cSrcweir 
512cdf0e10cSrcweir     /** Sets the time in seconds a page will appear before the next
513cdf0e10cSrcweir         page is shown automatically
514cdf0e10cSrcweir 
515cdf0e10cSrcweir         @param nSeconds
516cdf0e10cSrcweir         time in seconds the current page will be shown; pass 0 for manual advancement
517cdf0e10cSrcweir 
518cdf0e10cSrcweir         @param nPageNr
519cdf0e10cSrcweir         the page number to apply the autoadvance time to; -1 denotes the current page
520cdf0e10cSrcweir     */
521cdf0e10cSrcweir     void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
522cdf0e10cSrcweir 
523cdf0e10cSrcweir     /** Sets the transitional effect to be applied when the current page gets shown.
524cdf0e10cSrcweir 
525cdf0e10cSrcweir     @param eType
526cdf0e10cSrcweir     the kind of effect to be used; use Regular to disable transitional effects
527cdf0e10cSrcweir     for this page
528cdf0e10cSrcweir 
529cdf0e10cSrcweir     @param nMilliSec
530cdf0e10cSrcweir     the duration of the transitional effect in milliseconds;
531cdf0e10cSrcweir     set 0 to disable transitional effects
532cdf0e10cSrcweir 
533cdf0e10cSrcweir     @param nPageNr
534cdf0e10cSrcweir     the page number to apply the effect to; -1 denotes the current page
535cdf0e10cSrcweir     */
536cdf0e10cSrcweir 	void SetPageTransition( PDFWriter::PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
537cdf0e10cSrcweir 
538cdf0e10cSrcweir     /** create a new form control
539cdf0e10cSrcweir 
540cdf0e10cSrcweir     This function creates a new form control in the PDF and sets its various
541cdf0e10cSrcweir     properties. Do not pass an actual AnyWidget as <code>rControlType</code>
542cdf0e10cSrcweir     will be cast to the type described by the type member.
543cdf0e10cSrcweir 
544cdf0e10cSrcweir     @param rControlType
545cdf0e10cSrcweir     a descendant of <code>AnyWidget</code> determing the control's properties
546cdf0e10cSrcweir      */
547cdf0e10cSrcweir     void    CreateControl( const PDFWriter::AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
548cdf0e10cSrcweir };
549cdf0e10cSrcweir 
550cdf0e10cSrcweir }
551cdf0e10cSrcweir 
552cdf0e10cSrcweir #endif
553