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
30G_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
39typedef struct _GtkPrintJob GtkPrintJob;
40typedef struct _GtkPrintJobClass GtkPrintJobClass;
41typedef 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 */
53typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
54 gpointer user_data,
55 const GError *error);
56
57struct _GtkPrinter;
58
59struct _GtkPrintJob
60{
61 GObject parent_instance;
62
63 GtkPrintJobPrivate *priv;
64};
65
66struct _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
79GDK_AVAILABLE_IN_ALL
80GType gtk_print_job_get_type (void) G_GNUC_CONST;
81GDK_AVAILABLE_IN_ALL
82GtkPrintJob *gtk_print_job_new (const gchar *title,
83 GtkPrinter *printer,
84 GtkPrintSettings *settings,
85 GtkPageSetup *page_setup);
86GDK_AVAILABLE_IN_ALL
87GtkPrintSettings *gtk_print_job_get_settings (GtkPrintJob *job);
88GDK_AVAILABLE_IN_ALL
89GtkPrinter *gtk_print_job_get_printer (GtkPrintJob *job);
90GDK_AVAILABLE_IN_ALL
91const gchar * gtk_print_job_get_title (GtkPrintJob *job);
92GDK_AVAILABLE_IN_ALL
93GtkPrintStatus gtk_print_job_get_status (GtkPrintJob *job);
94GDK_AVAILABLE_IN_ALL
95gboolean gtk_print_job_set_source_file (GtkPrintJob *job,
96 const gchar *filename,
97 GError **error);
98GDK_AVAILABLE_IN_3_22
99gboolean gtk_print_job_set_source_fd (GtkPrintJob *job,
100 int fd,
101 GError **error);
102GDK_AVAILABLE_IN_ALL
103cairo_surface_t *gtk_print_job_get_surface (GtkPrintJob *job,
104 GError **error);
105GDK_AVAILABLE_IN_ALL
106void gtk_print_job_set_track_print_status (GtkPrintJob *job,
107 gboolean track_status);
108GDK_AVAILABLE_IN_ALL
109gboolean gtk_print_job_get_track_print_status (GtkPrintJob *job);
110GDK_AVAILABLE_IN_ALL
111void gtk_print_job_send (GtkPrintJob *job,
112 GtkPrintJobCompleteFunc callback,
113 gpointer user_data,
114 GDestroyNotify dnotify);
115
116GDK_AVAILABLE_IN_ALL
117GtkPrintPages gtk_print_job_get_pages (GtkPrintJob *job);
118GDK_AVAILABLE_IN_ALL
119void gtk_print_job_set_pages (GtkPrintJob *job,
120 GtkPrintPages pages);
121GDK_AVAILABLE_IN_ALL
122GtkPageRange * gtk_print_job_get_page_ranges (GtkPrintJob *job,
123 gint *n_ranges);
124GDK_AVAILABLE_IN_ALL
125void gtk_print_job_set_page_ranges (GtkPrintJob *job,
126 GtkPageRange *ranges,
127 gint n_ranges);
128GDK_AVAILABLE_IN_ALL
129GtkPageSet gtk_print_job_get_page_set (GtkPrintJob *job);
130GDK_AVAILABLE_IN_ALL
131void gtk_print_job_set_page_set (GtkPrintJob *job,
132 GtkPageSet page_set);
133GDK_AVAILABLE_IN_ALL
134gint gtk_print_job_get_num_copies (GtkPrintJob *job);
135GDK_AVAILABLE_IN_ALL
136void gtk_print_job_set_num_copies (GtkPrintJob *job,
137 gint num_copies);
138GDK_AVAILABLE_IN_ALL
139gdouble gtk_print_job_get_scale (GtkPrintJob *job);
140GDK_AVAILABLE_IN_ALL
141void gtk_print_job_set_scale (GtkPrintJob *job,
142 gdouble scale);
143GDK_AVAILABLE_IN_ALL
144guint gtk_print_job_get_n_up (GtkPrintJob *job);
145GDK_AVAILABLE_IN_ALL
146void gtk_print_job_set_n_up (GtkPrintJob *job,
147 guint n_up);
148GDK_AVAILABLE_IN_ALL
149GtkNumberUpLayout gtk_print_job_get_n_up_layout (GtkPrintJob *job);
150GDK_AVAILABLE_IN_ALL
151void gtk_print_job_set_n_up_layout (GtkPrintJob *job,
152 GtkNumberUpLayout layout);
153GDK_AVAILABLE_IN_ALL
154gboolean gtk_print_job_get_rotate (GtkPrintJob *job);
155GDK_AVAILABLE_IN_ALL
156void gtk_print_job_set_rotate (GtkPrintJob *job,
157 gboolean rotate);
158GDK_AVAILABLE_IN_ALL
159gboolean gtk_print_job_get_collate (GtkPrintJob *job);
160GDK_AVAILABLE_IN_ALL
161void gtk_print_job_set_collate (GtkPrintJob *job,
162 gboolean collate);
163GDK_AVAILABLE_IN_ALL
164gboolean gtk_print_job_get_reverse (GtkPrintJob *job);
165GDK_AVAILABLE_IN_ALL
166void gtk_print_job_set_reverse (GtkPrintJob *job,
167 gboolean reverse);
168
169G_END_DECLS
170
171#endif /* __GTK_PRINT_JOB_H__ */
172