xref: /trunk/main/sw/inc/IDocumentDeviceAccess.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24  #ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
25  #define IDOCUMENTDEVICEACCESS_HXX_INCLUDED
26 
27  class SfxPrinter;
28  class JobSetup;
29  class SwPrintData;
30  class VirtualDevice;
31  class OutputDevice;
32 
33  /** Provides access to the formatting devices of a document
34  */
35  class IDocumentDeviceAccess
36  {
37  public:
38 
39     /** Return the printer set at the document.
40 
41        @param bCreate
42        [in] if set, a printer will be created if not already done.
43 
44        @returns
45        the printer set at the document.
46 	*/
47     virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const = 0;
48 
49     /** Set the printer at the document.
50 
51        @param pP
52        [in] the new printer or 0.
53 
54        @param bDeleteOld
55        [in] if set, the old printer will be deleted.
56 
57        @param bCallPrtDataChanged
58        [in] if set, triggers all necessary invalidations.
59 
60        @returns
61        the printer set at the document.
62     */
63     virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged ) = 0;
64 
65     /** Return the virtual device set at the document.
66 
67        @param bCreate
68        [in] if set, a virtual device will be created if not already done.
69 
70        @returns
71        the virtual device set at the document.
72     */
73     virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const = 0;
74 
75     /** Sets the current virtual device
76 
77        @param pVd
78        [in] the new virtual device.
79 
80        @param bDeleteOld
81        [in] if set, the old virtual device will be deleted.
82 
83        @param bCallVirDevDataChanged
84        [in] if set, triggers all necessary invalidations.
85      */
86     virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged ) = 0;
87 
88     /** Returns the current reference device
89 
90        @param bCreate
91        [in] if set, the reference device will be created if not already done.
92 
93        @returns
94        the current reference device
95      */
96     virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const = 0;
97 
98     /** Sets the type of the reference device used for formatting the document
99 
100        @param bNewVirtual
101        [in] if set, the reference device will be a virtual device, otherwise
102             the printer is used for formatting the document
103 
104        @param bNewHiRes
105        [in] if set, the virtual device will be the HiRes virtual device
106      */
107     virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual, /*[in]*/ bool bNewHiRes ) = 0;
108 
109     /** Returns the Jobsetup
110 
111        @returns
112        the current Jobsetup
113      */
114     virtual const JobSetup* getJobsetup() const = 0;
115 
116     /** Sets the Jobsetup
117 
118        @param rJobSetup
119        [in] the new Jobsetup.
120      */
121     virtual void  setJobsetup(/*[in]*/ const JobSetup& rJobSetup ) = 0;
122 
123     /** Returns the PrintData
124 
125        @returns
126        the current PrintData
127      */
128     virtual const SwPrintData & getPrintData() const = 0;
129 
130     /** Sets the PrintData
131 
132        @param rPrtData
133        [in] the new PrintData.
134      */
135     virtual void setPrintData(/*[in]*/ const SwPrintData& rPrtData) = 0;
136 
137  protected:
138     virtual ~IDocumentDeviceAccess() {};
139  };
140 
141  #endif // IDOCUMENTDEVICEACCESS_HXX_INCLUDED
142