1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28  #ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
29  #define IDOCUMENTDEVICEACCESS_HXX_INCLUDED
30 
31  class SfxPrinter;
32  class JobSetup;
33  class SwPrintData;
34  class VirtualDevice;
35  class OutputDevice;
36 
37  /** Provides access to the formatting devices of a document
38  */
39  class IDocumentDeviceAccess
40  {
41  public:
42 
43     /** Return the printer set at the document.
44 
45        @param bCreate
46        [in] if set, a printer will be created if not already done.
47 
48        @returns
49        the printer set at the document.
50 	*/
51     virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const = 0;
52 
53     /** Set the printer at the document.
54 
55        @param pP
56        [in] the new printer or 0.
57 
58        @param bDeleteOld
59        [in] if set, the old printer will be deleted.
60 
61        @param bCallPrtDataChanged
62        [in] if set, triggers all necessary invalidations.
63 
64        @returns
65        the printer set at the document.
66     */
67     virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged ) = 0;
68 
69     /** Return the virtual device set at the document.
70 
71        @param bCreate
72        [in] if set, a virtual device will be created if not already done.
73 
74        @returns
75        the virtual device set at the document.
76     */
77     virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const = 0;
78 
79     /** Sets the current virtual device
80 
81        @param pVd
82        [in] the new virtual device.
83 
84        @param bDeleteOld
85        [in] if set, the old virtual device will be deleted.
86 
87        @param bCallVirDevDataChanged
88        [in] if set, triggers all necessary invalidations.
89      */
90     virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged ) = 0;
91 
92     /** Returns the current reference device
93 
94        @param bCreate
95        [in] if set, the reference device will be created if not already done.
96 
97        @returns
98        the current reference device
99      */
100     virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const = 0;
101 
102     /** Sets the type of the reference device used for formatting the document
103 
104        @param bNewVirtual
105        [in] if set, the reference device will be a virtual device, otherwise
106             the printer is used for formatting the document
107 
108        @param bNewHiRes
109        [in] if set, the virtual device will be the HiRes virtual device
110      */
111     virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual, /*[in]*/ bool bNewHiRes ) = 0;
112 
113     /** Returns the Jobsetup
114 
115        @returns
116        the current Jobsetup
117      */
118     virtual const JobSetup* getJobsetup() const = 0;
119 
120     /** Sets the Jobsetup
121 
122        @param rJobSetup
123        [in] the new Jobsetup.
124      */
125     virtual void  setJobsetup(/*[in]*/ const JobSetup& rJobSetup ) = 0;
126 
127     /** Returns the PrintData
128 
129        @returns
130        the current PrintData
131      */
132     virtual const SwPrintData & getPrintData() const = 0;
133 
134     /** Sets the PrintData
135 
136        @param rPrtData
137        [in] the new PrintData.
138      */
139     virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData) = 0;
140 
141  protected:
142     virtual ~IDocumentDeviceAccess() {};
143  };
144 
145  #endif // IDOCUMENTDEVICEACCESS_HXX_INCLUDED
146