]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintjob.h
Add ability to print in number-up mode for file backend and lpr backend
[~andy/gtk] / gtk / gtkprintjob.h
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION)
21 #error "Only <gtk/gtkunixprint.h> can be included directly."
22 #endif
23
24 #ifndef __GTK_PRINT_JOB_H__
25 #define __GTK_PRINT_JOB_H__
26
27 #include <cairo.h>
28
29 #include <gtk/gtk.h>
30 #include <gtk/gtkprinter.h>
31
32 G_BEGIN_DECLS
33
34 #define GTK_TYPE_PRINT_JOB                  (gtk_print_job_get_type ())
35 #define GTK_PRINT_JOB(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJob))
36 #define GTK_PRINT_JOB_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
37 #define GTK_IS_PRINT_JOB(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_JOB))
38 #define GTK_IS_PRINT_JOB_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_JOB))
39 #define GTK_PRINT_JOB_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
40
41 typedef struct _GtkPrintJob          GtkPrintJob;
42 typedef struct _GtkPrintJobClass     GtkPrintJobClass;
43 typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;
44
45 typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
46                                          gpointer     user_data,
47                                          GError      *error);
48
49 struct _GtkPrinter;
50
51 struct _GtkPrintJob
52 {
53   GObject parent_instance;
54
55   GtkPrintJobPrivate *GSEAL (priv);
56
57   /* Settings the client has to implement:
58    * (These are read-only, set at initialization)
59    */
60   GtkPrintPages GSEAL (print_pages);
61   GtkPageRange *GSEAL (page_ranges);
62   gint GSEAL (num_page_ranges);
63   GtkPageSet GSEAL (page_set);
64   gint GSEAL (num_copies);
65   gdouble GSEAL (scale);
66   guint GSEAL (rotate_to_orientation) : 1;
67   guint GSEAL (collate)               : 1;
68   guint GSEAL (reverse)               : 1;
69   guint GSEAL (number_up);
70   GtkNumberUpLayout GSEAL (number_up_layout);
71 };
72
73 struct _GtkPrintJobClass
74 {
75   GObjectClass parent_class;
76
77   void (*status_changed) (GtkPrintJob *job);
78
79   /* Padding for future expansion */
80   void (*_gtk_reserved1) (void);
81   void (*_gtk_reserved2) (void);
82   void (*_gtk_reserved3) (void);
83   void (*_gtk_reserved4) (void);
84   void (*_gtk_reserved5) (void);
85   void (*_gtk_reserved6) (void);
86   void (*_gtk_reserved7) (void);
87 };
88
89 GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
90 GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
91                                                                GtkPrinter               *printer,
92                                                                GtkPrintSettings         *settings,
93                                                                GtkPageSetup             *page_setup);
94 GtkPrintSettings        *gtk_print_job_get_settings           (GtkPrintJob              *job);
95 GtkPrinter              *gtk_print_job_get_printer            (GtkPrintJob              *job);
96 G_CONST_RETURN gchar    *gtk_print_job_get_title              (GtkPrintJob              *job);
97 GtkPrintStatus           gtk_print_job_get_status             (GtkPrintJob              *job);
98 gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
99                                                                const gchar              *filename,
100                                                                GError                  **error);
101 cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
102                                                                GError                  **error);
103 void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
104                                                                gboolean                  track_status);
105 gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
106 void                     gtk_print_job_send                   (GtkPrintJob              *job,
107                                                                GtkPrintJobCompleteFunc   callback,
108                                                                gpointer                  user_data,
109                                                                GDestroyNotify            dnotify);
110
111 G_END_DECLS
112
113 #endif /* __GTK_PRINT_JOB_H__ */