1 // Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved.
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
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
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.
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.
30 // ---------------------------------------------------------------------------
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
37 #ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
38 #define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_
41 #include "include/capi/cef_base_capi.h"
49 // Structure representing print settings.
51 typedef struct _cef_print_settings_t {
58 // Returns true (1) if this object is valid. Do not call any other functions
59 // if this function returns false (0).
61 int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self);
64 // Returns true (1) if the values of this object are read-only. Some APIs may
65 // expose read-only objects.
67 int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self);
70 // Returns a writable copy of this object.
72 struct _cef_print_settings_t* (CEF_CALLBACK *copy)(
73 struct _cef_print_settings_t* self);
76 // Set the page orientation.
78 void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self,
82 // Returns true (1) if the orientation is landscape.
84 int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self);
87 // Set the printer printable area in device units. Some platforms already
88 // provide flipped area. Set |landscape_needs_flip| to false (0) on those
89 // platforms to avoid double flipping.
91 void (CEF_CALLBACK *set_printer_printable_area)(
92 struct _cef_print_settings_t* self,
93 const cef_size_t* physical_size_device_units,
94 const cef_rect_t* printable_area_device_units,
95 int landscape_needs_flip);
98 // Set the device name.
100 void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self,
101 const cef_string_t* name);
104 // Get the device name.
106 // The resulting string must be freed by calling cef_string_userfree_free().
107 cef_string_userfree_t (CEF_CALLBACK *get_device_name)(
108 struct _cef_print_settings_t* self);
111 // Set the DPI (dots per inch).
113 void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi);
116 // Get the DPI (dots per inch).
118 int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self);
121 // Set the page ranges.
123 void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self,
124 size_t rangesCount, cef_page_range_t const* ranges);
127 // Returns the number of page ranges that currently exist.
129 size_t (CEF_CALLBACK *get_page_ranges_count)(
130 struct _cef_print_settings_t* self);
133 // Retrieve the page ranges.
135 void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self,
136 size_t* rangesCount, cef_page_range_t* ranges);
139 // Set whether only the selection will be printed.
141 void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self,
145 // Returns true (1) if only the selection will be printed.
147 int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self);
150 // Set whether pages will be collated.
152 void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self,
156 // Returns true (1) if pages will be collated.
158 int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self);
161 // Set the color model.
163 void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self,
164 cef_color_model_t model);
167 // Get the color model.
169 cef_color_model_t (CEF_CALLBACK *get_color_model)(
170 struct _cef_print_settings_t* self);
173 // Set the number of copies.
175 void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self,
179 // Get the number of copies.
181 int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self);
184 // Set the duplex mode.
186 void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self,
187 cef_duplex_mode_t mode);
190 // Get the duplex mode.
192 cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)(
193 struct _cef_print_settings_t* self);
194 } cef_print_settings_t;
198 // Create a new cef_print_settings_t object.
200 CEF_EXPORT cef_print_settings_t* cef_print_settings_create();
207 #endif // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_