LCOV - code coverage report
Current view: top level - include/vcl - pdfwriter.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 73 0.0 %
Date: 2014-04-11 Functions: 0 60 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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             : #ifndef INCLUDED_VCL_PDFWRITER_HXX
      20             : #define INCLUDED_VCL_PDFWRITER_HXX
      21             : 
      22             : #include <sal/types.h>
      23             : 
      24             : #include <tools/gen.hxx>
      25             : #include <tools/color.hxx>
      26             : 
      27             : #include <vcl/dllapi.h>
      28             : #include <vcl/vclenum.hxx>
      29             : #include <vcl/font.hxx>
      30             : #include <vcl/graphictools.hxx>
      31             : 
      32             : #include <com/sun/star/io/XOutputStream.hpp>
      33             : #include <com/sun/star/beans/XMaterialHolder.hpp>
      34             : #include <com/sun/star/security/XCertificate.hpp>
      35             : #include <com/sun/star/lang/Locale.hpp>
      36             : 
      37             : #include <boost/scoped_ptr.hpp>
      38             : 
      39             : #include <list>
      40             : #include <vector>
      41             : #include <set>
      42             : 
      43             : class Font;
      44             : class Point;
      45             : class OutputDevice;
      46             : class GDIMetaFile;
      47             : class MapMode;
      48             : class Polygon;
      49             : class LineInfo;
      50             : class PolyPolygon;
      51             : class Bitmap;
      52             : class BitmapEx;
      53             : class Image;
      54             : class Gradient;
      55             : class Hatch;
      56             : class Wallpaper;
      57             : 
      58             : namespace vcl
      59             : {
      60             : 
      61             : class PDFExtOutDevData;
      62             : class PDFWriterImpl;
      63             : 
      64           0 : struct PDFNote
      65             : {
      66             :     OUString          Title;          // optional title for the popup containing the note
      67             :     OUString          Contents;       // contents of the note
      68             : };
      69             : 
      70           0 : class VCL_DLLPUBLIC PDFOutputStream
      71             : {
      72             :     public:
      73             :     virtual ~PDFOutputStream();
      74             :     virtual void write( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xStream ) = 0;
      75             : };
      76             : 
      77             : class VCL_DLLPUBLIC PDFWriter
      78             : {
      79             :     boost::scoped_ptr<PDFWriterImpl> pImplementation;
      80             : public:
      81             :     // extended line info
      82             :     enum CapType { capButt, capRound, capSquare };
      83             :     enum JoinType { joinMiter, joinRound, joinBevel };
      84           0 :     struct ExtLineInfo
      85             :     {
      86             :         double                      m_fLineWidth;
      87             :         double                      m_fTransparency;
      88             :         CapType                     m_eCap;
      89             :         JoinType                    m_eJoin;
      90             :         double                      m_fMiterLimit;
      91             :         std::vector< double >       m_aDashArray;
      92             : 
      93           0 :         ExtLineInfo() : m_fLineWidth( 0.0 ),
      94             :                         m_fTransparency( 0.0 ),
      95             :                         m_eCap( capButt ),
      96             :                         m_eJoin( joinMiter ),
      97           0 :                         m_fMiterLimit( 10.0 )
      98           0 :         {}
      99             :     };
     100             : 
     101             :     enum Orientation { Portrait, Landscape, Seascape, Inherit };
     102             : 
     103             :     // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
     104             :     enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
     105             :     // for the meaning of DestAreaType please look at PDF Reference Manual
     106             :     // version 1.4 section 8.2.1, page 475
     107             :     enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
     108             :                         FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
     109             :                         FitPageBoundingBoxVertical
     110             :     };
     111             : 
     112             :     // for a definition of structural element types please refer to
     113             :     // PDF Reference, 3rd ed. section 9.7.4
     114             :     enum StructElement
     115             :     {
     116             :         // special element to place outside the structure hierarchy
     117             :         NonStructElement,
     118             :         // Grouping elements
     119             :         Document, Part, Article, Section, Division, BlockQuote,
     120             :         Caption, TOC, TOCI, Index,
     121             : 
     122             :         // block level elements
     123             :         Paragraph, Heading, H1, H2, H3, H4, H5, H6,
     124             :         List, ListItem, LILabel, LIBody,
     125             :         Table, TableRow, TableHeader, TableData,
     126             : 
     127             :         // inline level elements
     128             :         Span, Quote, Note, Reference, BibEntry, Code, Link,
     129             : 
     130             :         // illustration elements
     131             :         Figure, Formula, Form
     132             :     };
     133             : 
     134             :     enum StructAttribute
     135             :     {
     136             :         Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
     137             :         TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
     138             :         LineHeight, BaselineShift, TextDecorationType, ListNumbering,
     139             :         RowSpan, ColSpan,
     140             : 
     141             :         // link destination is an artificial attribute that sets
     142             :         // the link annotation ID of a Link element
     143             :         // further note: since structure attributes can only be
     144             :         // set during content creation, but links can be
     145             :         // created after the fact, it is possible to set
     146             :         // an arbitrary id as structure attribute here. In this
     147             :         // case the arbitrary id has to be passed again when the
     148             :         // actual link annotation is created via SetLinkPropertyID
     149             :         LinkAnnotation,
     150             :         // Language currently sets a LanguageType (see i18nlangtag/lang.h)
     151             :         // which will be internally changed to a corresponding locale
     152             :         Language
     153             :     };
     154             : 
     155             :     enum StructAttributeValue
     156             :     {
     157             :         Invalid,
     158             :         NONE,
     159             :         // Placement
     160             :         Block, Inline, Before, After, Start, End,
     161             :         // WritingMode
     162             :         LrTb, RlTb, TbRl,
     163             :         // TextAlign
     164             :         Center, Justify,
     165             :         // Width, Height,
     166             :         Auto,
     167             :         // BlockAlign
     168             :         Middle,
     169             :         // LineHeight
     170             :         Normal,
     171             :         // TextDecorationType
     172             :         Underline, Overline, LineThrough,
     173             :         // ListNumbering
     174             :         Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
     175             :     };
     176             : 
     177             :     enum PageTransition
     178             :     {
     179             :         Regular,
     180             :         SplitHorizontalInward, SplitHorizontalOutward,
     181             :         SplitVerticalInward, SplitVerticalOutward,
     182             :         BlindsHorizontal, BlindsVertical,
     183             :         BoxInward, BoxOutward,
     184             :         WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
     185             :         Dissolve,
     186             :         GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
     187             :     };
     188             : 
     189             :     enum WidgetType
     190             :     {
     191             :         PushButton, RadioButton, CheckBox, Edit, ListBox, ComboBox, Hierarchy,
     192             :         Signature
     193             :     };
     194             : 
     195             :     enum WidgetState
     196             :     {
     197             :         // PushButton, RadioButton, CheckBox; Down means selected for
     198             :         // RadioButton and CheckBox
     199             :         Up, Down
     200             :     };
     201             : 
     202             :     enum ErrorCode
     203             :     {
     204             :         // transparent object occurred and was draw opaque because
     205             :         // PDF/A does not allow transparency
     206             :         Warning_Transparency_Omitted_PDFA,
     207             : 
     208             :         // transparent object occurred but is only supported since
     209             :         // PDF 1.4
     210             :         Warning_Transparency_Omitted_PDF13,
     211             : 
     212             :         // a form action was exported that is not suitable for PDF/A
     213             :         // the action was skipped
     214             :         Warning_FormAction_Omitted_PDFA,
     215             : 
     216             :         // transparent objects were converted to a bitmap in order
     217             :         // to removetransparencies from the output
     218             :         Warning_Transparency_Converted
     219             :     };
     220             : 
     221             :     struct VCL_DLLPUBLIC AnyWidget
     222             :     {
     223             :     protected:
     224             :         WidgetType          Type;       // primitive RTTI
     225             :     public:
     226             :         OUString       Name;       // a distinct name to identify the control
     227             :         OUString       Description;// descriptive text for the contro (e.g. for tool tip)
     228             :         OUString       Text;       // user text to appear on the control
     229             :         sal_uInt16              TextStyle;  // style flags
     230             :         bool                ReadOnly;
     231             :         Rectangle           Location;   // describes the area filled by the control
     232             :         bool                Border;     // true: widget should have a border, false: no border
     233             :         Color               BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
     234             :         bool                Background; // true: widget shall draw its background, false: no background
     235             :         Color               BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
     236             :         Font                TextFont;   // an empty font will be replaced by the
     237             :                                         // appropriate font from the user settings
     238             :         Color               TextColor;  // COL_TRANSPARENT will be replaced by the appropriate color from application settings
     239             :         sal_Int32           TabOrder; // lowest number is first in tab order
     240             : 
     241             :         /* style flags for text are those for OutputDevice::DrawText
     242             :            allowed values are:
     243             :            TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
     244             :            TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
     245             :            TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
     246             : 
     247             :            if TextStyle is 0, then each control will fill in default values
     248             :          */
     249             : 
     250             :          // note: the Name member comprises the field name of the resulting
     251             :          // PDF field names need to be globally unique. Therefore if any
     252             :          // Widget with an already used name is created, the name will be
     253             :          // made unique by adding an underscore ('_') and an ascending number
     254             :          // to the name.
     255             : 
     256           0 :         AnyWidget( WidgetType eType ) :
     257             :                 Type( eType ),
     258             :                 TextStyle( 0 ),
     259             :                 ReadOnly( false ),
     260             :                 Border( false ),
     261             :                 BorderColor( COL_TRANSPARENT ),
     262             :                 Background( false ),
     263             :                 BackgroundColor( COL_TRANSPARENT ),
     264             :                 TextColor( COL_TRANSPARENT ),
     265           0 :                 TabOrder( -1 )
     266           0 :         {}
     267             :         virtual ~AnyWidget();
     268             : 
     269           0 :         WidgetType getType() const { return Type; }
     270             : 
     271             :         virtual AnyWidget* Clone() const = 0;
     272             : 
     273             :     protected:
     274             :         // note that this equals the default compiler-generated copy-ctor, but we want to have it
     275             :         // protected, to only allow sub classes to access it
     276           0 :         AnyWidget( const AnyWidget& rSource )
     277             :             :Type( rSource.Type )
     278             :             ,Name( rSource.Name )
     279             :             ,Description( rSource.Description )
     280             :             ,Text( rSource.Text )
     281             :             ,TextStyle( rSource.TextStyle )
     282             :             ,ReadOnly( rSource.ReadOnly )
     283             :             ,Location( rSource.Location )
     284             :             ,Border( rSource.Border )
     285             :             ,BorderColor( rSource.BorderColor )
     286             :             ,Background( rSource.Background )
     287             :             ,BackgroundColor( rSource.BackgroundColor )
     288             :             ,TextFont( rSource.TextFont )
     289             :             ,TextColor( rSource.TextColor )
     290           0 :             ,TabOrder( rSource.TabOrder )
     291             :         {
     292           0 :         }
     293             :         AnyWidget& operator=( const AnyWidget& );  // never implemented
     294             :     };
     295             : 
     296           0 :     struct PushButtonWidget : public AnyWidget
     297             :     {
     298             :         /* If Dest is set to a valid link destination,
     299             :            Then pressing the button will act as a goto
     300             :            action within the document.
     301             : 
     302             :            Else:
     303             :            An empty URL means this button will reset the form.
     304             : 
     305             :            If URL is not empty and Submit is set, then the URL
     306             :            contained will be set as the URL to submit the
     307             :            form to. In this case the submit method will be
     308             :            either GET if SubmitGet is true or POST if
     309             :            SubmitGet is false.
     310             : 
     311             :            If URL is not empty and Submit is clear, then
     312             :            the URL contained will be interpreted as a
     313             :            hyperlink to be executed on pushing the button.
     314             : 
     315             :            There will be no error checking or any kind of
     316             :            conversion done to the URL parameter execept this:
     317             :            it will be output as 7bit Ascii. The URL
     318             :            will appear literally in the PDF file produced
     319             :         */
     320             :         sal_Int32           Dest;
     321             :         OUString       URL;
     322             :         bool                Submit;
     323             :         bool                SubmitGet;
     324             : 
     325           0 :         PushButtonWidget()
     326             :                 : AnyWidget( vcl::PDFWriter::PushButton ),
     327           0 :                   Dest( -1 ), Submit( false ), SubmitGet( false )
     328           0 :         {}
     329             : 
     330           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     331             :         {
     332           0 :             return new PushButtonWidget( *this );
     333             :         }
     334             :     };
     335             : 
     336           0 :     struct CheckBoxWidget : public AnyWidget
     337             :     {
     338             :         bool                Checked;
     339             :         bool                ButtonIsLeft;
     340             : 
     341           0 :         CheckBoxWidget()
     342             :                 : AnyWidget( vcl::PDFWriter::CheckBox ),
     343             :                   Checked( false ),
     344           0 :                   ButtonIsLeft( true )
     345           0 :         {}
     346             : 
     347           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     348             :         {
     349           0 :             return new CheckBoxWidget( *this );
     350             :         }
     351             :     };
     352             : 
     353           0 :     struct RadioButtonWidget : public AnyWidget
     354             :     {
     355             :         bool                Selected;
     356             :         sal_Int32           RadioGroup;
     357             :         bool                ButtonIsLeft;
     358             :         OUString       OnValue; // the value of the radio button if it is selected
     359             : 
     360           0 :         RadioButtonWidget()
     361             :                 : AnyWidget( vcl::PDFWriter::RadioButton ),
     362             :                   Selected( false ),
     363             :                   RadioGroup( 0 ),
     364           0 :                   ButtonIsLeft( true )
     365           0 :         {}
     366             : 
     367           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     368             :         {
     369           0 :             return new RadioButtonWidget( *this );
     370             :         }
     371             :         // radio buttons having the same RadioGroup id comprise one
     372             :         // logical radio button group, that is at most one of the RadioButtons
     373             :         // in a group can be checked at any time
     374             :         //
     375             :         // note: a PDF radio button field consists of a named field
     376             :         // containing unnamed checkbox child fields. The name of the
     377             :         // radio button field is taken from the first RadioButtonWidget created
     378             :         // in the group
     379             :     };
     380             : 
     381           0 :     struct EditWidget : public AnyWidget
     382             :     {
     383             :         bool                MultiLine;  // whether multiple lines are allowed
     384             :         bool                Password;   // visible echo off
     385             :         bool                FileSelect; // field is a file selector
     386             :         sal_Int32           MaxLen;     // maximum field length in characters, 0 means unlimited
     387             : 
     388           0 :         EditWidget()
     389             :                 : AnyWidget( vcl::PDFWriter::Edit ),
     390             :                   MultiLine( false ),
     391             :                   Password( false ),
     392             :                   FileSelect( false ),
     393           0 :                   MaxLen( 0 )
     394           0 :         {}
     395             : 
     396           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     397             :         {
     398           0 :             return new EditWidget( *this );
     399             :         }
     400             :     };
     401             : 
     402           0 :     struct ListBoxWidget : public AnyWidget
     403             :     {
     404             :         bool                            DropDown;
     405             :         bool                            Sort;
     406             :         bool                            MultiSelect;
     407             :         std::vector<OUString>      Entries;
     408             :         std::vector<sal_Int32>          SelectedEntries;
     409             :          // if MultiSelect is false only the first entry of SelectedEntries
     410             :          // will be taken into account. the same is implicit for PDF < 1.4
     411             :          // since multiselect is a 1.4+ feature
     412             : 
     413           0 :         ListBoxWidget()
     414             :                 : AnyWidget( vcl::PDFWriter::ListBox ),
     415             :                   DropDown( false ),
     416             :                   Sort( false ),
     417           0 :                   MultiSelect( false )
     418           0 :         {}
     419             : 
     420           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     421             :         {
     422           0 :             return new ListBoxWidget( *this );
     423             :         }
     424             :     };
     425             : 
     426             :     // note: PDF only supports dropdown comboboxes
     427           0 :     struct ComboBoxWidget : public AnyWidget
     428             :     {
     429             :         bool                            Sort;
     430             :         std::vector<OUString>      Entries;
     431             :         // set the current value in AnyWidget::Text
     432             : 
     433           0 :         ComboBoxWidget()
     434             :                 : AnyWidget( vcl::PDFWriter::ComboBox ),
     435           0 :                   Sort( false )
     436           0 :         {}
     437             : 
     438           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     439             :         {
     440           0 :             return new ComboBoxWidget( *this );
     441             :         }
     442             :     };
     443             : 
     444           0 :     struct SignatureWidget: public AnyWidget
     445             :     {
     446             :         // Use Sig prefix for members to avoid conflict with
     447             :         // the Location member of the AnyWidget which spcifies the coordinates
     448             :         // of the signature
     449             : 
     450             :         OUString                    SigLocation;
     451             :         OUString                    SigReason;
     452             :         OUString                    SigContactInfo;
     453             :         bool                             SigHidden;
     454             : 
     455           0 :         SignatureWidget()
     456             :                 : AnyWidget( vcl::PDFWriter::Signature ),
     457           0 :                   SigHidden( true )
     458           0 :         {}
     459             : 
     460           0 :         virtual AnyWidget* Clone() const SAL_OVERRIDE
     461             :         {
     462           0 :             return new SignatureWidget( *this );
     463             :         }
     464             :     };
     465             : 
     466             :     enum ExportDataFormat { HTML, XML, FDF, PDF };
     467             : // see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
     468             : // These emuns are treated as integer while reading/writing to configuration
     469             :     enum PDFViewerPageMode
     470             :     {
     471             :         ModeDefault,
     472             :         UseOutlines,
     473             :         UseThumbs
     474             :     };
     475             : // These emuns are treated as integer while reading/writing to configuration
     476             :     enum PDFViewerAction
     477             :     {
     478             :         ActionDefault,
     479             :         FitInWindow,
     480             :         FitWidth,
     481             :         FitVisible,
     482             :         ActionZoom
     483             :     };
     484             : // These enums are treated as integer while reading/writing to configuration
     485             :     enum PDFPageLayout
     486             :     {
     487             :         DefaultLayout,
     488             :         SinglePage,
     489             :         Continuous,
     490             :         ContinuousFacing
     491             :     };
     492             : 
     493             :     // These emuns are treated as integer while reading/writing to configuration
     494             :     //what default action to generate in a PDF hyperlink to external document/site
     495             :     enum PDFLinkDefaultAction
     496             :     {
     497             :         URIAction,
     498             :         URIActionDestination,
     499             :         LaunchAction
     500             :     };
     501             : 
     502             : /*
     503             : The following structure describes the permissions used in PDF security
     504             :  */
     505           0 :     struct PDFEncryptionProperties
     506             :     {
     507             : 
     508             :         bool Security128bit; // true to select 128 bit encryption, false for 40 bit
     509             :         //for both 40 and 128 bit security, see 3.5.2 PDF v 1.4 table 3.15, v 1.5 and v 1.6 table 3.20.
     510             :         bool CanPrintTheDocument;
     511             :         bool CanModifyTheContent;
     512             :         bool CanCopyOrExtract;
     513             :         bool CanAddOrModify;
     514             :         //for revision 3 (bit 128 security) only
     515             :         bool CanFillInteractive;
     516             :         bool CanExtractForAccessibility;
     517             :         bool CanAssemble;
     518             :         bool CanPrintFull;
     519             : 
     520             :         // encryption will only happen if EncryptionKey is not empty
     521             :         // EncryptionKey is actually a construct out of OValue, UValue and DocumentIdentifier
     522             :         // if these do not match, behavior is undefined, most likely an invalid PDF will be produced
     523             :         // OValue, UValue, EncryptionKey and DocumentIdentifier can be computed from
     524             :         // PDFDocInfo, Owner password and User password used the InitEncryption method which
     525             :         // implements the algorithms described in the PDF reference chapter 3.5: Encryption
     526             :         std::vector<sal_uInt8> OValue;
     527             :         std::vector<sal_uInt8> UValue;
     528             :         std::vector<sal_uInt8> EncryptionKey;
     529             :         std::vector<sal_uInt8> DocumentIdentifier;
     530             : 
     531             :         //permission default set for 128 bit, accessibility only
     532           0 :         PDFEncryptionProperties() :
     533             :             Security128bit              ( true ),
     534             :             CanPrintTheDocument         ( false ),
     535             :             CanModifyTheContent         ( false ),
     536             :             CanCopyOrExtract            ( false ),
     537             :             CanAddOrModify              ( false ),
     538             :             CanFillInteractive          ( false ),
     539             :             CanExtractForAccessibility  ( true ),
     540             :             CanAssemble                 ( false ),
     541           0 :             CanPrintFull                ( false )
     542           0 :             {}
     543             : 
     544             : 
     545           0 :         bool Encrypt() const
     546           0 :         { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
     547             :     };
     548             : 
     549           0 :     struct PDFDocInfo
     550             :     {
     551             :         OUString          Title;          // document title
     552             :         OUString          Author;         // document author
     553             :         OUString          Subject;        // subject
     554             :         OUString          Keywords;       // keywords
     555             :         OUString          Creator;        // application that created the original document
     556             :         OUString          Producer;       // OpenOffice
     557             :     };
     558             : 
     559             :     enum ColorMode
     560             :     {
     561             :         DrawColor, DrawGreyscale
     562             :     };
     563             : 
     564           0 :     struct PDFWriterContext
     565             :     {
     566             :         /* must be a valid file: URL usable by osl */
     567             :         OUString                   URL;
     568             :         /* the URL of the document being exported, used for relative links*/
     569             :         OUString                   BaseURL;
     570             :         /*if relative to file system should be formed*/
     571             :         bool                            RelFsys;//i56629, i49415?, i64585?
     572             :         /*the action to set the PDF hyperlink to*/
     573             :         PDFWriter::PDFLinkDefaultAction DefaultLinkAction;
     574             :         //convert the .od? target file type in a link to a .pdf type
     575             :         //this is examined before doing anything else
     576             :         bool                            ConvertOOoTargetToPDFTarget;
     577             :         //when the file type is .pdf, force the GoToR action
     578             :         bool                            ForcePDFAction;
     579             : 
     580             :         /* decides the PDF language level to be produced */
     581             :         PDFVersion                      Version;
     582             :         /* valid for PDF >= 1.4
     583             :            causes the MarkInfo entry in the document catalog to be set
     584             :         */
     585             :         bool                            Tagged;
     586             :         /*  determines in which format a form
     587             :             will be submitted.
     588             :          */
     589             :         PDFWriter::ExportDataFormat     SubmitFormat;
     590             :         bool                            AllowDuplicateFieldNames;
     591             :         bool                            FieldsUseSystemFonts;
     592             :         /* the following data members are used to customize the PDF viewer
     593             :            preferences
     594             :          */
     595             :         /* see 3.6.1 PDF v 1.4 ref*/
     596             :         PDFWriter::PDFViewerPageMode    PDFDocumentMode;
     597             :         PDFWriter::PDFViewerAction      PDFDocumentAction;
     598             :         // in percent, valid only if PDFDocumentAction == ActionZoom
     599             :         sal_Int32                       Zoom;
     600             : 
     601             :         /* see 8.6 PDF v 1.4 ref
     602             :            specifies whether to hide the viewer tool
     603             :           bars when the document is active.
     604             :         */
     605             :         bool                            HideViewerToolbar;
     606             :         bool                            HideViewerMenubar;
     607             :         bool                            HideViewerWindowControls;
     608             :         bool                            FitWindow;
     609             :         bool                            OpenInFullScreenMode;
     610             :         bool                            CenterWindow;
     611             :         bool                            DisplayPDFDocumentTitle;
     612             :         PDFPageLayout                   PageLayout;
     613             :         bool                            FirstPageLeft;
     614             :         // intially visible page in viewer (starting with 0 for first page)
     615             :         sal_Int32                       InitialPage;
     616             :         sal_Int32                       OpenBookmarkLevels; // -1 means all levels
     617             : 
     618             :         PDFWriter::PDFEncryptionProperties  Encryption;
     619             :         PDFWriter::PDFDocInfo           DocumentInfo;
     620             : 
     621             :         bool                            SignPDF;
     622             :         OUString                   SignLocation;
     623             :         OUString                   SignPassword;
     624             :         OUString                   SignReason;
     625             :         OUString                   SignContact;
     626             :         com::sun::star::lang::Locale    DocumentLocale; // defines the document default language
     627             :         sal_uInt32                      DPIx, DPIy;     // how to handle MapMode( MAP_PIXEL )
     628             :                                                         // 0 here specifies a default handling
     629             :         PDFWriter::ColorMode            ColorMode;
     630             :         com::sun::star::uno::Reference< com::sun::star::security::XCertificate> SignCertificate;
     631             : 
     632           0 :         PDFWriterContext() :
     633             :                 RelFsys( false ), //i56629, i49415?, i64585?
     634             :                 DefaultLinkAction( PDFWriter::URIAction ),
     635             :                 ConvertOOoTargetToPDFTarget( false ),
     636             :                 ForcePDFAction( false ),
     637             :                 Version( PDFWriter::PDF_1_4 ),
     638             :                 Tagged( false ),
     639             :                 SubmitFormat( PDFWriter::FDF ),
     640             :                 AllowDuplicateFieldNames( false ),
     641             :                 FieldsUseSystemFonts( true ),
     642             :                 PDFDocumentMode( PDFWriter::ModeDefault ),
     643             :                 PDFDocumentAction( PDFWriter::ActionDefault ),
     644             :                 Zoom( 100 ),
     645             :                 HideViewerToolbar( false ),
     646             :                 HideViewerMenubar( false ),
     647             :                 HideViewerWindowControls( false ),
     648             :                 FitWindow( false ),
     649             :                 OpenInFullScreenMode( false ),
     650             :                 CenterWindow( false ),
     651             :                 DisplayPDFDocumentTitle( true ),
     652             :                 PageLayout( PDFWriter::DefaultLayout ),
     653             :                 FirstPageLeft( false ),
     654             :                 InitialPage( 1 ),
     655             :                 OpenBookmarkLevels( -1 ),
     656             :                 Encryption(),
     657             :                 SignPDF( false ),
     658             :                 DPIx( 0 ),
     659             :                 DPIy( 0 ),
     660             :                 ColorMode( PDFWriter::DrawColor ),
     661           0 :                 SignCertificate( 0 )
     662           0 :         {}
     663             :     };
     664             : 
     665             :     PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
     666             :     ~PDFWriter();
     667             : 
     668             :     /** Returns an OutputDevice for formatting
     669             :         This Output device is guaranteed to use the same
     670             :         font metrics as the resulting PDF file.
     671             : 
     672             :         @returns
     673             :         the reference output device
     674             :     */
     675             :     OutputDevice* GetReferenceDevice();
     676             : 
     677             :     /** Creates a new page to fill
     678             :         If width and height are not set the page size
     679             :         is inherited from the page tree
     680             :         other effects:
     681             :         resets the graphics state: MapMode, Font
     682             :         Colors and other state information MUST
     683             :         be set again or are undefined.
     684             : 
     685             :         @returns
     686             :         returns the page id of the new page
     687             :     */
     688             :     sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
     689             :     /** Play a metafile like an outputdevice would do
     690             :     */
     691             :     struct PlayMetafileContext
     692             :     {
     693             :         int     m_nMaxImageResolution;
     694             :         bool    m_bOnlyLosslessCompression;
     695             :         int     m_nJPEGQuality;
     696             :         bool    m_bTransparenciesWereRemoved;
     697             : 
     698           0 :         PlayMetafileContext()
     699             :         : m_nMaxImageResolution( 0 )
     700             :         , m_bOnlyLosslessCompression( false )
     701             :         , m_nJPEGQuality( 90 )
     702           0 :         , m_bTransparenciesWereRemoved( false )
     703           0 :         {}
     704             : 
     705             :     };
     706             :     void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
     707             : 
     708             :     /* sets the document locale originally passed with the context to a new value
     709             :      * only affects the output if used before calling Emit.
     710             :      */
     711             :     void SetDocumentLocale( const com::sun::star::lang::Locale& rDocLocale );
     712             : 
     713             :     /* finishes the file */
     714             :     bool Emit();
     715             : 
     716             :     /*
     717             :      * Get a list of errors that occurred during processing
     718             :      * this should enable the producer to give feedback about
     719             :      * any anomalies that might have occurred
     720             :      */
     721             :     std::set< ErrorCode > GetErrors();
     722             : 
     723             :     static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
     724             :            InitEncryption( const OUString& i_rOwnerPassword,
     725             :                            const OUString& i_rUserPassword,
     726             :                            bool b128Bit
     727             :                          );
     728             : 
     729             :     /* functions for graphics state */
     730             :     /* flag values: see vcl/outdev.hxx */
     731             :     void                Push( sal_uInt16 nFlags = 0xffff );
     732             :     void                Pop();
     733             : 
     734             :     void               SetClipRegion();
     735             :     void               SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
     736             :     void               MoveClipRegion( long nHorzMove, long nVertMove );
     737             :     void               IntersectClipRegion( const Rectangle& rRect );
     738             :     void               IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
     739             : 
     740             :     void               SetLayoutMode( sal_uLong nMode );
     741             :     void               SetDigitLanguage( LanguageType eLang );
     742             : 
     743             :     void               SetLineColor( const Color& rColor );
     744           0 :     void               SetLineColor() { SetLineColor( Color( COL_TRANSPARENT ) ); }
     745             : 
     746             :     void               SetFillColor( const Color& rColor );
     747           0 :     void               SetFillColor() { SetFillColor( Color( COL_TRANSPARENT ) ); }
     748             : 
     749             :     void               SetFont( const Font& rNewFont );
     750             :     void               SetTextColor( const Color& rColor );
     751             :     void               SetTextFillColor();
     752             :     void               SetTextFillColor( const Color& rColor );
     753             : 
     754             :     void               SetTextLineColor();
     755             :     void               SetTextLineColor( const Color& rColor );
     756             :     void               SetOverlineColor();
     757             :     void               SetOverlineColor( const Color& rColor );
     758             :     void               SetTextAlign( ::TextAlign eAlign );
     759             : 
     760             :     void               SetMapMode( const MapMode& rNewMapMode );
     761             : 
     762             : 
     763             :     /* actual drawing functions */
     764             :     void                DrawText( const Point& rPos, const OUString& rText );
     765             : 
     766             :     void                DrawTextLine( const Point& rPos, long nWidth,
     767             :                                       FontStrikeout eStrikeout,
     768             :                                       FontUnderline eUnderline,
     769             :                                       FontUnderline eOverline,
     770             :                                       bool bUnderlineAbove = false );
     771             :     void                DrawTextArray( const Point& rStartPt, const OUString& rStr,
     772             :                                        const sal_Int32* pDXAry,
     773             :                                        sal_Int32 nIndex,
     774             :                                        sal_Int32 nLen );
     775             :     void                DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
     776             :                                          const OUString& rStr,
     777             :                                          sal_Int32 nIndex, sal_Int32 nLen );
     778             :     void                DrawText( const Rectangle& rRect,
     779             :                                   const OUString& rStr, sal_uInt16 nStyle = 0 );
     780             : 
     781             :     void                DrawPixel( const Point& rPt, const Color& rColor );
     782           0 :     void                DrawPixel( const Point& rPt )
     783           0 :     { DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
     784             : 
     785             :     void                DrawLine( const Point& rStartPt, const Point& rEndPt );
     786             :     void                DrawLine( const Point& rStartPt, const Point& rEndPt,
     787             :                                   const LineInfo& rLineInfo );
     788             :     void                DrawPolyLine( const Polygon& rPoly );
     789             :     void                DrawPolyLine( const Polygon& rPoly,
     790             :                                       const LineInfo& rLineInfo );
     791             :     void                DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
     792             :     void                DrawPolygon( const Polygon& rPoly );
     793             :     void                DrawPolyPolygon( const PolyPolygon& rPolyPoly );
     794             :     void                DrawRect( const Rectangle& rRect );
     795             :     void                DrawRect( const Rectangle& rRect,
     796             :                                   sal_uLong nHorzRount, sal_uLong nVertRound );
     797             :     void                DrawEllipse( const Rectangle& rRect );
     798             :     void                DrawArc( const Rectangle& rRect,
     799             :                                  const Point& rStartPt, const Point& rEndPt );
     800             :     void                DrawPie( const Rectangle& rRect,
     801             :                                  const Point& rStartPt, const Point& rEndPt );
     802             :     void                DrawChord( const Rectangle& rRect,
     803             :                                    const Point& rStartPt, const Point& rEndPt );
     804             : 
     805             :     void                DrawBitmap( const Point& rDestPt, const Size& rDestSize,
     806             :                                     const Bitmap& rBitmap );
     807             : 
     808             :     void                DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
     809             :                                       const BitmapEx& rBitmapEx );
     810             : 
     811             :     void                DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
     812             :     void                DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
     813             : 
     814             :     void                DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
     815             : 
     816             :     void                DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
     817             :     void                DrawTransparent( const PolyPolygon& rPolyPoly,
     818             :                                          sal_uInt16 nTransparencePercent );
     819             : 
     820             :     /** Start a transparency group
     821             : 
     822             :     Drawing operations can be grouped together to acquire a common transparency
     823             :     behaviour; after calling BeginTransparencyGroup all drawing
     824             :     operations will be grouped together into a transparent object.
     825             : 
     826             :     The transparency behaviour is set with ond of the EndTransparencyGroup
     827             :     calls and can be either a constant transparency factor or a transparent
     828             :     soft mask in form of an 8 bit gray scale bitmap.
     829             : 
     830             :     It is permissible to nest transparency group.
     831             : 
     832             :     Transparency groups MUST NOT span multiple pages
     833             : 
     834             :     Transparency is a feature introduced in PDF1.4, so transparency group
     835             :     will be ignored if the produced PDF has a lower version. The drawing
     836             :     operations will be emitted normally.
     837             :     */
     838             :     void                BeginTransparencyGroup();
     839             : 
     840             :     /** End a transparency group with constant transparency factor
     841             : 
     842             :     This ends a transparency group and inserts it on the current page. The
     843             :     coordinates of the group result out of the grouped drawing operations.
     844             : 
     845             :     @param rBoundRect
     846             :     The bounding rectangle of the group
     847             : 
     848             :     @param nTransparencePercent
     849             :     The transparency factor
     850             :     */
     851             :     void                EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
     852             : 
     853             :     /** Insert a JPG encoded image (optionally with mask)
     854             : 
     855             :     @param rJPGData
     856             :     a Stream containing the encoded image
     857             : 
     858             :     @param bIsTrueColor
     859             :     true: jpeg is 24 bit true color, false: jpeg is 8 bit greyscale
     860             : 
     861             :     @param rSrcSizePixel
     862             :     size in pixel of the image
     863             : 
     864             :     @param rTargetArea
     865             :     where to put the image
     866             : 
     867             :     @param rMask
     868             :     optional mask; if not empty it must have
     869             :     the same pixel size as the image and
     870             :     be either 1 bit black&white or 8 bit grey
     871             :     */
     872             :     void                DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
     873             : 
     874             :     /** Create a new named destination to be used in a link from another PDF document
     875             : 
     876             :     @param sDestName
     877             :     the name (label) of the bookmark, to be used to jump to
     878             : 
     879             :     @param rRect
     880             :     target rectangle on page to be displayed if dest is jumped to
     881             : 
     882             :     @param nPageNr
     883             :     number of page the dest is on (as returned by NewPage)
     884             :     or -1 in which case the current page is used
     885             : 
     886             :     @param eType
     887             :     what dest type to use
     888             : 
     889             :     @returns
     890             :     the destination id (to be used in SetLinkDest) or
     891             :     -1 if page id does not exist
     892             :     */
     893             :     sal_Int32           CreateNamedDest( const OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
     894             :     /** Create a new destination to be used in a link
     895             : 
     896             :     @param rRect
     897             :     target rectangle on page to be displayed if dest is jumped to
     898             : 
     899             :     @param nPageNr
     900             :     number of page the dest is on (as returned by NewPage)
     901             :     or -1 in which case the current page is used
     902             : 
     903             :     @param eType
     904             :     what dest type to use
     905             : 
     906             :     @returns
     907             :     the destination id (to be used in SetLinkDest) or
     908             :     -1 if page id does not exist
     909             :     */
     910             :     sal_Int32           CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
     911             :     /** Create a new link on a page
     912             : 
     913             :     @param rRect
     914             :     active rectangle of the link (that is the area that has to be
     915             :     hit to activate the link)
     916             : 
     917             :     @param nPageNr
     918             :     number of page the link is on (as returned by NewPage)
     919             :     or -1 in which case the current page is used
     920             : 
     921             :     @returns
     922             :     the link id (to be used in SetLinkDest, SetLinkURL) or
     923             :     -1 if page id does not exist
     924             :     */
     925             :     sal_Int32           CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
     926             : 
     927             :     /** creates a destination which is not intended to be referred to by a link, but by a public destination Id.
     928             : 
     929             :         Form widgets, for instance, might refer to a destination, without ever actually creating a source link to
     930             :         point to this destination. In such cases, a public destination Id will be assigned to the form widget,
     931             :         and later on, the concrete destination data for this public Id will be registered using RegisterDestReference.
     932             : 
     933             :         @param nDestId
     934             :             destination ID
     935             : 
     936             :         @param rRect
     937             :             target rectangle on page to be displayed if dest is jumped to
     938             : 
     939             :         @param nPageNr
     940             :             number of page the dest is on (as returned by NewPage)
     941             :             or -1 in which case the current page is used
     942             : 
     943             :         @param eType
     944             :             what dest type to use
     945             : 
     946             :         @returns
     947             :             the internal destination Id.
     948             :     */
     949             :     sal_Int32           RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
     950             : 
     951             : 
     952             :     /** Set the destination for a link
     953             :         will change a URL type link to a dest link if necessary
     954             : 
     955             :         @param nLinkId
     956             :         the link to be changed
     957             : 
     958             :         @param nDestId
     959             :         the dest the link shall point to
     960             :         @returns
     961             :         0 for success
     962             :         -1 in case the link id does not exist
     963             :         -2 in case the dest id does not exist
     964             :     */
     965             :     sal_Int32           SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
     966             :     /** Set the URL for a link
     967             :         will change a dest type link to an URL type link if necessary
     968             :         @param nLinkId
     969             :         the link to be changed
     970             : 
     971             :         @param rURL
     972             :         the URL the link shall point to.
     973             :         The URL will be parsed (and corrected) by the com.sun.star.util.URLTransformer
     974             :         service; the result will then appear literally in the PDF file produced
     975             : 
     976             :         @returns
     977             :         0 for success
     978             :         -1 in case the link id does not exist
     979             :     */
     980             :     sal_Int32           SetLinkURL( sal_Int32 nLinkId, const OUString& rURL );
     981             :     /** Resolve link in logical structure
     982             : 
     983             :         If a link is created after the corresponding visual appearance was drawn
     984             :         it is not possible to set the link id as a property attribute to the
     985             :         link structure item that should be created in tagged PDF around the
     986             :         visual appearance of a link.
     987             : 
     988             :         For this reason an arbitrary id can be given to
     989             :         SetStructureAttributeNumerical at the time the text for
     990             :         the link is drawn. To resolve this arbitrary id again when the actual
     991             :         link annotation is created use SetLinkPropertyID. When Emit
     992             :         finally gets called all LinkAnnotation type structure attributes
     993             :         will be replaced with the correct link id.
     994             : 
     995             :         CAUTION: this technique must be used either for all or none of the links
     996             :         in a document since the link id space and arbitrary property id space
     997             :         could overlap and it would be impossible to resolve whether a Link
     998             :         structure attribute value was arbitrary or already a real id.
     999             : 
    1000             :         @param nLinkId
    1001             :         the link to be mapped
    1002             : 
    1003             :         @param nPropertyID
    1004             :         the arbitrary id set in a Link structure element to address
    1005             :         the link with real id nLinkId
    1006             :      */
    1007             :     void                SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
    1008             :     /** Create a new outline item
    1009             : 
    1010             :         @param nParent
    1011             :         declares the parent of the new item in the outline hierarchy.
    1012             :         An invalid value will result in a new toplevel item.
    1013             : 
    1014             :         @param rText
    1015             :         sets the title text of the item
    1016             : 
    1017             :         @param nDestID
    1018             :         declares which Dest (created with CreateDest) the outline item
    1019             :         will point to
    1020             : 
    1021             :         @returns
    1022             :         the outline item id of the new item
    1023             :     */
    1024             :     sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const OUString& rText = OUString(), sal_Int32 nDestID = -1 );
    1025             : 
    1026             :     /** Set an outline item's parent
    1027             : 
    1028             :     @param nItem
    1029             :     specififies which item should be reparented.
    1030             : 
    1031             :     @param nNewParent
    1032             :     specifies which outline item will be the item's new parent.
    1033             :     Use 0 for reparenting to top level.
    1034             : 
    1035             :     @returns
    1036             :     -1 if the item does not exist
    1037             :     -2 if the new parent does not exist, item will be reparented to top level.
    1038             :     */
    1039             :     sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
    1040             : 
    1041             :     /** Set an outline item's title text
    1042             : 
    1043             :     @param nItem
    1044             :     specififies which item should get a new text
    1045             : 
    1046             :     @param rText
    1047             :     sets the title text of the item
    1048             : 
    1049             :     @returns
    1050             :     0 if the item exists and the text was changed
    1051             :     -1 if the item does not exist
    1052             :     */
    1053             :     sal_Int32 SetOutlineItemText( sal_Int32 nItem, const OUString& rText );
    1054             : 
    1055             :     /** Set an outline item's destination
    1056             : 
    1057             :     @param nItem
    1058             :     specififies which item should get a new dest
    1059             : 
    1060             :     @param nDestID
    1061             :     specifies the item's new destination
    1062             : 
    1063             :     @returns
    1064             :     -1 if the item does not exist
    1065             :     -2 if the new dest does not exist, dest will remain unchanged
    1066             :     */
    1067             :     sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
    1068             : 
    1069             :     /** Create a new note on a page
    1070             : 
    1071             :     @param rRect
    1072             :     active rectangle of the note (that is the area that has to be
    1073             :     hit to popup the annotation)
    1074             : 
    1075             :     @param rNote
    1076             :     specifies the contents of the note
    1077             : 
    1078             :     @param nPageNr
    1079             :     number of page the note is on (as returned by NewPage)
    1080             :     or -1 in which case the current page is used
    1081             :     */
    1082             :     void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
    1083             : 
    1084             :     /** begin a new logical structure element
    1085             : 
    1086             :     BeginStructureElement/EndStructureElement calls build the logical structure
    1087             :     of the PDF - the basis for tagged PDF. Structural elements are implemented
    1088             :     using marked content tags. Each structural element can contain sub elements
    1089             :     (e.g. a section can contain a heading and a paragraph). The structure hierarchy
    1090             :     is build automatically from the Begin/EndStructureElement calls.
    1091             : 
    1092             :     A structural element need not be contained on one page; e.g. paragraphs often
    1093             :     run from one page to the next. In this case the corresponding EndStructureElement
    1094             :     must be called while drawing the next page.
    1095             : 
    1096             :     BeginStructureElement and EndStructureElement must be called only after
    1097             :     PDFWriter::NewPage has been called and before PDFWriter::Emit gets called. The
    1098             :     current page number is an implicit context parameter for Begin/EndStructureElement.
    1099             : 
    1100             :     For pagination artifacts that are not part of the logical structure
    1101             :     of the document (like header, footer or page number) the special
    1102             :     StructElement NonStructElement exists. To place content
    1103             :     outside of the struture tree simply call
    1104             :     BeginStructureElement( NonStructElement ) then draw your
    1105             :     content and then call EndStructureElement(). All children
    1106             :     of a NonStructElement will not be part of the structure.
    1107             :     Nonetheless if you add a child structural element to a
    1108             :     NonStructElement you will still have to call
    1109             :     EndStructureElement for it. Best think of the structure
    1110             :     tree as a stack.
    1111             : 
    1112             :     Note: there is always one structural element in existance without having
    1113             :     called BeginStructureElement; this is the root of the structure
    1114             :     tree (called StructTreeRoot). The StructTreeRoot has always the id 0.
    1115             : 
    1116             :     @param eType
    1117             :     denotes what kind of element to begin (e.g. a heading or paragraph)
    1118             : 
    1119             :     @param rAlias
    1120             :     the specified alias will be used as structure tag. Also an entry in the PDF's
    1121             :     role map will be created mapping alias to regular structure type.
    1122             : 
    1123             :     @returns
    1124             :     the new structure element's id for use in SetCurrentStructureElement
    1125             :      */
    1126             :      sal_Int32 BeginStructureElement( enum StructElement eType, const OUString& rAlias = OUString() );
    1127             :     /** end the current logical structure element
    1128             : 
    1129             :     Close the current structure element. The current element's
    1130             :     parent becomes the current structure element again.
    1131             : 
    1132             :     @see BeginStructureElement
    1133             :      */
    1134             :     void EndStructureElement();
    1135             :     /** set the current structure element
    1136             : 
    1137             :     For different purposes it may be useful to paint a structure element's
    1138             :     content discontinously. In that case an already existing structure element
    1139             :     can be appended to by using SetCurrentStructureElement. The
    1140             :     refenrenced structure element becomes the current structure element with
    1141             :     all consequences: all following structure elements are appended as children
    1142             :     of the current element.
    1143             : 
    1144             :     @param nElement
    1145             :     the id of the new current structure element
    1146             : 
    1147             :     @returns
    1148             :     True if the current structure element could be set successfully
    1149             :     False if the current structure element could not be changed
    1150             :     (e.g. if the passed element id is invalid)
    1151             :      */
    1152             :     bool SetCurrentStructureElement( sal_Int32 nElement );
    1153             : 
    1154             :     /** set a structure attribute on the current structural element
    1155             : 
    1156             :     SetStructureAttribute sets an attribute of the current structural element to a
    1157             :     new value. A consistency check is performed before actually setting the value;
    1158             :     if the check fails, the function returns False and the attribute remains
    1159             :     unchanged.
    1160             : 
    1161             :     @param eAttr
    1162             :     denotes what attribute to change
    1163             : 
    1164             :     @param eVal
    1165             :     the value to set the attribute to
    1166             : 
    1167             :     @returns
    1168             :     True if the value was valid and the change has been performed,
    1169             :     False if the attribute or value was invalid; attribute remains unchanged
    1170             :      */
    1171             :     bool SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
    1172             :     /** set a structure attribute on the current structural element
    1173             : 
    1174             :     SetStructureAttributeNumerical sets an attribute of the current structural element
    1175             :     to a new numerical value. A consistency check is performed before actually setting
    1176             :     the value; if the check fails, the function returns False and the attribute
    1177             :     remains unchanged.
    1178             : 
    1179             :     @param eAttr
    1180             :     denotes what attribute to change
    1181             : 
    1182             :     @param nValue
    1183             :     the value to set the attribute to
    1184             : 
    1185             :     @returns
    1186             :     True if the value was valid and the change has been performed,
    1187             :     False if the attribute or value was invalid; attribute remains unchanged
    1188             :      */
    1189             :     bool SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
    1190             :     /** set the bounding box of a structural element
    1191             : 
    1192             :     SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
    1193             :     attribute can only be applied to Table, Figure,
    1194             :     Form and Formula elements, a call of this function
    1195             :     for other element types will be ignored and the BBox attribute not be set.
    1196             : 
    1197             :     @param rRect
    1198             :     the new bounding box for the structural element
    1199             :      */
    1200             :     void SetStructureBoundingBox( const Rectangle& rRect );
    1201             : 
    1202             :     /** set the ActualText attribute of a structural element
    1203             : 
    1204             :     ActualText contains the Unicode text without layout artifacts that is shown by
    1205             :     a structural element. For example if a line is ended prematurely with a break in
    1206             :     a word and continued on the next line (e.g. "happen-<newline>stance") the
    1207             :     corresponding ActualText would contain the unbroken line (e.g. "happenstance").
    1208             : 
    1209             :     @param rText
    1210             :     contains the complete logical text the structural element displays.
    1211             :      */
    1212             :     void SetActualText( const OUString& rText );
    1213             : 
    1214             :     /** set the Alt attribute of a strutural element
    1215             : 
    1216             :     Alt is s replacement text describing the contents of a structural element. This
    1217             :     is mainly used by accessibility applications; e.g. a screen reader would read
    1218             :     the Alt replacement text for an image to a visually impaired user.
    1219             : 
    1220             :     @param rText
    1221             :     contains the replacement text for the structural element
    1222             :     */
    1223             :     void SetAlternateText( const OUString& rText );
    1224             : 
    1225             :     /** Sets the time in seconds a page will appear before the next
    1226             :         page is shown automatically
    1227             : 
    1228             :         @param nSeconds
    1229             :         time in seconds the current page will be shown; pass 0 for manual advancement
    1230             : 
    1231             :         @param nPageNr
    1232             :         the page number to apply the autoadvance time to; -1 denotes the current page
    1233             :     */
    1234             :     void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
    1235             : 
    1236             :     /** Sets the transitional effect to be applied when the current page gets shown.
    1237             : 
    1238             :     @param eType
    1239             :     the kind of effect to be used; use Regular to disable transitional effects
    1240             :     for this page
    1241             : 
    1242             :     @param nMilliSec
    1243             :     the duration of the transitional effect in milliseconds;
    1244             :     set 0 to disable transitional effects
    1245             : 
    1246             :     @param nPageNr
    1247             :     the page number to apply the effect to; -1 denotes the current page
    1248             :     */
    1249             :     void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
    1250             : 
    1251             :     /** create a new form control
    1252             : 
    1253             :     This function creates a new form control in the PDF and sets its various
    1254             :     properties. Do not pass an actual AnyWidget as rControlType
    1255             :     will be cast to the type described by the type member.
    1256             : 
    1257             :     @param rControlType
    1258             :     a descendant of AnyWidget determing the control's properties
    1259             : 
    1260             :     @param nPageNr
    1261             :     the page number to apply the effect to; -1 denotes the current page
    1262             : 
    1263             :     @returns
    1264             :     the new control's id for reference purposes
    1265             :      */
    1266             :     sal_Int32 CreateControl( const AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
    1267             : 
    1268             :     /** Inserts an additional stream to the PDF file
    1269             : 
    1270             :     This function adds an arbitrary stream to the produced PDF file. May be called
    1271             :     any time before Emit(). The stream will be written during
    1272             :     Emit by calling the PDFOutputStream Object's write
    1273             :     method. After the call the PDFOutputStream will be deleted.
    1274             : 
    1275             :     All additional streams and their mimetypes will be entered into an array
    1276             :     in the trailer dictionary.
    1277             : 
    1278             :     @param rMimeType
    1279             :     the mimetype of the stream
    1280             : 
    1281             :     @param pStream
    1282             :     the interface to the additional stream
    1283             : 
    1284             :     @param bCompress
    1285             :     specifies whether the stream should be flate encoded by PDFWriter or not
    1286             :     */
    1287             :     void AddStream( const OUString& rMimeType, PDFOutputStream* pStream, bool bCompress );
    1288             : 
    1289             : };
    1290             : 
    1291             : }
    1292             : 
    1293             : #endif // INCLUDED_VCL_PDFWRITER_HXX
    1294             : 
    1295             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10