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 | |
30 | G_BEGIN_DECLS |
31 | |
32 | typedef 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 | |
38 | typedef void (*GtkPrintSettingsFunc) (const gchar *key, |
39 | const gchar *value, |
40 | gpointer user_data); |
41 | |
42 | typedef struct _GtkPageRange ; |
43 | struct |
44 | { |
45 | gint ; |
46 | gint ; |
47 | }; |
48 | |
49 | GType gtk_print_settings_get_type (void) G_GNUC_CONST; |
50 | GtkPrintSettings *gtk_print_settings_new (void); |
51 | |
52 | GtkPrintSettings *gtk_print_settings_copy (GtkPrintSettings *other); |
53 | |
54 | GtkPrintSettings *gtk_print_settings_new_from_file (const gchar *file_name, |
55 | GError **error); |
56 | gboolean gtk_print_settings_load_file (GtkPrintSettings *settings, |
57 | const gchar *file_name, |
58 | GError **error); |
59 | gboolean gtk_print_settings_to_file (GtkPrintSettings *settings, |
60 | const gchar *file_name, |
61 | GError **error); |
62 | GtkPrintSettings *gtk_print_settings_new_from_key_file (GKeyFile *key_file, |
63 | const gchar *group_name, |
64 | GError **error); |
65 | gboolean gtk_print_settings_load_key_file (GtkPrintSettings *settings, |
66 | GKeyFile *key_file, |
67 | const gchar *group_name, |
68 | GError **error); |
69 | void gtk_print_settings_to_key_file (GtkPrintSettings *settings, |
70 | GKeyFile *key_file, |
71 | const gchar *group_name); |
72 | gboolean gtk_print_settings_has_key (GtkPrintSettings *settings, |
73 | const gchar *key); |
74 | const gchar * gtk_print_settings_get (GtkPrintSettings *settings, |
75 | const gchar *key); |
76 | void gtk_print_settings_set (GtkPrintSettings *settings, |
77 | const gchar *key, |
78 | const gchar *value); |
79 | void gtk_print_settings_unset (GtkPrintSettings *settings, |
80 | const gchar *key); |
81 | void gtk_print_settings_foreach (GtkPrintSettings *settings, |
82 | GtkPrintSettingsFunc func, |
83 | gpointer user_data); |
84 | gboolean gtk_print_settings_get_bool (GtkPrintSettings *settings, |
85 | const gchar *key); |
86 | void gtk_print_settings_set_bool (GtkPrintSettings *settings, |
87 | const gchar *key, |
88 | gboolean value); |
89 | gdouble gtk_print_settings_get_double (GtkPrintSettings *settings, |
90 | const gchar *key); |
91 | gdouble gtk_print_settings_get_double_with_default (GtkPrintSettings *settings, |
92 | const gchar *key, |
93 | gdouble def); |
94 | void gtk_print_settings_set_double (GtkPrintSettings *settings, |
95 | const gchar *key, |
96 | gdouble value); |
97 | gdouble gtk_print_settings_get_length (GtkPrintSettings *settings, |
98 | const gchar *key, |
99 | GtkUnit unit); |
100 | void gtk_print_settings_set_length (GtkPrintSettings *settings, |
101 | const gchar *key, |
102 | gdouble value, |
103 | GtkUnit unit); |
104 | gint gtk_print_settings_get_int (GtkPrintSettings *settings, |
105 | const gchar *key); |
106 | gint gtk_print_settings_get_int_with_default (GtkPrintSettings *settings, |
107 | const gchar *key, |
108 | gint def); |
109 | void 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 "win32-driver-extra" |
145 | |
146 | /* Helpers: */ |
147 | |
148 | const gchar *gtk_print_settings_get_printer (GtkPrintSettings *settings); |
149 | void gtk_print_settings_set_printer (GtkPrintSettings *settings, |
150 | const gchar *printer); |
151 | GtkPageOrientation gtk_print_settings_get_orientation (GtkPrintSettings *settings); |
152 | void gtk_print_settings_set_orientation (GtkPrintSettings *settings, |
153 | GtkPageOrientation orientation); |
154 | GtkPaperSize * gtk_print_settings_get_paper_size (GtkPrintSettings *settings); |
155 | void gtk_print_settings_set_paper_size (GtkPrintSettings *settings, |
156 | GtkPaperSize *paper_size); |
157 | gdouble gtk_print_settings_get_paper_width (GtkPrintSettings *settings, |
158 | GtkUnit unit); |
159 | void gtk_print_settings_set_paper_width (GtkPrintSettings *settings, |
160 | gdouble width, |
161 | GtkUnit unit); |
162 | gdouble gtk_print_settings_get_paper_height (GtkPrintSettings *settings, |
163 | GtkUnit unit); |
164 | void gtk_print_settings_set_paper_height (GtkPrintSettings *settings, |
165 | gdouble height, |
166 | GtkUnit unit); |
167 | gboolean gtk_print_settings_get_use_color (GtkPrintSettings *settings); |
168 | void gtk_print_settings_set_use_color (GtkPrintSettings *settings, |
169 | gboolean use_color); |
170 | gboolean gtk_print_settings_get_collate (GtkPrintSettings *settings); |
171 | void gtk_print_settings_set_collate (GtkPrintSettings *settings, |
172 | gboolean collate); |
173 | gboolean gtk_print_settings_get_reverse (GtkPrintSettings *settings); |
174 | void gtk_print_settings_set_reverse (GtkPrintSettings *settings, |
175 | gboolean reverse); |
176 | GtkPrintDuplex gtk_print_settings_get_duplex (GtkPrintSettings *settings); |
177 | void gtk_print_settings_set_duplex (GtkPrintSettings *settings, |
178 | GtkPrintDuplex duplex); |
179 | GtkPrintQuality gtk_print_settings_get_quality (GtkPrintSettings *settings); |
180 | void gtk_print_settings_set_quality (GtkPrintSettings *settings, |
181 | GtkPrintQuality quality); |
182 | gint gtk_print_settings_get_n_copies (GtkPrintSettings *settings); |
183 | void gtk_print_settings_set_n_copies (GtkPrintSettings *settings, |
184 | gint num_copies); |
185 | gint gtk_print_settings_get_number_up (GtkPrintSettings *settings); |
186 | void gtk_print_settings_set_number_up (GtkPrintSettings *settings, |
187 | gint number_up); |
188 | GtkNumberUpLayout gtk_print_settings_get_number_up_layout (GtkPrintSettings *settings); |
189 | void gtk_print_settings_set_number_up_layout (GtkPrintSettings *settings, |
190 | GtkNumberUpLayout number_up_layout); |
191 | gint gtk_print_settings_get_resolution (GtkPrintSettings *settings); |
192 | void gtk_print_settings_set_resolution (GtkPrintSettings *settings, |
193 | gint resolution); |
194 | gint gtk_print_settings_get_resolution_x (GtkPrintSettings *settings); |
195 | gint gtk_print_settings_get_resolution_y (GtkPrintSettings *settings); |
196 | void gtk_print_settings_set_resolution_xy (GtkPrintSettings *settings, |
197 | gint resolution_x, |
198 | gint resolution_y); |
199 | gdouble gtk_print_settings_get_printer_lpi (GtkPrintSettings *settings); |
200 | void gtk_print_settings_set_printer_lpi (GtkPrintSettings *settings, |
201 | gdouble lpi); |
202 | gdouble gtk_print_settings_get_scale (GtkPrintSettings *settings); |
203 | void gtk_print_settings_set_scale (GtkPrintSettings *settings, |
204 | gdouble scale); |
205 | GtkPrintPages gtk_print_settings_get_print_pages (GtkPrintSettings *settings); |
206 | void gtk_print_settings_set_print_pages (GtkPrintSettings *settings, |
207 | GtkPrintPages pages); |
208 | GtkPageRange * gtk_print_settings_get_page_ranges (GtkPrintSettings *settings, |
209 | gint *num_ranges); |
210 | void gtk_print_settings_set_page_ranges (GtkPrintSettings *settings, |
211 | GtkPageRange *page_ranges, |
212 | gint num_ranges); |
213 | GtkPageSet gtk_print_settings_get_page_set (GtkPrintSettings *settings); |
214 | void gtk_print_settings_set_page_set (GtkPrintSettings *settings, |
215 | GtkPageSet page_set); |
216 | const gchar * gtk_print_settings_get_default_source (GtkPrintSettings *settings); |
217 | void gtk_print_settings_set_default_source (GtkPrintSettings *settings, |
218 | const gchar *default_source); |
219 | const gchar * gtk_print_settings_get_media_type (GtkPrintSettings *settings); |
220 | void gtk_print_settings_set_media_type (GtkPrintSettings *settings, |
221 | const gchar *media_type); |
222 | const gchar * gtk_print_settings_get_dither (GtkPrintSettings *settings); |
223 | void gtk_print_settings_set_dither (GtkPrintSettings *settings, |
224 | const gchar *dither); |
225 | const gchar * gtk_print_settings_get_finishings (GtkPrintSettings *settings); |
226 | void gtk_print_settings_set_finishings (GtkPrintSettings *settings, |
227 | const gchar *finishings); |
228 | const gchar * gtk_print_settings_get_output_bin (GtkPrintSettings *settings); |
229 | void gtk_print_settings_set_output_bin (GtkPrintSettings *settings, |
230 | const gchar *output_bin); |
231 | |
232 | G_END_DECLS |
233 | |
234 | #endif /* __GTK_PRINT_SETTINGS_H__ */ |
235 | |