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

Generated by: LCOV version 1.10