• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 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 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36 // $hash=fdbd26f9dd20dbd7813fc17a8c34650b2da19581$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 ///
50 // Structure representing print settings.
51 ///
52 typedef struct _cef_print_settings_t {
53   ///
54   // Base structure.
55   ///
56   cef_base_ref_counted_t base;
57 
58   ///
59   // Returns true (1) if this object is valid. Do not call any other functions
60   // if this function returns false (0).
61   ///
62   int(CEF_CALLBACK* is_valid)(struct _cef_print_settings_t* self);
63 
64   ///
65   // Returns true (1) if the values of this object are read-only. Some APIs may
66   // expose read-only objects.
67   ///
68   int(CEF_CALLBACK* is_read_only)(struct _cef_print_settings_t* self);
69 
70   ///
71   // Set the page orientation.
72   ///
73   void(CEF_CALLBACK* set_orientation)(struct _cef_print_settings_t* self,
74                                       int landscape);
75 
76   ///
77   // Returns true (1) if the orientation is landscape.
78   ///
79   int(CEF_CALLBACK* is_landscape)(struct _cef_print_settings_t* self);
80 
81   ///
82   // Set the printer printable area in device units. Some platforms already
83   // provide flipped area. Set |landscape_needs_flip| to false (0) on those
84   // platforms to avoid double flipping.
85   ///
86   void(CEF_CALLBACK* set_printer_printable_area)(
87       struct _cef_print_settings_t* self,
88       const cef_size_t* physical_size_device_units,
89       const cef_rect_t* printable_area_device_units,
90       int landscape_needs_flip);
91 
92   ///
93   // Set the device name.
94   ///
95   void(CEF_CALLBACK* set_device_name)(struct _cef_print_settings_t* self,
96                                       const cef_string_t* name);
97 
98   ///
99   // Get the device name.
100   ///
101   // The resulting string must be freed by calling cef_string_userfree_free().
102   cef_string_userfree_t(CEF_CALLBACK* get_device_name)(
103       struct _cef_print_settings_t* self);
104 
105   ///
106   // Set the DPI (dots per inch).
107   ///
108   void(CEF_CALLBACK* set_dpi)(struct _cef_print_settings_t* self, int dpi);
109 
110   ///
111   // Get the DPI (dots per inch).
112   ///
113   int(CEF_CALLBACK* get_dpi)(struct _cef_print_settings_t* self);
114 
115   ///
116   // Set the page ranges.
117   ///
118   void(CEF_CALLBACK* set_page_ranges)(struct _cef_print_settings_t* self,
119                                       size_t rangesCount,
120                                       cef_range_t const* ranges);
121 
122   ///
123   // Returns the number of page ranges that currently exist.
124   ///
125   size_t(CEF_CALLBACK* get_page_ranges_count)(
126       struct _cef_print_settings_t* self);
127 
128   ///
129   // Retrieve the page ranges.
130   ///
131   void(CEF_CALLBACK* get_page_ranges)(struct _cef_print_settings_t* self,
132                                       size_t* rangesCount,
133                                       cef_range_t* ranges);
134 
135   ///
136   // Set whether only the selection will be printed.
137   ///
138   void(CEF_CALLBACK* set_selection_only)(struct _cef_print_settings_t* self,
139                                          int selection_only);
140 
141   ///
142   // Returns true (1) if only the selection will be printed.
143   ///
144   int(CEF_CALLBACK* is_selection_only)(struct _cef_print_settings_t* self);
145 
146   ///
147   // Set whether pages will be collated.
148   ///
149   void(CEF_CALLBACK* set_collate)(struct _cef_print_settings_t* self,
150                                   int collate);
151 
152   ///
153   // Returns true (1) if pages will be collated.
154   ///
155   int(CEF_CALLBACK* will_collate)(struct _cef_print_settings_t* self);
156 
157   ///
158   // Set the color model.
159   ///
160   void(CEF_CALLBACK* set_color_model)(struct _cef_print_settings_t* self,
161                                       cef_color_model_t model);
162 
163   ///
164   // Get the color model.
165   ///
166   cef_color_model_t(CEF_CALLBACK* get_color_model)(
167       struct _cef_print_settings_t* self);
168 
169   ///
170   // Set the number of copies.
171   ///
172   void(CEF_CALLBACK* set_copies)(struct _cef_print_settings_t* self,
173                                  int copies);
174 
175   ///
176   // Get the number of copies.
177   ///
178   int(CEF_CALLBACK* get_copies)(struct _cef_print_settings_t* self);
179 
180   ///
181   // Set the duplex mode.
182   ///
183   void(CEF_CALLBACK* set_duplex_mode)(struct _cef_print_settings_t* self,
184                                       cef_duplex_mode_t mode);
185 
186   ///
187   // Get the duplex mode.
188   ///
189   cef_duplex_mode_t(CEF_CALLBACK* get_duplex_mode)(
190       struct _cef_print_settings_t* self);
191 } cef_print_settings_t;
192 
193 ///
194 // Create a new cef_print_settings_t object.
195 ///
196 CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif  // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
203