]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/cef_print_settings.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / cef_print_settings.h
1 // Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // The contents of this file must follow a specific format in order to
33 // support the CEF translator tool. See the translator.README.txt file in the
34 // tools directory for more information.
35 //
36
37 #ifndef CEF_INCLUDE_CEF_PRINT_SETTINGS_H_
38 #define CEF_INCLUDE_CEF_PRINT_SETTINGS_H_
39 #pragma once
40
41 #include <vector>
42
43 #include "include/cef_base.h"
44
45 ///
46 // Class representing print settings.
47 ///
48 /*--cef(source=library)--*/
49 class CefPrintSettings : public virtual CefBase {
50  public:
51   typedef cef_color_model_t ColorModel;
52   typedef cef_duplex_mode_t DuplexMode;
53   typedef std::vector<CefPageRange> PageRangeList;
54
55   ///
56   // Create a new CefPrintSettings object.
57   ///
58   /*--cef()--*/
59   static CefRefPtr<CefPrintSettings> Create();
60
61   ///
62   // Returns true if this object is valid. Do not call any other methods if this
63   // function returns false.
64   ///
65   /*--cef()--*/
66   virtual bool IsValid() =0;
67
68   ///
69   // Returns true if the values of this object are read-only. Some APIs may
70   // expose read-only objects.
71   ///
72   /*--cef()--*/
73   virtual bool IsReadOnly() =0;
74
75   ///
76   // Returns a writable copy of this object.
77   ///
78   /*--cef()--*/
79   virtual CefRefPtr<CefPrintSettings> Copy() =0;
80
81   ///
82   // Set the page orientation.
83   ///
84   /*--cef()--*/
85   virtual void SetOrientation(bool landscape) =0;
86
87   ///
88   // Returns true if the orientation is landscape.
89   ///
90   /*--cef()--*/
91   virtual bool IsLandscape() =0;
92
93   ///
94   // Set the printer printable area in device units.
95   // Some platforms already provide flipped area. Set |landscape_needs_flip|
96   // to false on those platforms to avoid double flipping.
97   ///
98   /*--cef()--*/
99   virtual void SetPrinterPrintableArea(
100       const CefSize& physical_size_device_units,
101       const CefRect& printable_area_device_units,
102       bool landscape_needs_flip) =0;
103
104   ///
105   // Set the device name.
106   ///
107   /*--cef(optional_param=name)--*/
108   virtual void SetDeviceName(const CefString& name) =0;
109
110   ///
111   // Get the device name.
112   ///
113   /*--cef()--*/
114   virtual CefString GetDeviceName() =0;
115
116   ///
117   // Set the DPI (dots per inch).
118   ///
119   /*--cef()--*/
120   virtual void SetDPI(int dpi) =0;
121
122   ///
123   // Get the DPI (dots per inch).
124   ///
125   /*--cef()--*/
126   virtual int GetDPI() =0;
127
128   ///
129   // Set the page ranges.
130   ///
131   /*--cef()--*/
132   virtual void SetPageRanges(const PageRangeList& ranges) =0;
133
134   ///
135   // Returns the number of page ranges that currently exist.
136   ///
137   /*--cef()--*/
138   virtual size_t GetPageRangesCount() =0;
139
140   ///
141   // Retrieve the page ranges.
142   ///
143   /*--cef(count_func=ranges:GetPageRangesCount)--*/
144   virtual void GetPageRanges(PageRangeList& ranges) =0;
145
146   ///
147   // Set whether only the selection will be printed.
148   ///
149   /*--cef()--*/
150   virtual void SetSelectionOnly(bool selection_only) =0;
151
152   ///
153   // Returns true if only the selection will be printed.
154   ///
155   /*--cef()--*/
156   virtual bool IsSelectionOnly() =0;
157
158   ///
159   // Set whether pages will be collated.
160   ///
161   /*--cef()--*/
162   virtual void SetCollate(bool collate) =0;
163
164   ///
165   // Returns true if pages will be collated.
166   ///
167   /*--cef()--*/
168   virtual bool WillCollate() =0;
169
170   ///
171   // Set the color model.
172   ///
173   /*--cef()--*/
174   virtual void SetColorModel(ColorModel model) =0;
175
176   ///
177   // Get the color model.
178   ///
179   /*--cef(default_retval=COLOR_MODEL_UNKNOWN)--*/
180   virtual ColorModel GetColorModel() =0;
181
182   ///
183   // Set the number of copies.
184   ///
185   /*--cef()--*/
186   virtual void SetCopies(int copies) =0;
187
188   ///
189   // Get the number of copies.
190   ///
191   /*--cef()--*/
192   virtual int GetCopies() =0;
193
194   ///
195   // Set the duplex mode.
196   ///
197   /*--cef()--*/
198   virtual void SetDuplexMode(DuplexMode mode) =0;
199
200   ///
201   // Get the duplex mode.
202   ///
203   /*--cef(default_retval=DUPLEX_MODE_UNKNOWN)--*/
204   virtual DuplexMode GetDuplexMode() =0;
205 };
206
207 #endif  // CEF_INCLUDE_CEF_PRINT_SETTINGS_H_
208