]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintjob.h
Make gtk_printer_get_capabilities public, and move the
[~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 typedef struct _GtkPrintJob          GtkPrintJob;
38 typedef struct _GtkPrintJobClass     GtkPrintJobClass;
39 typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;
40
41 typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
42                                          gpointer     user_data, 
43                                          GError      *error);
44
45 struct _GtkPrinter;
46
47 struct _GtkPrintJob
48 {
49   GObject parent_instance;
50
51   GtkPrintJobPrivate *priv;
52
53   /* Settings the client has to implement:
54    * (These are read-only, set at initialization)
55    */
56   GtkPrintPages print_pages;
57   GtkPageRange *page_ranges;
58   gint num_page_ranges;
59   GtkPageSet page_set;
60   gint num_copies;
61   gdouble scale;
62   guint rotate_to_orientation : 1;
63   guint collate               : 1;
64   guint reverse               : 1;
65 };
66
67 struct _GtkPrintJobClass
68 {
69   GObjectClass parent_class;
70
71   void (*status_changed) (GtkPrintJob *job);
72
73   /* Padding for future expansion */
74   void (*_gtk_reserved1) (void);
75   void (*_gtk_reserved2) (void);
76   void (*_gtk_reserved3) (void);
77   void (*_gtk_reserved4) (void);
78   void (*_gtk_reserved5) (void);
79   void (*_gtk_reserved6) (void);
80   void (*_gtk_reserved7) (void);
81 };
82
83 GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
84 GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
85                                                                GtkPrinter               *printer,
86                                                                GtkPrintSettings         *settings,
87                                                                GtkPageSetup             *page_setup);
88 GtkPrintSettings        *gtk_print_job_get_settings           (GtkPrintJob              *job);
89 GtkPrinter              *gtk_print_job_get_printer            (GtkPrintJob              *job);
90 G_CONST_RETURN gchar    *gtk_print_job_get_title              (GtkPrintJob              *job);
91 GtkPrintStatus           gtk_print_job_get_status             (GtkPrintJob              *job);
92 gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
93                                                                const gchar              *filename,
94                                                                GError                  **error);
95 cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
96                                                                GError                  **error);
97 void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
98                                                                gboolean                  track_status);
99 gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
100 void                     gtk_print_job_send                   (GtkPrintJob              *job,
101                                                                GtkPrintJobCompleteFunc   callback,
102                                                                gpointer                  user_data,
103                                                                GDestroyNotify            dnotify);
104
105 GType                    gtk_print_capabilities_get_type      (void) G_GNUC_CONST;
106
107 G_END_DECLS
108
109 #endif /* __GTK_PRINT_JOB_H__ */