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


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

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

144
145
146
G_END_DECLS

#endif /* __GTK_PRINT_JOB_H__ */