1 | /* GtkPrintJob |
2 | * Copyright (C) 2006 Red Hat,Inc. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Lesser General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Lesser General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Lesser General Public |
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
16 | */ |
17 | |
18 | #ifndef __GTK_PRINT_JOB_H__ |
19 | #define __GTK_PRINT_JOB_H__ |
20 | |
21 | #if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION) |
22 | #error "Only <gtk/gtkunixprint.h> can be included directly." |
23 | #endif |
24 | |
25 | #include <cairo.h> |
26 | |
27 | #include <gtk/gtk.h> |
28 | #include <gtk/gtkprinter.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | #define GTK_TYPE_PRINT_JOB (gtk_print_job_get_type ()) |
33 | #define GTK_PRINT_JOB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJob)) |
34 | #define GTK_PRINT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_JOB, GtkPrintJobClass)) |
35 | #define GTK_IS_PRINT_JOB(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_JOB)) |
36 | #define GTK_IS_PRINT_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_JOB)) |
37 | #define GTK_PRINT_JOB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJobClass)) |
38 | |
39 | typedef struct _GtkPrintJob GtkPrintJob; |
40 | typedef struct _GtkPrintJobClass GtkPrintJobClass; |
41 | typedef struct _GtkPrintJobPrivate GtkPrintJobPrivate; |
42 | |
43 | /** |
44 | * GtkPrintJobCompleteFunc: |
45 | * @print_job: the #GtkPrintJob |
46 | * @user_data: user data that has been passed to gtk_print_job_send() |
47 | * @error: a #GError that contains error information if the sending |
48 | * of the print job failed, otherwise %NULL |
49 | * |
50 | * The type of callback that is passed to gtk_print_job_send(). |
51 | * It is called when the print job has been completely sent. |
52 | */ |
53 | typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job, |
54 | gpointer user_data, |
55 | const GError *error); |
56 | |
57 | struct _GtkPrinter; |
58 | |
59 | struct _GtkPrintJob |
60 | { |
61 | GObject parent_instance; |
62 | |
63 | GtkPrintJobPrivate *priv; |
64 | }; |
65 | |
66 | struct _GtkPrintJobClass |
67 | { |
68 | GObjectClass parent_class; |
69 | |
70 | void (*status_changed) (GtkPrintJob *job); |
71 | |
72 | /* Padding for future expansion */ |
73 | void (*_gtk_reserved1) (void); |
74 | void (*_gtk_reserved2) (void); |
75 | void (*_gtk_reserved3) (void); |
76 | void (*_gtk_reserved4) (void); |
77 | }; |
78 | |
79 | GDK_AVAILABLE_IN_ALL |
80 | GType gtk_print_job_get_type (void) G_GNUC_CONST; |
81 | GDK_AVAILABLE_IN_ALL |
82 | GtkPrintJob *gtk_print_job_new (const gchar *title, |
83 | GtkPrinter *printer, |
84 | GtkPrintSettings *settings, |
85 | GtkPageSetup *page_setup); |
86 | GDK_AVAILABLE_IN_ALL |
87 | GtkPrintSettings *gtk_print_job_get_settings (GtkPrintJob *job); |
88 | GDK_AVAILABLE_IN_ALL |
89 | GtkPrinter *gtk_print_job_get_printer (GtkPrintJob *job); |
90 | GDK_AVAILABLE_IN_ALL |
91 | const gchar * gtk_print_job_get_title (GtkPrintJob *job); |
92 | GDK_AVAILABLE_IN_ALL |
93 | GtkPrintStatus gtk_print_job_get_status (GtkPrintJob *job); |
94 | GDK_AVAILABLE_IN_ALL |
95 | gboolean gtk_print_job_set_source_file (GtkPrintJob *job, |
96 | const gchar *filename, |
97 | GError **error); |
98 | GDK_AVAILABLE_IN_3_22 |
99 | gboolean gtk_print_job_set_source_fd (GtkPrintJob *job, |
100 | int fd, |
101 | GError **error); |
102 | GDK_AVAILABLE_IN_ALL |
103 | cairo_surface_t *gtk_print_job_get_surface (GtkPrintJob *job, |
104 | GError **error); |
105 | GDK_AVAILABLE_IN_ALL |
106 | void gtk_print_job_set_track_print_status (GtkPrintJob *job, |
107 | gboolean track_status); |
108 | GDK_AVAILABLE_IN_ALL |
109 | gboolean gtk_print_job_get_track_print_status (GtkPrintJob *job); |
110 | GDK_AVAILABLE_IN_ALL |
111 | void gtk_print_job_send (GtkPrintJob *job, |
112 | GtkPrintJobCompleteFunc callback, |
113 | gpointer user_data, |
114 | GDestroyNotify dnotify); |
115 | |
116 | GDK_AVAILABLE_IN_ALL |
117 | GtkPrintPages gtk_print_job_get_pages (GtkPrintJob *job); |
118 | GDK_AVAILABLE_IN_ALL |
119 | void gtk_print_job_set_pages (GtkPrintJob *job, |
120 | GtkPrintPages pages); |
121 | GDK_AVAILABLE_IN_ALL |
122 | GtkPageRange * gtk_print_job_get_page_ranges (GtkPrintJob *job, |
123 | gint *n_ranges); |
124 | GDK_AVAILABLE_IN_ALL |
125 | void gtk_print_job_set_page_ranges (GtkPrintJob *job, |
126 | GtkPageRange *ranges, |
127 | gint n_ranges); |
128 | GDK_AVAILABLE_IN_ALL |
129 | GtkPageSet gtk_print_job_get_page_set (GtkPrintJob *job); |
130 | GDK_AVAILABLE_IN_ALL |
131 | void gtk_print_job_set_page_set (GtkPrintJob *job, |
132 | GtkPageSet page_set); |
133 | GDK_AVAILABLE_IN_ALL |
134 | gint gtk_print_job_get_num_copies (GtkPrintJob *job); |
135 | GDK_AVAILABLE_IN_ALL |
136 | void gtk_print_job_set_num_copies (GtkPrintJob *job, |
137 | gint num_copies); |
138 | GDK_AVAILABLE_IN_ALL |
139 | gdouble gtk_print_job_get_scale (GtkPrintJob *job); |
140 | GDK_AVAILABLE_IN_ALL |
141 | void gtk_print_job_set_scale (GtkPrintJob *job, |
142 | gdouble scale); |
143 | GDK_AVAILABLE_IN_ALL |
144 | guint gtk_print_job_get_n_up (GtkPrintJob *job); |
145 | GDK_AVAILABLE_IN_ALL |
146 | void gtk_print_job_set_n_up (GtkPrintJob *job, |
147 | guint n_up); |
148 | GDK_AVAILABLE_IN_ALL |
149 | GtkNumberUpLayout gtk_print_job_get_n_up_layout (GtkPrintJob *job); |
150 | GDK_AVAILABLE_IN_ALL |
151 | void gtk_print_job_set_n_up_layout (GtkPrintJob *job, |
152 | GtkNumberUpLayout layout); |
153 | GDK_AVAILABLE_IN_ALL |
154 | gboolean gtk_print_job_get_rotate (GtkPrintJob *job); |
155 | GDK_AVAILABLE_IN_ALL |
156 | void gtk_print_job_set_rotate (GtkPrintJob *job, |
157 | gboolean rotate); |
158 | GDK_AVAILABLE_IN_ALL |
159 | gboolean gtk_print_job_get_collate (GtkPrintJob *job); |
160 | GDK_AVAILABLE_IN_ALL |
161 | void gtk_print_job_set_collate (GtkPrintJob *job, |
162 | gboolean collate); |
163 | GDK_AVAILABLE_IN_ALL |
164 | gboolean gtk_print_job_get_reverse (GtkPrintJob *job); |
165 | GDK_AVAILABLE_IN_ALL |
166 | void gtk_print_job_set_reverse (GtkPrintJob *job, |
167 | gboolean reverse); |
168 | |
169 | G_END_DECLS |
170 | |
171 | #endif /* __GTK_PRINT_JOB_H__ */ |
172 | |