]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintjob.h
add missing flag values
[~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 #ifndef __GTK_PRINT_JOB_H__
20 #define __GTK_PRINT_JOB_H__
21
22 #include <glib-object.h>
23 #include <cairo.h>
24
25 #include <gtk/gtkprinter.h>
26 #include <gtk/gtkprintoperation.h>
27
28 G_BEGIN_DECLS
29
30 #define GTK_TYPE_PRINT_JOB                  (gtk_print_job_get_type ())
31 #define GTK_PRINT_JOB(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJob))
32 #define GTK_PRINT_JOB_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
33 #define GTK_IS_PRINT_JOB(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PRINT_JOB))
34 #define GTK_IS_PRINT_JOB_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PRINT_JOB))
35 #define GTK_PRINT_JOB_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PRINT_JOB, GtkPrintJobClass))
36
37 /* Note, this type is manually registered with GObject in gtkprintjob.c
38  * If you add any flags, update the registration as well 
39  */
40 typedef enum
41 {
42   GTK_PRINT_CAPABILITY_PAGE_SET     = 1 << 0,
43   GTK_PRINT_CAPABILITY_COPIES       = 1 << 1,
44   GTK_PRINT_CAPABILITY_COLLATE      = 1 << 2,
45   GTK_PRINT_CAPABILITY_REVERSE      = 1 << 3,
46   GTK_PRINT_CAPABILITY_SCALE        = 1 << 4,
47   GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5,
48   GTK_PRINT_CAPABILITY_GENERATE_PS  = 1 << 6
49 } GtkPrintCapabilities;
50
51 typedef struct _GtkPrintJob          GtkPrintJob;
52 typedef struct _GtkPrintJobClass     GtkPrintJobClass;
53 typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;
54
55 typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
56                                          gpointer     user_data, 
57                                          GError      *error);
58
59 struct _GtkPrinter;
60
61 struct _GtkPrintJob
62 {
63   GObject parent_instance;
64
65   GtkPrintJobPrivate *priv;
66
67   /* Settings the client has to implement:
68    * (These are read-only, set at initialization)
69    */
70   GtkPrintPages print_pages;
71   GtkPageRange *page_ranges;
72   gint num_page_ranges;
73   GtkPageSet page_set;
74   gint num_copies;
75   gdouble scale;
76   guint rotate_to_orientation : 1;
77   guint collate               : 1;
78   guint reverse               : 1;
79 };
80
81 struct _GtkPrintJobClass
82 {
83   GObjectClass parent_class;
84
85   void (*status_changed) (GtkPrintJob *job);
86
87   /* Padding for future expansion */
88   void (*_gtk_reserved1) (void);
89   void (*_gtk_reserved2) (void);
90   void (*_gtk_reserved3) (void);
91   void (*_gtk_reserved4) (void);
92   void (*_gtk_reserved5) (void);
93   void (*_gtk_reserved6) (void);
94   void (*_gtk_reserved7) (void);
95 };
96
97 GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
98 GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
99                                                                GtkPrinter               *printer,
100                                                                GtkPrintSettings         *settings,
101                                                                GtkPageSetup             *page_setup);
102 GtkPrintSettings        *gtk_print_job_get_settings           (GtkPrintJob              *job);
103 GtkPrinter              *gtk_print_job_get_printer            (GtkPrintJob              *job);
104 G_CONST_RETURN gchar    *gtk_print_job_get_title              (GtkPrintJob              *job);
105 GtkPrintStatus           gtk_print_job_get_status             (GtkPrintJob              *job);
106 gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
107                                                                const gchar              *filename,
108                                                                GError                  **error);
109 cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
110                                                                GError                  **error);
111 void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
112                                                                gboolean                  track_status);
113 gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
114 void                     gtk_print_job_send                   (GtkPrintJob              *job,
115                                                                GtkPrintJobCompleteFunc   callback,
116                                                                gpointer                  user_data,
117                                                                GDestroyNotify            dnotify);
118
119 GType                    gtk_print_capabilities_get_type      (void) G_GNUC_CONST;
120
121 G_END_DECLS
122
123 #endif /* __GTK_PRINT_JOB_H__ */