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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __GTK_PRINT_SETTINGS_H__
22#define __GTK_PRINT_SETTINGS_H__
23
24#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
25#error "Only <gtk/gtk.h> can be included directly."
26#endif
27
28#include <gtk/gtkpapersize.h>
29
30G_BEGIN_DECLS
31
32typedef struct _GtkPrintSettings GtkPrintSettings;
33
34#define GTK_TYPE_PRINT_SETTINGS (gtk_print_settings_get_type ())
35#define GTK_PRINT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_SETTINGS, GtkPrintSettings))
36#define GTK_IS_PRINT_SETTINGS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_SETTINGS))
37
38typedef void (*GtkPrintSettingsFunc) (const gchar *key,
39 const gchar *value,
40 gpointer user_data);
41
42typedef struct _GtkPageRange GtkPageRange;
43struct _GtkPageRange
44{
45 gint start;
46 gint end;
47};
48
49GType gtk_print_settings_get_type (void) G_GNUC_CONST;
50GtkPrintSettings *gtk_print_settings_new (void);
51
52GtkPrintSettings *gtk_print_settings_copy (GtkPrintSettings *other);
53
54GtkPrintSettings *gtk_print_settings_new_from_file (const gchar *file_name,
55 GError **error);
56gboolean gtk_print_settings_load_file (GtkPrintSettings *settings,
57 const gchar *file_name,
58 GError **error);
59gboolean gtk_print_settings_to_file (GtkPrintSettings *settings,
60 const gchar *file_name,
61 GError **error);
62GtkPrintSettings *gtk_print_settings_new_from_key_file (GKeyFile *key_file,
63 const gchar *group_name,
64 GError **error);
65gboolean gtk_print_settings_load_key_file (GtkPrintSettings *settings,
66 GKeyFile *key_file,
67 const gchar *group_name,
68 GError **error);
69void gtk_print_settings_to_key_file (GtkPrintSettings *settings,
70 GKeyFile *key_file,
71 const gchar *group_name);
72gboolean gtk_print_settings_has_key (GtkPrintSettings *settings,
73 const gchar *key);
74const gchar * gtk_print_settings_get (GtkPrintSettings *settings,
75 const gchar *key);
76void gtk_print_settings_set (GtkPrintSettings *settings,
77 const gchar *key,
78 const gchar *value);
79void gtk_print_settings_unset (GtkPrintSettings *settings,
80 const gchar *key);
81void gtk_print_settings_foreach (GtkPrintSettings *settings,
82 GtkPrintSettingsFunc func,
83 gpointer user_data);
84gboolean gtk_print_settings_get_bool (GtkPrintSettings *settings,
85 const gchar *key);
86void gtk_print_settings_set_bool (GtkPrintSettings *settings,
87 const gchar *key,
88 gboolean value);
89gdouble gtk_print_settings_get_double (GtkPrintSettings *settings,
90 const gchar *key);
91gdouble gtk_print_settings_get_double_with_default (GtkPrintSettings *settings,
92 const gchar *key,
93 gdouble def);
94void gtk_print_settings_set_double (GtkPrintSettings *settings,
95 const gchar *key,
96 gdouble value);
97gdouble gtk_print_settings_get_length (GtkPrintSettings *settings,
98 const gchar *key,
99 GtkUnit unit);
100void gtk_print_settings_set_length (GtkPrintSettings *settings,
101 const gchar *key,
102 gdouble value,
103 GtkUnit unit);
104gint gtk_print_settings_get_int (GtkPrintSettings *settings,
105 const gchar *key);
106gint gtk_print_settings_get_int_with_default (GtkPrintSettings *settings,
107 const gchar *key,
108 gint def);
109void gtk_print_settings_set_int (GtkPrintSettings *settings,
110 const gchar *key,
111 gint value);
112
113#define GTK_PRINT_SETTINGS_PRINTER "printer"
114#define GTK_PRINT_SETTINGS_ORIENTATION "orientation"
115#define GTK_PRINT_SETTINGS_PAPER_FORMAT "paper-format"
116#define GTK_PRINT_SETTINGS_PAPER_WIDTH "paper-width"
117#define GTK_PRINT_SETTINGS_PAPER_HEIGHT "paper-height"
118#define GTK_PRINT_SETTINGS_N_COPIES "n-copies"
119#define GTK_PRINT_SETTINGS_DEFAULT_SOURCE "default-source"
120#define GTK_PRINT_SETTINGS_QUALITY "quality"
121#define GTK_PRINT_SETTINGS_RESOLUTION "resolution"
122#define GTK_PRINT_SETTINGS_USE_COLOR "use-color"
123#define GTK_PRINT_SETTINGS_DUPLEX "duplex"
124#define GTK_PRINT_SETTINGS_COLLATE "collate"
125#define GTK_PRINT_SETTINGS_REVERSE "reverse"
126#define GTK_PRINT_SETTINGS_MEDIA_TYPE "media-type"
127#define GTK_PRINT_SETTINGS_DITHER "dither"
128#define GTK_PRINT_SETTINGS_SCALE "scale"
129#define GTK_PRINT_SETTINGS_PRINT_PAGES "print-pages"
130#define GTK_PRINT_SETTINGS_PAGE_RANGES "page-ranges"
131#define GTK_PRINT_SETTINGS_PAGE_SET "page-set"
132#define GTK_PRINT_SETTINGS_FINISHINGS "finishings"
133#define GTK_PRINT_SETTINGS_NUMBER_UP "number-up"
134#define GTK_PRINT_SETTINGS_NUMBER_UP_LAYOUT "number-up-layout"
135#define GTK_PRINT_SETTINGS_OUTPUT_BIN "output-bin"
136#define GTK_PRINT_SETTINGS_RESOLUTION_X "resolution-x"
137#define GTK_PRINT_SETTINGS_RESOLUTION_Y "resolution-y"
138#define GTK_PRINT_SETTINGS_PRINTER_LPI "printer-lpi"
139
140#define GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT "output-file-format"
141#define GTK_PRINT_SETTINGS_OUTPUT_URI "output-uri"
142
143#define GTK_PRINT_SETTINGS_WIN32_DRIVER_VERSION "win32-driver-version"
144#define GTK_PRINT_SETTINGS_WIN32_DRIVER_EXTRA "win32-driver-extra"
145
146/* Helpers: */
147
148const gchar *gtk_print_settings_get_printer (GtkPrintSettings *settings);
149void gtk_print_settings_set_printer (GtkPrintSettings *settings,
150 const gchar *printer);
151GtkPageOrientation gtk_print_settings_get_orientation (GtkPrintSettings *settings);
152void gtk_print_settings_set_orientation (GtkPrintSettings *settings,
153 GtkPageOrientation orientation);
154GtkPaperSize * gtk_print_settings_get_paper_size (GtkPrintSettings *settings);
155void gtk_print_settings_set_paper_size (GtkPrintSettings *settings,
156 GtkPaperSize *paper_size);
157gdouble gtk_print_settings_get_paper_width (GtkPrintSettings *settings,
158 GtkUnit unit);
159void gtk_print_settings_set_paper_width (GtkPrintSettings *settings,
160 gdouble width,
161 GtkUnit unit);
162gdouble gtk_print_settings_get_paper_height (GtkPrintSettings *settings,
163 GtkUnit unit);
164void gtk_print_settings_set_paper_height (GtkPrintSettings *settings,
165 gdouble height,
166 GtkUnit unit);
167gboolean gtk_print_settings_get_use_color (GtkPrintSettings *settings);
168void gtk_print_settings_set_use_color (GtkPrintSettings *settings,
169 gboolean use_color);
170gboolean gtk_print_settings_get_collate (GtkPrintSettings *settings);
171void gtk_print_settings_set_collate (GtkPrintSettings *settings,
172 gboolean collate);
173gboolean gtk_print_settings_get_reverse (GtkPrintSettings *settings);
174void gtk_print_settings_set_reverse (GtkPrintSettings *settings,
175 gboolean reverse);
176GtkPrintDuplex gtk_print_settings_get_duplex (GtkPrintSettings *settings);
177void gtk_print_settings_set_duplex (GtkPrintSettings *settings,
178 GtkPrintDuplex duplex);
179GtkPrintQuality gtk_print_settings_get_quality (GtkPrintSettings *settings);
180void gtk_print_settings_set_quality (GtkPrintSettings *settings,
181 GtkPrintQuality quality);
182gint gtk_print_settings_get_n_copies (GtkPrintSettings *settings);
183void gtk_print_settings_set_n_copies (GtkPrintSettings *settings,
184 gint num_copies);
185gint gtk_print_settings_get_number_up (GtkPrintSettings *settings);
186void gtk_print_settings_set_number_up (GtkPrintSettings *settings,
187 gint number_up);
188GtkNumberUpLayout gtk_print_settings_get_number_up_layout (GtkPrintSettings *settings);
189void gtk_print_settings_set_number_up_layout (GtkPrintSettings *settings,
190 GtkNumberUpLayout number_up_layout);
191gint gtk_print_settings_get_resolution (GtkPrintSettings *settings);
192void gtk_print_settings_set_resolution (GtkPrintSettings *settings,
193 gint resolution);
194gint gtk_print_settings_get_resolution_x (GtkPrintSettings *settings);
195gint gtk_print_settings_get_resolution_y (GtkPrintSettings *settings);
196void gtk_print_settings_set_resolution_xy (GtkPrintSettings *settings,
197 gint resolution_x,
198 gint resolution_y);
199gdouble gtk_print_settings_get_printer_lpi (GtkPrintSettings *settings);
200void gtk_print_settings_set_printer_lpi (GtkPrintSettings *settings,
201 gdouble lpi);
202gdouble gtk_print_settings_get_scale (GtkPrintSettings *settings);
203void gtk_print_settings_set_scale (GtkPrintSettings *settings,
204 gdouble scale);
205GtkPrintPages gtk_print_settings_get_print_pages (GtkPrintSettings *settings);
206void gtk_print_settings_set_print_pages (GtkPrintSettings *settings,
207 GtkPrintPages pages);
208GtkPageRange * gtk_print_settings_get_page_ranges (GtkPrintSettings *settings,
209 gint *num_ranges);
210void gtk_print_settings_set_page_ranges (GtkPrintSettings *settings,
211 GtkPageRange *page_ranges,
212 gint num_ranges);
213GtkPageSet gtk_print_settings_get_page_set (GtkPrintSettings *settings);
214void gtk_print_settings_set_page_set (GtkPrintSettings *settings,
215 GtkPageSet page_set);
216const gchar * gtk_print_settings_get_default_source (GtkPrintSettings *settings);
217void gtk_print_settings_set_default_source (GtkPrintSettings *settings,
218 const gchar *default_source);
219const gchar * gtk_print_settings_get_media_type (GtkPrintSettings *settings);
220void gtk_print_settings_set_media_type (GtkPrintSettings *settings,
221 const gchar *media_type);
222const gchar * gtk_print_settings_get_dither (GtkPrintSettings *settings);
223void gtk_print_settings_set_dither (GtkPrintSettings *settings,
224 const gchar *dither);
225const gchar * gtk_print_settings_get_finishings (GtkPrintSettings *settings);
226void gtk_print_settings_set_finishings (GtkPrintSettings *settings,
227 const gchar *finishings);
228const gchar * gtk_print_settings_get_output_bin (GtkPrintSettings *settings);
229void gtk_print_settings_set_output_bin (GtkPrintSettings *settings,
230 const gchar *output_bin);
231
232G_END_DECLS
233
234#endif /* __GTK_PRINT_SETTINGS_H__ */
235