1 | /* GTK - The GIMP Toolkit |
2 | * gtkprintsettings.h: Print Settings |
3 | * Copyright (C) 2006, Red Hat, Inc. |
4 | * |
5 | * This library is free software; you can redistribute it and/or |
6 | * modify it under the terms of the GNU Lesser General Public |
7 | * License as published by the Free Software Foundation; either |
8 | * version 2 of the License, or (at your option) any later version. |
9 | * |
10 | * This library is distributed in the hope that it will be useful, |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | * Lesser General Public License for more details. |
14 | * |
15 | * You should have received a copy of the GNU Lesser General Public |
16 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
17 | */ |
18 | |
19 | #ifndef __GTK_PRINT_SETTINGS_H__ |
20 | #define __GTK_PRINT_SETTINGS_H__ |
21 | |
22 | #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION) |
23 | #error "Only <gtk/gtk.h> can be included directly." |
24 | #endif |
25 | |
26 | #include <gtk/gtkpapersize.h> |
27 | |
28 | G_BEGIN_DECLS |
29 | |
30 | typedef struct _GtkPrintSettings GtkPrintSettings; |
31 | |
32 | #define GTK_TYPE_PRINT_SETTINGS (gtk_print_settings_get_type ()) |
33 | #define GTK_PRINT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_SETTINGS, GtkPrintSettings)) |
34 | #define GTK_IS_PRINT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_SETTINGS)) |
35 | |
36 | typedef void (*GtkPrintSettingsFunc) (const gchar *key, |
37 | const gchar *value, |
38 | gpointer user_data); |
39 | |
40 | typedef struct _GtkPageRange ; |
41 | /** |
42 | * GtkPageRange: |
43 | * @start: start of page range. |
44 | * @end: end of page range. |
45 | * |
46 | * See also gtk_print_settings_set_page_ranges(). |
47 | */ |
48 | struct |
49 | { |
50 | gint ; |
51 | gint ; |
52 | }; |
53 | |
54 | GDK_AVAILABLE_IN_ALL |
55 | GType gtk_print_settings_get_type (void) G_GNUC_CONST; |
56 | GDK_AVAILABLE_IN_ALL |
57 | GtkPrintSettings *gtk_print_settings_new (void); |
58 | |
59 | GDK_AVAILABLE_IN_ALL |
60 | GtkPrintSettings *gtk_print_settings_copy (GtkPrintSettings *other); |
61 | |
62 | GDK_AVAILABLE_IN_ALL |
63 | GtkPrintSettings *gtk_print_settings_new_from_file (const gchar *file_name, |
64 | GError **error); |
65 | GDK_AVAILABLE_IN_ALL |
66 | gboolean gtk_print_settings_load_file (GtkPrintSettings *settings, |
67 | const gchar *file_name, |
68 | GError **error); |
69 | GDK_AVAILABLE_IN_ALL |
70 | gboolean gtk_print_settings_to_file (GtkPrintSettings *settings, |
71 | const gchar *file_name, |
72 | GError **error); |
73 | GDK_AVAILABLE_IN_ALL |
74 | GtkPrintSettings *gtk_print_settings_new_from_key_file (GKeyFile *key_file, |
75 | const gchar *group_name, |
76 | GError **error); |
77 | GDK_AVAILABLE_IN_ALL |
78 | gboolean gtk_print_settings_load_key_file (GtkPrintSettings *settings, |
79 | GKeyFile *key_file, |
80 | const gchar *group_name, |
81 | GError **error); |
82 | GDK_AVAILABLE_IN_ALL |
83 | void gtk_print_settings_to_key_file (GtkPrintSettings *settings, |
84 | GKeyFile *key_file, |
85 | const gchar *group_name); |
86 | GDK_AVAILABLE_IN_ALL |
87 | gboolean gtk_print_settings_has_key (GtkPrintSettings *settings, |
88 | const gchar *key); |
89 | GDK_AVAILABLE_IN_ALL |
90 | const gchar * gtk_print_settings_get (GtkPrintSettings *settings, |
91 | const gchar *key); |
92 | GDK_AVAILABLE_IN_ALL |
93 | void gtk_print_settings_set (GtkPrintSettings *settings, |
94 | const gchar *key, |
95 | const gchar *value); |
96 | GDK_AVAILABLE_IN_ALL |
97 | void gtk_print_settings_unset (GtkPrintSettings *settings, |
98 | const gchar *key); |
99 | GDK_AVAILABLE_IN_ALL |
100 | void gtk_print_settings_foreach (GtkPrintSettings *settings, |
101 | GtkPrintSettingsFunc func, |
102 | gpointer user_data); |
103 | GDK_AVAILABLE_IN_ALL |
104 | gboolean gtk_print_settings_get_bool (GtkPrintSettings *settings, |
105 | const gchar *key); |
106 | GDK_AVAILABLE_IN_ALL |
107 | void gtk_print_settings_set_bool (GtkPrintSettings *settings, |
108 | const gchar *key, |
109 | gboolean value); |
110 | GDK_AVAILABLE_IN_ALL |
111 | gdouble gtk_print_settings_get_double (GtkPrintSettings *settings, |
112 | const gchar *key); |
113 | GDK_AVAILABLE_IN_ALL |
114 | gdouble gtk_print_settings_get_double_with_default (GtkPrintSettings *settings, |
115 | const gchar *key, |
116 | gdouble def); |
117 | GDK_AVAILABLE_IN_ALL |
118 | void gtk_print_settings_set_double (GtkPrintSettings *settings, |
119 | const gchar *key, |
120 | gdouble value); |
121 | GDK_AVAILABLE_IN_ALL |
122 | gdouble gtk_print_settings_get_length (GtkPrintSettings *settings, |
123 | const gchar *key, |
124 | GtkUnit unit); |
125 | GDK_AVAILABLE_IN_ALL |
126 | void gtk_print_settings_set_length (GtkPrintSettings *settings, |
127 | const gchar *key, |
128 | gdouble value, |
129 | GtkUnit unit); |
130 | GDK_AVAILABLE_IN_ALL |
131 | gint gtk_print_settings_get_int (GtkPrintSettings *settings, |
132 | const gchar *key); |
133 | GDK_AVAILABLE_IN_ALL |
134 | gint gtk_print_settings_get_int_with_default (GtkPrintSettings *settings, |
135 | const gchar *key, |
136 | gint def); |
137 | GDK_AVAILABLE_IN_ALL |
138 | void gtk_print_settings_set_int (GtkPrintSettings *settings, |
139 | const gchar *key, |
140 | gint value); |
141 | |
142 | #define GTK_PRINT_SETTINGS_PRINTER "printer" |
143 | #define GTK_PRINT_SETTINGS_ORIENTATION "orientation" |
144 | #define GTK_PRINT_SETTINGS_PAPER_FORMAT "paper-format" |
145 | #define GTK_PRINT_SETTINGS_PAPER_WIDTH "paper-width" |
146 | #define GTK_PRINT_SETTINGS_PAPER_HEIGHT "paper-height" |
147 | #define GTK_PRINT_SETTINGS_N_COPIES "n-copies" |
148 | #define GTK_PRINT_SETTINGS_DEFAULT_SOURCE "default-source" |
149 | #define GTK_PRINT_SETTINGS_QUALITY "quality" |
150 | #define GTK_PRINT_SETTINGS_RESOLUTION "resolution" |
151 | #define GTK_PRINT_SETTINGS_USE_COLOR "use-color" |
152 | #define GTK_PRINT_SETTINGS_DUPLEX "duplex" |
153 | #define GTK_PRINT_SETTINGS_COLLATE "collate" |
154 | #define GTK_PRINT_SETTINGS_REVERSE "reverse" |
155 | #define GTK_PRINT_SETTINGS_MEDIA_TYPE "media-type" |
156 | #define GTK_PRINT_SETTINGS_DITHER "dither" |
157 | #define GTK_PRINT_SETTINGS_SCALE "scale" |
158 | #define GTK_PRINT_SETTINGS_PRINT_PAGES "print-pages" |
159 | #define GTK_PRINT_SETTINGS_PAGE_RANGES "page-ranges" |
160 | #define GTK_PRINT_SETTINGS_PAGE_SET "page-set" |
161 | #define GTK_PRINT_SETTINGS_FINISHINGS "finishings" |
162 | #define GTK_PRINT_SETTINGS_NUMBER_UP "number-up" |
163 | #define GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT "number-up-layout" |
164 | #define GTK_PRINT_SETTINGS_OUTPUT_BIN "output-bin" |
165 | #define GTK_PRINT_SETTINGS_RESOLUTION_X "resolution-x" |
166 | #define GTK_PRINT_SETTINGS_RESOLUTION_Y "resolution-y" |
167 | #define GTK_PRINT_SETTINGS_PRINTER_LPI "printer-lpi" |
168 | |
169 | /** |
170 | * GTK_PRINT_SETTINGS_OUTPUT_DIR: |
171 | * |
172 | * The key used by the “Print to file” printer to store the |
173 | * directory to which the output should be written. |
174 | * |
175 | * Since: 3.6 |
176 | */ |
177 | #define GTK_PRINT_SETTINGS_OUTPUT_DIR "output-dir" |
178 | |
179 | /** |
180 | * GTK_PRINT_SETTINGS_OUTPUT_BASENAME: |
181 | * |
182 | * The key used by the “Print to file” printer to store the file |
183 | * name of the output without the path to the directory and the |
184 | * file extension. |
185 | * |
186 | * Since: 3.6 |
187 | */ |
188 | #define GTK_PRINT_SETTINGS_OUTPUT_BASENAME "output-basename" |
189 | |
190 | /** |
191 | * GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT: |
192 | * |
193 | * The key used by the “Print to file” printer to store the format |
194 | * of the output. The supported values are “PS” and “PDF”. |
195 | */ |
196 | #define GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT "output-file-format" |
197 | |
198 | /** |
199 | * GTK_PRINT_SETTINGS_OUTPUT_URI: |
200 | * |
201 | * The key used by the “Print to file” printer to store the URI |
202 | * to which the output should be written. GTK+ itself supports |
203 | * only “file://” URIs. |
204 | */ |
205 | #define GTK_PRINT_SETTINGS_OUTPUT_URI "output-uri" |
206 | |
207 | #define GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION "win32-driver-version" |
208 | #define "win32-driver-extra" |
209 | |
210 | /* Helpers: */ |
211 | |
212 | GDK_AVAILABLE_IN_ALL |
213 | const gchar * gtk_print_settings_get_printer (GtkPrintSettings *settings); |
214 | GDK_AVAILABLE_IN_ALL |
215 | void gtk_print_settings_set_printer (GtkPrintSettings *settings, |
216 | const gchar *printer); |
217 | GDK_AVAILABLE_IN_ALL |
218 | GtkPageOrientation gtk_print_settings_get_orientation (GtkPrintSettings *settings); |
219 | GDK_AVAILABLE_IN_ALL |
220 | void gtk_print_settings_set_orientation (GtkPrintSettings *settings, |
221 | GtkPageOrientation orientation); |
222 | GDK_AVAILABLE_IN_ALL |
223 | GtkPaperSize * gtk_print_settings_get_paper_size (GtkPrintSettings *settings); |
224 | GDK_AVAILABLE_IN_ALL |
225 | void gtk_print_settings_set_paper_size (GtkPrintSettings *settings, |
226 | GtkPaperSize *paper_size); |
227 | GDK_AVAILABLE_IN_ALL |
228 | gdouble gtk_print_settings_get_paper_width (GtkPrintSettings *settings, |
229 | GtkUnit unit); |
230 | GDK_AVAILABLE_IN_ALL |
231 | void gtk_print_settings_set_paper_width (GtkPrintSettings *settings, |
232 | gdouble width, |
233 | GtkUnit unit); |
234 | GDK_AVAILABLE_IN_ALL |
235 | gdouble gtk_print_settings_get_paper_height (GtkPrintSettings *settings, |
236 | GtkUnit unit); |
237 | GDK_AVAILABLE_IN_ALL |
238 | void gtk_print_settings_set_paper_height (GtkPrintSettings *settings, |
239 | gdouble height, |
240 | GtkUnit unit); |
241 | GDK_AVAILABLE_IN_ALL |
242 | gboolean gtk_print_settings_get_use_color (GtkPrintSettings *settings); |
243 | GDK_AVAILABLE_IN_ALL |
244 | void gtk_print_settings_set_use_color (GtkPrintSettings *settings, |
245 | gboolean use_color); |
246 | GDK_AVAILABLE_IN_ALL |
247 | gboolean gtk_print_settings_get_collate (GtkPrintSettings *settings); |
248 | GDK_AVAILABLE_IN_ALL |
249 | void gtk_print_settings_set_collate (GtkPrintSettings *settings, |
250 | gboolean collate); |
251 | GDK_AVAILABLE_IN_ALL |
252 | gboolean gtk_print_settings_get_reverse (GtkPrintSettings *settings); |
253 | GDK_AVAILABLE_IN_ALL |
254 | void gtk_print_settings_set_reverse (GtkPrintSettings *settings, |
255 | gboolean reverse); |
256 | GDK_AVAILABLE_IN_ALL |
257 | GtkPrintDuplex gtk_print_settings_get_duplex (GtkPrintSettings *settings); |
258 | GDK_AVAILABLE_IN_ALL |
259 | void gtk_print_settings_set_duplex (GtkPrintSettings *settings, |
260 | GtkPrintDuplex duplex); |
261 | GDK_AVAILABLE_IN_ALL |
262 | GtkPrintQuality gtk_print_settings_get_quality (GtkPrintSettings *settings); |
263 | GDK_AVAILABLE_IN_ALL |
264 | void gtk_print_settings_set_quality (GtkPrintSettings *settings, |
265 | GtkPrintQuality quality); |
266 | GDK_AVAILABLE_IN_ALL |
267 | gint gtk_print_settings_get_n_copies (GtkPrintSettings *settings); |
268 | GDK_AVAILABLE_IN_ALL |
269 | void gtk_print_settings_set_n_copies (GtkPrintSettings *settings, |
270 | gint num_copies); |
271 | GDK_AVAILABLE_IN_ALL |
272 | gint gtk_print_settings_get_number_up (GtkPrintSettings *settings); |
273 | GDK_AVAILABLE_IN_ALL |
274 | void gtk_print_settings_set_number_up (GtkPrintSettings *settings, |
275 | gint number_up); |
276 | GDK_AVAILABLE_IN_ALL |
277 | GtkNumberUpLayout gtk_print_settings_get_number_up_layout (GtkPrintSettings *settings); |
278 | GDK_AVAILABLE_IN_ALL |
279 | void gtk_print_settings_set_number_up_layout (GtkPrintSettings *settings, |
280 | GtkNumberUpLayout number_up_layout); |
281 | GDK_AVAILABLE_IN_ALL |
282 | gint gtk_print_settings_get_resolution (GtkPrintSettings *settings); |
283 | GDK_AVAILABLE_IN_ALL |
284 | void gtk_print_settings_set_resolution (GtkPrintSettings *settings, |
285 | gint resolution); |
286 | GDK_AVAILABLE_IN_ALL |
287 | gint gtk_print_settings_get_resolution_x (GtkPrintSettings *settings); |
288 | GDK_AVAILABLE_IN_ALL |
289 | gint gtk_print_settings_get_resolution_y (GtkPrintSettings *settings); |
290 | GDK_AVAILABLE_IN_ALL |
291 | void gtk_print_settings_set_resolution_xy (GtkPrintSettings *settings, |
292 | gint resolution_x, |
293 | gint resolution_y); |
294 | GDK_AVAILABLE_IN_ALL |
295 | gdouble gtk_print_settings_get_printer_lpi (GtkPrintSettings *settings); |
296 | GDK_AVAILABLE_IN_ALL |
297 | void gtk_print_settings_set_printer_lpi (GtkPrintSettings *settings, |
298 | gdouble lpi); |
299 | GDK_AVAILABLE_IN_ALL |
300 | gdouble gtk_print_settings_get_scale (GtkPrintSettings *settings); |
301 | GDK_AVAILABLE_IN_ALL |
302 | void gtk_print_settings_set_scale (GtkPrintSettings *settings, |
303 | gdouble scale); |
304 | GDK_AVAILABLE_IN_ALL |
305 | GtkPrintPages gtk_print_settings_get_print_pages (GtkPrintSettings *settings); |
306 | GDK_AVAILABLE_IN_ALL |
307 | void gtk_print_settings_set_print_pages (GtkPrintSettings *settings, |
308 | GtkPrintPages pages); |
309 | GDK_AVAILABLE_IN_ALL |
310 | GtkPageRange * gtk_print_settings_get_page_ranges (GtkPrintSettings *settings, |
311 | gint *num_ranges); |
312 | GDK_AVAILABLE_IN_ALL |
313 | void gtk_print_settings_set_page_ranges (GtkPrintSettings *settings, |
314 | GtkPageRange *page_ranges, |
315 | gint num_ranges); |
316 | GDK_AVAILABLE_IN_ALL |
317 | GtkPageSet gtk_print_settings_get_page_set (GtkPrintSettings *settings); |
318 | GDK_AVAILABLE_IN_ALL |
319 | void gtk_print_settings_set_page_set (GtkPrintSettings *settings, |
320 | GtkPageSet page_set); |
321 | GDK_AVAILABLE_IN_ALL |
322 | const gchar * gtk_print_settings_get_default_source (GtkPrintSettings *settings); |
323 | GDK_AVAILABLE_IN_ALL |
324 | void gtk_print_settings_set_default_source (GtkPrintSettings *settings, |
325 | const gchar *default_source); |
326 | GDK_AVAILABLE_IN_ALL |
327 | const gchar * gtk_print_settings_get_media_type (GtkPrintSettings *settings); |
328 | GDK_AVAILABLE_IN_ALL |
329 | void gtk_print_settings_set_media_type (GtkPrintSettings *settings, |
330 | const gchar *media_type); |
331 | GDK_AVAILABLE_IN_ALL |
332 | const gchar * gtk_print_settings_get_dither (GtkPrintSettings *settings); |
333 | GDK_AVAILABLE_IN_ALL |
334 | void gtk_print_settings_set_dither (GtkPrintSettings *settings, |
335 | const gchar *dither); |
336 | GDK_AVAILABLE_IN_ALL |
337 | const gchar * gtk_print_settings_get_finishings (GtkPrintSettings *settings); |
338 | GDK_AVAILABLE_IN_ALL |
339 | void gtk_print_settings_set_finishings (GtkPrintSettings *settings, |
340 | const gchar *finishings); |
341 | GDK_AVAILABLE_IN_ALL |
342 | const gchar * gtk_print_settings_get_output_bin (GtkPrintSettings *settings); |
343 | GDK_AVAILABLE_IN_ALL |
344 | void gtk_print_settings_set_output_bin (GtkPrintSettings *settings, |
345 | const gchar *output_bin); |
346 | |
347 | GDK_AVAILABLE_IN_3_22 |
348 | GVariant *gtk_print_settings_to_gvariant (GtkPrintSettings *settings); |
349 | GDK_AVAILABLE_IN_3_22 |
350 | GtkPrintSettings *gtk_print_settings_new_from_gvariant (GVariant *variant); |
351 | |
352 | |
353 | G_END_DECLS |
354 | |
355 | #endif /* __GTK_PRINT_SETTINGS_H__ */ |
356 | |