gtkprintjob.h 6.61 KB
Newer Older
1
2
/* GtkPrintJob
 * Copyright (C) 2006 Red Hat,Inc.
3
4
5
6
7
8
9
10
11
12
13
14
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16
 */
17

18
19
20
#ifndef __GTK_PRINT_JOB_H__
#define __GTK_PRINT_JOB_H__

21
#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION)
22
23
24
#error "Only <gtk/gtkunixprint.h> can be included directly."
#endif

25
26
#include <cairo.h>

27
#include <gtk/gtk.h>
28
29
30
31
32
33
34
35
#include <gtk/gtkprinter.h>

G_BEGIN_DECLS

#define GTK_TYPE_PRINT_JOB                  (gtk_print_job_get_type ())
#define GTK_PRINT_JOB(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJob))
#define GTK_IS_PRINT_JOB(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_JOB))

Alexander Larsson's avatar
Alexander Larsson committed
36
typedef struct _GtkPrintJob          GtkPrintJob;
37

Matthias Clasen's avatar
Matthias Clasen committed
38
39
40
41
42
43
44
45
46
47
/**
 * GtkPrintJobCompleteFunc:
 * @print_job: the #GtkPrintJob
 * @user_data: user data that has been passed to gtk_print_job_send()
 * @error: a #GError that contains error information if the sending
 *     of the print job failed, otherwise %NULL
 *
 * The type of callback that is passed to gtk_print_job_send().
 * It is called when the print job has been completely sent.
 */
48
49
50
typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob  *print_job,
                                         gpointer      user_data,
                                         const GError *error);
51
52


53
GDK_AVAILABLE_IN_ALL
54
GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
55
GDK_AVAILABLE_IN_ALL
56
57
58
59
GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
							       GtkPrinter               *printer,
							       GtkPrintSettings         *settings,
							       GtkPageSetup             *page_setup);
60
GDK_AVAILABLE_IN_ALL
61
GtkPrintSettings        *gtk_print_job_get_settings           (GtkPrintJob              *job);
62
GDK_AVAILABLE_IN_ALL
63
GtkPrinter              *gtk_print_job_get_printer            (GtkPrintJob              *job);
64
GDK_AVAILABLE_IN_ALL
65
const gchar *            gtk_print_job_get_title              (GtkPrintJob              *job);
66
GDK_AVAILABLE_IN_ALL
67
GtkPrintStatus           gtk_print_job_get_status             (GtkPrintJob              *job);
68
GDK_AVAILABLE_IN_ALL
69
70
71
gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
							       const gchar              *filename,
							       GError                  **error);
Matthias Clasen's avatar
Matthias Clasen committed
72
GDK_AVAILABLE_IN_ALL
73
74
75
gboolean                 gtk_print_job_set_source_fd          (GtkPrintJob              *job,
							       int                       fd,
							       GError                  **error);
76
GDK_AVAILABLE_IN_ALL
77
78
cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
							       GError                  **error);
79
GDK_AVAILABLE_IN_ALL
80
81
void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
							       gboolean                  track_status);
82
GDK_AVAILABLE_IN_ALL
83
gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
84
GDK_AVAILABLE_IN_ALL
85
void                     gtk_print_job_send                   (GtkPrintJob              *job,
86
87
							       GtkPrintJobCompleteFunc   callback,
							       gpointer                  user_data,
88
							       GDestroyNotify            dnotify);
89

90
GDK_AVAILABLE_IN_ALL
91
GtkPrintPages     gtk_print_job_get_pages       (GtkPrintJob       *job);
92
GDK_AVAILABLE_IN_ALL
93
94
void              gtk_print_job_set_pages       (GtkPrintJob       *job,
                                                 GtkPrintPages      pages);
95
GDK_AVAILABLE_IN_ALL
96
97
GtkPageRange *    gtk_print_job_get_page_ranges (GtkPrintJob       *job,
                                                 gint              *n_ranges);
98
GDK_AVAILABLE_IN_ALL
99
100
101
void              gtk_print_job_set_page_ranges (GtkPrintJob       *job,
                                                 GtkPageRange      *ranges,
                                                 gint               n_ranges);
102
GDK_AVAILABLE_IN_ALL
103
GtkPageSet        gtk_print_job_get_page_set    (GtkPrintJob       *job);
104
GDK_AVAILABLE_IN_ALL
105
106
void              gtk_print_job_set_page_set    (GtkPrintJob       *job,
                                                 GtkPageSet         page_set);
107
GDK_AVAILABLE_IN_ALL
108
gint              gtk_print_job_get_num_copies  (GtkPrintJob       *job);
109
GDK_AVAILABLE_IN_ALL
110
111
void              gtk_print_job_set_num_copies  (GtkPrintJob       *job,
                                                 gint               num_copies);
112
GDK_AVAILABLE_IN_ALL
113
gdouble           gtk_print_job_get_scale       (GtkPrintJob       *job);
114
GDK_AVAILABLE_IN_ALL
115
116
void              gtk_print_job_set_scale       (GtkPrintJob       *job,
                                                 gdouble            scale);
117
GDK_AVAILABLE_IN_ALL
118
guint             gtk_print_job_get_n_up        (GtkPrintJob       *job);
119
GDK_AVAILABLE_IN_ALL
120
121
void              gtk_print_job_set_n_up        (GtkPrintJob       *job,
                                                 guint              n_up);
122
GDK_AVAILABLE_IN_ALL
123
GtkNumberUpLayout gtk_print_job_get_n_up_layout (GtkPrintJob       *job);
124
GDK_AVAILABLE_IN_ALL
125
126
void              gtk_print_job_set_n_up_layout (GtkPrintJob       *job,
                                                 GtkNumberUpLayout  layout);
127
GDK_AVAILABLE_IN_ALL
128
gboolean          gtk_print_job_get_rotate      (GtkPrintJob       *job);
129
GDK_AVAILABLE_IN_ALL
130
131
void              gtk_print_job_set_rotate      (GtkPrintJob       *job,
                                                 gboolean           rotate);
132
GDK_AVAILABLE_IN_ALL
133
gboolean          gtk_print_job_get_collate     (GtkPrintJob       *job);
134
GDK_AVAILABLE_IN_ALL
135
136
void              gtk_print_job_set_collate     (GtkPrintJob       *job,
                                                 gboolean           collate);
137
GDK_AVAILABLE_IN_ALL
138
gboolean          gtk_print_job_get_reverse     (GtkPrintJob       *job);
139
GDK_AVAILABLE_IN_ALL
140
141
142
void              gtk_print_job_set_reverse     (GtkPrintJob       *job,
                                                 gboolean           reverse);

143
144
145
G_END_DECLS

#endif /* __GTK_PRINT_JOB_H__ */