gtkprintjob.h 7.21 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 36 37 38
#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_PRINT_JOB_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
#define GTK_IS_PRINT_JOB(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_JOB))
#define GTK_IS_PRINT_JOB_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_JOB))
#define GTK_PRINT_JOB_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))

Alexander Larsson's avatar
Alexander Larsson committed
39
typedef struct _GtkPrintJob          GtkPrintJob;
40 41 42
typedef struct _GtkPrintJobClass     GtkPrintJobClass;
typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;

43 44 45 46 47 48 49 50 51 52
/**
 * 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.
 */
53 54 55
typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob  *print_job,
                                         gpointer      user_data,
                                         const GError *error);
56 57 58 59 60 61 62

struct _GtkPrinter;

struct _GtkPrintJob
{
  GObject parent_instance;

63
  GtkPrintJobPrivate *priv;
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
};

struct _GtkPrintJobClass
{
  GObjectClass parent_class;

  void (*status_changed) (GtkPrintJob *job);

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
};

79
GDK_AVAILABLE_IN_ALL
80
GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
81
GDK_AVAILABLE_IN_ALL
82 83 84 85
GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
							       GtkPrinter               *printer,
							       GtkPrintSettings         *settings,
							       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 96 97
gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
							       const gchar              *filename,
							       GError                  **error);
98
GDK_AVAILABLE_IN_ALL
99 100
cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
							       GError                  **error);
101
GDK_AVAILABLE_IN_ALL
102 103
void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
							       gboolean                  track_status);
104
GDK_AVAILABLE_IN_ALL
105
gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
106
GDK_AVAILABLE_IN_ALL
107
void                     gtk_print_job_send                   (GtkPrintJob              *job,
108 109
							       GtkPrintJobCompleteFunc   callback,
							       gpointer                  user_data,
110
							       GDestroyNotify            dnotify);
111

112
GDK_AVAILABLE_IN_ALL
113
GtkPrintPages     gtk_print_job_get_pages       (GtkPrintJob       *job);
114
GDK_AVAILABLE_IN_ALL
115 116
void              gtk_print_job_set_pages       (GtkPrintJob       *job,
                                                 GtkPrintPages      pages);
117
GDK_AVAILABLE_IN_ALL
118 119
GtkPageRange *    gtk_print_job_get_page_ranges (GtkPrintJob       *job,
                                                 gint              *n_ranges);
120
GDK_AVAILABLE_IN_ALL
121 122 123
void              gtk_print_job_set_page_ranges (GtkPrintJob       *job,
                                                 GtkPageRange      *ranges,
                                                 gint               n_ranges);
124
GDK_AVAILABLE_IN_ALL
125
GtkPageSet        gtk_print_job_get_page_set    (GtkPrintJob       *job);
126
GDK_AVAILABLE_IN_ALL
127 128
void              gtk_print_job_set_page_set    (GtkPrintJob       *job,
                                                 GtkPageSet         page_set);
129
GDK_AVAILABLE_IN_ALL
130
gint              gtk_print_job_get_num_copies  (GtkPrintJob       *job);
131
GDK_AVAILABLE_IN_ALL
132 133
void              gtk_print_job_set_num_copies  (GtkPrintJob       *job,
                                                 gint               num_copies);
134
GDK_AVAILABLE_IN_ALL
135
gdouble           gtk_print_job_get_scale       (GtkPrintJob       *job);
136
GDK_AVAILABLE_IN_ALL
137 138
void              gtk_print_job_set_scale       (GtkPrintJob       *job,
                                                 gdouble            scale);
139
GDK_AVAILABLE_IN_ALL
140
guint             gtk_print_job_get_n_up        (GtkPrintJob       *job);
141
GDK_AVAILABLE_IN_ALL
142 143
void              gtk_print_job_set_n_up        (GtkPrintJob       *job,
                                                 guint              n_up);
144
GDK_AVAILABLE_IN_ALL
145
GtkNumberUpLayout gtk_print_job_get_n_up_layout (GtkPrintJob       *job);
146
GDK_AVAILABLE_IN_ALL
147 148
void              gtk_print_job_set_n_up_layout (GtkPrintJob       *job,
                                                 GtkNumberUpLayout  layout);
149
GDK_AVAILABLE_IN_ALL
150
gboolean          gtk_print_job_get_rotate      (GtkPrintJob       *job);
151
GDK_AVAILABLE_IN_ALL
152 153
void              gtk_print_job_set_rotate      (GtkPrintJob       *job,
                                                 gboolean           rotate);
154
GDK_AVAILABLE_IN_ALL
155
gboolean          gtk_print_job_get_collate     (GtkPrintJob       *job);
156
GDK_AVAILABLE_IN_ALL
157 158
void              gtk_print_job_set_collate     (GtkPrintJob       *job,
                                                 gboolean           collate);
159
GDK_AVAILABLE_IN_ALL
160
gboolean          gtk_print_job_get_reverse     (GtkPrintJob       *job);
161
GDK_AVAILABLE_IN_ALL
162 163 164
void              gtk_print_job_set_reverse     (GtkPrintJob       *job,
                                                 gboolean           reverse);

165 166 167
G_END_DECLS

#endif /* __GTK_PRINT_JOB_H__ */