xref: /AOO41X/main/sw/inc/printdata.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef SW_PRINTDATA_HXX
28*cdf0e10cSrcweir #define SW_PRINTDATA_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include <sal/types.h>
32*cdf0e10cSrcweir #include <rtl/ustring.hxx>
33*cdf0e10cSrcweir #include <vcl/print.hxx>
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #include <set>
36*cdf0e10cSrcweir #include <map>
37*cdf0e10cSrcweir #include <vector>
38*cdf0e10cSrcweir #include <utility>
39*cdf0e10cSrcweir 
40*cdf0e10cSrcweir class SwPageFrm;
41*cdf0e10cSrcweir class SwDoc;
42*cdf0e10cSrcweir class SwDocShell;
43*cdf0e10cSrcweir class ViewShell;
44*cdf0e10cSrcweir class _SetGetExpFlds;
45*cdf0e10cSrcweir class SwViewOption;
46*cdf0e10cSrcweir class OutputDevice;
47*cdf0e10cSrcweir class SwViewOptionAdjust_Impl;
48*cdf0e10cSrcweir class SwPrtOptions;
49*cdf0e10cSrcweir class ViewShell;
50*cdf0e10cSrcweir class SfxViewShell;
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir // forward declarations
53*cdf0e10cSrcweir class SwPrintUIOptions;
54*cdf0e10cSrcweir class SwRenderData;
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir ////////////////////////////////////////////////////////////
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir class SwPrintData
60*cdf0e10cSrcweir {
61*cdf0e10cSrcweir     const SwPrintUIOptions *    m_pPrintUIOptions;  // not owner
62*cdf0e10cSrcweir     const SwRenderData *        m_pRenderData;      // not owner
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir public:
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir     sal_Bool bPrintGraphic, bPrintTable, bPrintDraw, bPrintControl, bPrintPageBackground,
67*cdf0e10cSrcweir              bPrintBlackFont,
68*cdf0e10cSrcweir              //#i81434# - printing of hidden text
69*cdf0e10cSrcweir              bPrintHiddenText, bPrintTextPlaceholder,
70*cdf0e10cSrcweir              bPrintLeftPages, bPrintRightPages, bPrintReverse, bPrintProspect,
71*cdf0e10cSrcweir              bPrintProspectRTL,
72*cdf0e10cSrcweir              bPrintSingleJobs, bPaperFromSetup,
73*cdf0e10cSrcweir              // --> FME 2005-12-13 #b6354161# Print empty pages
74*cdf0e10cSrcweir              bPrintEmptyPages,
75*cdf0e10cSrcweir              // <--
76*cdf0e10cSrcweir              // #i56195# no field update while printing mail merge documents
77*cdf0e10cSrcweir              bUpdateFieldsInPrinting,
78*cdf0e10cSrcweir              bModified;
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir     sal_Int16           nPrintPostIts;
81*cdf0e10cSrcweir     rtl::OUString       sFaxName;
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir     SwPrintData()
84*cdf0e10cSrcweir     {
85*cdf0e10cSrcweir         m_pPrintUIOptions       = NULL;
86*cdf0e10cSrcweir         m_pRenderData        = NULL;
87*cdf0e10cSrcweir 
88*cdf0e10cSrcweir         bPrintGraphic           =
89*cdf0e10cSrcweir         bPrintTable             =
90*cdf0e10cSrcweir         bPrintDraw              =
91*cdf0e10cSrcweir         bPrintControl           =
92*cdf0e10cSrcweir         bPrintLeftPages         =
93*cdf0e10cSrcweir         bPrintRightPages        =
94*cdf0e10cSrcweir         bPrintPageBackground    =
95*cdf0e10cSrcweir         bPrintEmptyPages        =
96*cdf0e10cSrcweir         bUpdateFieldsInPrinting = sal_True;
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir         bPaperFromSetup         =
99*cdf0e10cSrcweir         bPrintReverse           =
100*cdf0e10cSrcweir         bPrintProspect          =
101*cdf0e10cSrcweir         bPrintProspectRTL       =
102*cdf0e10cSrcweir         bPrintSingleJobs        =
103*cdf0e10cSrcweir         bModified               =
104*cdf0e10cSrcweir         bPrintBlackFont         =
105*cdf0e10cSrcweir         bPrintHiddenText        =
106*cdf0e10cSrcweir         bPrintTextPlaceholder   = sal_False;
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir         nPrintPostIts           = 0;
109*cdf0e10cSrcweir     }
110*cdf0e10cSrcweir 
111*cdf0e10cSrcweir     virtual ~SwPrintData() {}
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     sal_Bool operator==(const SwPrintData& rData)const
114*cdf0e10cSrcweir     {
115*cdf0e10cSrcweir         return
116*cdf0e10cSrcweir         bPrintGraphic       ==   rData.bPrintGraphic        &&
117*cdf0e10cSrcweir         bPrintTable         ==   rData.bPrintTable          &&
118*cdf0e10cSrcweir         bPrintDraw          ==   rData.bPrintDraw           &&
119*cdf0e10cSrcweir         bPrintControl       ==   rData.bPrintControl        &&
120*cdf0e10cSrcweir         bPrintPageBackground==   rData.bPrintPageBackground &&
121*cdf0e10cSrcweir         bPrintBlackFont     ==   rData.bPrintBlackFont      &&
122*cdf0e10cSrcweir         bPrintLeftPages     ==   rData.bPrintLeftPages      &&
123*cdf0e10cSrcweir         bPrintRightPages    ==   rData.bPrintRightPages     &&
124*cdf0e10cSrcweir         bPrintReverse       ==   rData.bPrintReverse        &&
125*cdf0e10cSrcweir         bPrintProspect      ==   rData.bPrintProspect       &&
126*cdf0e10cSrcweir         bPrintProspectRTL   ==   rData.bPrintProspectRTL    &&
127*cdf0e10cSrcweir         bPrintSingleJobs    ==   rData.bPrintSingleJobs     &&
128*cdf0e10cSrcweir         bPaperFromSetup     ==   rData.bPaperFromSetup      &&
129*cdf0e10cSrcweir         bPrintEmptyPages    ==   rData.bPrintEmptyPages     &&
130*cdf0e10cSrcweir         bUpdateFieldsInPrinting == rData.bUpdateFieldsInPrinting &&
131*cdf0e10cSrcweir         nPrintPostIts       ==   rData.nPrintPostIts        &&
132*cdf0e10cSrcweir         sFaxName            ==   rData.sFaxName             &&
133*cdf0e10cSrcweir         bPrintHiddenText    ==   rData.bPrintHiddenText     &&
134*cdf0e10cSrcweir         bPrintTextPlaceholder   ==   rData.bPrintTextPlaceholder;
135*cdf0e10cSrcweir     }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir     // Note: in the context where this class ist used the pointers should always be valid
138*cdf0e10cSrcweir     // during the lifetime of this object
139*cdf0e10cSrcweir     const SwPrintUIOptions &    GetPrintUIOptions() const       { return *m_pPrintUIOptions; }
140*cdf0e10cSrcweir     const SwRenderData &        GetRenderData() const           { return *m_pRenderData; }
141*cdf0e10cSrcweir     void  SetPrintUIOptions( const SwPrintUIOptions *pOpt )     { m_pPrintUIOptions = pOpt; }
142*cdf0e10cSrcweir     void  SetRenderData( const SwRenderData *pData )            { m_pRenderData = pData; }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir     sal_Bool IsPrintGraphic() const             { return bPrintGraphic; }
145*cdf0e10cSrcweir     sal_Bool IsPrintTable() const               { return bPrintTable; }
146*cdf0e10cSrcweir     sal_Bool IsPrintDraw() const                { return bPrintDraw; }
147*cdf0e10cSrcweir     sal_Bool IsPrintControl() const             { return bPrintControl; }
148*cdf0e10cSrcweir     sal_Bool IsPrintLeftPage() const            { return bPrintLeftPages; }
149*cdf0e10cSrcweir     sal_Bool IsPrintRightPage() const           { return bPrintRightPages; }
150*cdf0e10cSrcweir     sal_Bool IsPrintReverse() const             { return bPrintReverse; }
151*cdf0e10cSrcweir     sal_Bool IsPaperFromSetup() const           { return bPaperFromSetup; }
152*cdf0e10cSrcweir     sal_Bool IsPrintEmptyPages() const          { return bPrintEmptyPages; }
153*cdf0e10cSrcweir     sal_Bool IsPrintProspect() const            { return bPrintProspect; }
154*cdf0e10cSrcweir     sal_Bool IsPrintProspectRTL() const         { return bPrintProspectRTL; }
155*cdf0e10cSrcweir     sal_Bool IsPrintPageBackground() const      { return bPrintPageBackground; }
156*cdf0e10cSrcweir     sal_Bool IsPrintBlackFont() const           { return bPrintBlackFont; }
157*cdf0e10cSrcweir     sal_Bool IsPrintSingleJobs() const          { return bPrintSingleJobs; }
158*cdf0e10cSrcweir     sal_Int16 GetPrintPostIts() const           { return nPrintPostIts; }
159*cdf0e10cSrcweir     const rtl::OUString GetFaxName() const      { return sFaxName; }
160*cdf0e10cSrcweir     sal_Bool IsPrintHiddenText() const          { return bPrintHiddenText; }
161*cdf0e10cSrcweir     sal_Bool IsPrintTextPlaceholder() const     { return bPrintTextPlaceholder; }
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     void SetPrintGraphic( sal_Bool b )              { doSetModified(); bPrintGraphic = b; }
164*cdf0e10cSrcweir     void SetPrintTable( sal_Bool b )                { doSetModified(); bPrintTable = b; }
165*cdf0e10cSrcweir     void SetPrintDraw( sal_Bool b )                 { doSetModified(); bPrintDraw = b; }
166*cdf0e10cSrcweir     void SetPrintControl( sal_Bool b )              { doSetModified(); bPrintControl = b; }
167*cdf0e10cSrcweir     void SetPrintLeftPage( sal_Bool b )             { doSetModified(); bPrintLeftPages = b; }
168*cdf0e10cSrcweir     void SetPrintRightPage( sal_Bool b )            { doSetModified(); bPrintRightPages = b; }
169*cdf0e10cSrcweir     void SetPrintReverse( sal_Bool b )              { doSetModified(); bPrintReverse = b; }
170*cdf0e10cSrcweir     void SetPaperFromSetup( sal_Bool b )            { doSetModified(); bPaperFromSetup = b; }
171*cdf0e10cSrcweir     void SetPrintEmptyPages( sal_Bool b )           { doSetModified(); bPrintEmptyPages = b; }
172*cdf0e10cSrcweir     void SetPrintPostIts( sal_Int16 n )             { doSetModified(); nPrintPostIts = n; }
173*cdf0e10cSrcweir     void SetPrintProspect( sal_Bool b )             { doSetModified(); bPrintProspect = b; }
174*cdf0e10cSrcweir     void SetPrintProspect_RTL( sal_Bool b )         { doSetModified(); bPrintProspectRTL = b; }
175*cdf0e10cSrcweir     void SetPrintPageBackground( sal_Bool b )       { doSetModified(); bPrintPageBackground = b; }
176*cdf0e10cSrcweir     void SetPrintBlackFont( sal_Bool b )            { doSetModified(); bPrintBlackFont = b; }
177*cdf0e10cSrcweir     void SetPrintSingleJobs( sal_Bool b )           { doSetModified(); bPrintSingleJobs = b; }
178*cdf0e10cSrcweir     void SetFaxName( const rtl::OUString& rSet )    { sFaxName = rSet; }
179*cdf0e10cSrcweir     void SetPrintHiddenText( sal_Bool b )           { doSetModified(); bPrintHiddenText = b; }
180*cdf0e10cSrcweir     void SetPrintTextPlaceholder( sal_Bool b )      { doSetModified(); bPrintTextPlaceholder = b; }
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     virtual void doSetModified () { bModified = sal_True;}
183*cdf0e10cSrcweir };
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir ////////////////////////////////////////////////////////////
187*cdf0e10cSrcweir 
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir class SwPrintUIOptions : public vcl::PrinterOptionsHelper
190*cdf0e10cSrcweir {
191*cdf0e10cSrcweir     OutputDevice* m_pLast;
192*cdf0e10cSrcweir     const SwPrintData & m_rDefaultPrintData;
193*cdf0e10cSrcweir 
194*cdf0e10cSrcweir public:
195*cdf0e10cSrcweir     SwPrintUIOptions( bool bWeb, bool bSwSrcView, bool bHasSelection, bool bHasPostIts, const SwPrintData &rDefaultPrintData );
196*cdf0e10cSrcweir     virtual ~SwPrintUIOptions();
197*cdf0e10cSrcweir 
198*cdf0e10cSrcweir     bool processPropertiesAndCheckFormat( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp );
199*cdf0e10cSrcweir 
200*cdf0e10cSrcweir     bool IsPrintFormControls() const            { return getBoolValue( "PrintControls",        m_rDefaultPrintData.bPrintControl ); }
201*cdf0e10cSrcweir     bool IsPrintPageBackground() const          { return getBoolValue( "PrintPageBackground",  m_rDefaultPrintData.bPrintPageBackground ); }
202*cdf0e10cSrcweir     bool IsPrintProspect() const                { return getBoolValue( "PrintProspect",        m_rDefaultPrintData.bPrintProspect ); }
203*cdf0e10cSrcweir     bool IsPrintProspectRTL() const             { return getIntValue( "PrintProspectRTL",      m_rDefaultPrintData.bPrintProspectRTL ) ? true : false; }
204*cdf0e10cSrcweir     bool IsPrintTextPlaceholders() const        { return getBoolValue( "PrintTextPlaceholder", m_rDefaultPrintData.bPrintTextPlaceholder ); }
205*cdf0e10cSrcweir     bool IsPrintHiddenText() const              { return getBoolValue( "PrintHiddenText",      m_rDefaultPrintData.bPrintHiddenText ); }
206*cdf0e10cSrcweir     bool IsPrintWithBlackTextColor() const      { return getBoolValue( "PrintBlackFonts",      m_rDefaultPrintData.bPrintBlackFont ); }
207*cdf0e10cSrcweir     sal_Int16 GetPrintPostItsType() const       { return static_cast< sal_Int16 >(getIntValue( "PrintAnnotationMode", m_rDefaultPrintData.nPrintPostIts )); }
208*cdf0e10cSrcweir     bool IsPaperFromSetup() const               { return getBoolValue( "PrintPaperFromSetup",  m_rDefaultPrintData.bPaperFromSetup ); }
209*cdf0e10cSrcweir     bool IsPrintReverse() const                 { return false; /*handled by print dialog now*/ /*getBoolValue( "PrintReversed",        m_rDefaultPrintData.bPrintReverse );*/ }
210*cdf0e10cSrcweir 
211*cdf0e10cSrcweir     bool IsPrintLeftPages() const;
212*cdf0e10cSrcweir     bool IsPrintRightPages() const;
213*cdf0e10cSrcweir     bool IsPrintEmptyPages( bool bIsPDFExport ) const;
214*cdf0e10cSrcweir     bool IsPrintTables() const;
215*cdf0e10cSrcweir     bool IsPrintGraphics() const;
216*cdf0e10cSrcweir     bool IsPrintDrawings() const;
217*cdf0e10cSrcweir };
218*cdf0e10cSrcweir 
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir ////////////////////////////////////////////////////////////
221*cdf0e10cSrcweir 
222*cdf0e10cSrcweir // A class that stores temporary data that is needed for rendering the document.
223*cdf0e10cSrcweir // Usually this data is created when 'getRendererCount' is called and
224*cdf0e10cSrcweir // and it is used in the 'render' function of that same interface
225*cdf0e10cSrcweir class SwRenderData
226*cdf0e10cSrcweir {
227*cdf0e10cSrcweir     // pages valid for printing (according to the current settings)
228*cdf0e10cSrcweir     // and their respective start frames (see getRendererCount in unotxdoc.cxx)
229*cdf0e10cSrcweir     // This set of pages does NOT depend on the 'PageRange' that is used as a printing option!
230*cdf0e10cSrcweir     std::set< sal_Int32 >                       m_aValidPages;          // the set of possible pages (see StringRangeEnumerator::getRangesFromString )
231*cdf0e10cSrcweir     std::map< sal_Int32, const SwPageFrm * >    m_aValidStartFrames;    // the map of start frames for those pages
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir     // printer paper tray to use for each of the m_aValidPages above
234*cdf0e10cSrcweir     std::map< sal_Int32, sal_Int32 >            m_aPrinterPaperTrays;
235*cdf0e10cSrcweir 
236*cdf0e10cSrcweir     // vector of pages and their order to be printed (duplicates and any order allowed!)
237*cdf0e10cSrcweir     // (see 'render' in unotxdoc.cxx)
238*cdf0e10cSrcweir     std::vector< sal_Int32 >                    m_aPagesToPrint;
239*cdf0e10cSrcweir 
240*cdf0e10cSrcweir     std::vector< const SwPageFrm * >            m_aPostItStartFrames;
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir     // for prospect printing: the pairs of pages to be printed together on a single prospect page.
243*cdf0e10cSrcweir     // -1 indicates a half page to be left empty.
244*cdf0e10cSrcweir     std::vector< std::pair< sal_Int32, sal_Int32 > >    m_aPagePairs;
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir     rtl::OUString               m_aPageRange;
247*cdf0e10cSrcweir 
248*cdf0e10cSrcweir     // the view options to be applied for printing
249*cdf0e10cSrcweir     SwViewOptionAdjust_Impl *   m_pViewOptionAdjust;
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir     SwPrintData *               m_pPrtOptions;
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir public:
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir     // PostIt relevant data
256*cdf0e10cSrcweir     _SetGetExpFlds *    m_pPostItFields;    // an array of "_SetGetExpFld *" sorted by page and line numbers
257*cdf0e10cSrcweir     SwDoc *             m_pPostItDoc;
258*cdf0e10cSrcweir     ViewShell *         m_pPostItShell;
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir public:
261*cdf0e10cSrcweir     SwRenderData();
262*cdf0e10cSrcweir     ~SwRenderData();
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir     bool HasPostItData() const  { return m_pPostItShell != 0 && m_pPostItDoc != 0 && m_pPostItShell != 0; }
266*cdf0e10cSrcweir     void CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev );
267*cdf0e10cSrcweir     void DeletePostItData();
268*cdf0e10cSrcweir 
269*cdf0e10cSrcweir     bool IsViewOptionAdjust() const  { return m_pViewOptionAdjust != 0; }
270*cdf0e10cSrcweir     bool NeedNewViewOptionAdjust( const ViewShell& ) const;
271*cdf0e10cSrcweir     void ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rViewOptions );
272*cdf0e10cSrcweir     void ViewOptionAdjust( SwPrintData const* const pPrtOptions );
273*cdf0e10cSrcweir     void ViewOptionAdjustStop();
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir     bool HasSwPrtOptions() const    { return m_pPrtOptions != 0; }
276*cdf0e10cSrcweir     void SetSwPrtOptions(SwPrintData *const pOpt)   { m_pPrtOptions = pOpt; }
277*cdf0e10cSrcweir     SwPrintData const*  GetSwPrtOptions() const     { return m_pPrtOptions; }
278*cdf0e10cSrcweir     SwPrintData &       GetSwPrtOptionsRef()        { return *m_pPrtOptions; }
279*cdf0e10cSrcweir     void MakeSwPrtOptions( SwPrintData & rOptions, const SwDocShell *pDocShell,
280*cdf0e10cSrcweir             const SwPrintUIOptions *pOpt, const SwRenderData *pData, bool bIsPDFExport );
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 
283*cdf0e10cSrcweir     typedef std::map< sal_Int32, const SwPageFrm * >            ValidStartFramesMap_t;
284*cdf0e10cSrcweir     typedef std::vector< std::pair< sal_Int32, sal_Int32 > >    PagePairsVec_t;
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir     std::set< sal_Int32 > &             GetValidPagesSet()          { return m_aValidPages; }
287*cdf0e10cSrcweir     const std::set< sal_Int32 > &       GetValidPagesSet() const    { return m_aValidPages; }
288*cdf0e10cSrcweir     ValidStartFramesMap_t &             GetValidStartFrames()       { return m_aValidStartFrames; }
289*cdf0e10cSrcweir     const ValidStartFramesMap_t &       GetValidStartFrames() const { return m_aValidStartFrames; }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir     // a map for printer paper tray numbers to use for each document page
292*cdf0e10cSrcweir     // a value of -1 for the tray means that there is no specific tray defined
293*cdf0e10cSrcweir     std::map< sal_Int32, sal_Int32 >&        GetPrinterPaperTrays()          { return m_aPrinterPaperTrays; }
294*cdf0e10cSrcweir     const std::map< sal_Int32, sal_Int32 >&  GetPrinterPaperTrays() const    { return m_aPrinterPaperTrays; }
295*cdf0e10cSrcweir 
296*cdf0e10cSrcweir     // used for 'normal' printing
297*cdf0e10cSrcweir     // A page value of 0 as entry indicates that this page is not from the document but
298*cdf0e10cSrcweir     // from the post-it document. (See also GetPostItStartFrame below)
299*cdf0e10cSrcweir     std::vector< sal_Int32 > &          GetPagesToPrint()           { return m_aPagesToPrint; }
300*cdf0e10cSrcweir     const std::vector< sal_Int32 > &    GetPagesToPrint() const     { return m_aPagesToPrint; }
301*cdf0e10cSrcweir 
302*cdf0e10cSrcweir     // used for 'normal' printing with post-its
303*cdf0e10cSrcweir     // - if the map entry will be NULL then the respective page to be printed is from
304*cdf0e10cSrcweir     // the document. In that case use the value from GetPagesToPrint at the same index to
305*cdf0e10cSrcweir     // get the phys. page number to be printed, and then retrieve the start frame to use
306*cdf0e10cSrcweir     // from GetValidStartFrms.
307*cdf0e10cSrcweir     // - If the entry is not NULL it is the start frame of the page from the post-it document
308*cdf0e10cSrcweir     // that is to be printed
309*cdf0e10cSrcweir     std::vector< const SwPageFrm * > &          GetPostItStartFrames()          { return m_aPostItStartFrames; }
310*cdf0e10cSrcweir     const std::vector< const SwPageFrm * > &    GetPostItStartFrames() const    { return m_aPostItStartFrames; }
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir     // used for prospect printing only
313*cdf0e10cSrcweir     PagePairsVec_t &                    GetPagePairsForProspectPrinting()           { return m_aPagePairs; }
314*cdf0e10cSrcweir     const PagePairsVec_t &              GetPagePairsForProspectPrinting() const     { return m_aPagePairs; }
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir     rtl::OUString   GetPageRange() const                            { return m_aPageRange; }
317*cdf0e10cSrcweir     void            SetPageRange( const rtl::OUString &rRange )     { m_aPageRange = rRange; }
318*cdf0e10cSrcweir };
319*cdf0e10cSrcweir 
320*cdf0e10cSrcweir 
321*cdf0e10cSrcweir ////////////////////////////////////////////////////////////
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir // last remnants of swprtopt.hxx:
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir #define POSTITS_NONE	0
326*cdf0e10cSrcweir #define POSTITS_ONLY	1
327*cdf0e10cSrcweir #define POSTITS_ENDDOC	2
328*cdf0e10cSrcweir #define POSTITS_ENDPAGE 3
329*cdf0e10cSrcweir 
330*cdf0e10cSrcweir namespace sw {
331*cdf0e10cSrcweir 
332*cdf0e10cSrcweir void InitPrintOptionsFromApplication(SwPrintData & o_rData, bool const bWeb);
333*cdf0e10cSrcweir 
334*cdf0e10cSrcweir } // namespace sw
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir #endif  // SW_PRINTDATA_HXX
337