gtkprintjob.h 6.65 KB
Newer Older
1 2
/* GtkPrintJob
 * Copyright (C) 2006 Red Hat,Inc.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 *
 * 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
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
19

20
#if !defined (__GTK_UNIX_PRINT_H_INSIDE__) && !defined (GTK_COMPILATION)
21 22 23
#error "Only <gtk/gtkunixprint.h> can be included directly."
#endif

24 25 26 27 28
#ifndef __GTK_PRINT_JOB_H__
#define __GTK_PRINT_JOB_H__

#include <cairo.h>

29
#include <gtk/gtk.h>
30 31 32 33 34 35 36 37 38 39 40
#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
41
typedef struct _GtkPrintJob          GtkPrintJob;
42 43 44
typedef struct _GtkPrintJobClass     GtkPrintJobClass;
typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;

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

struct _GtkPrinter;

struct _GtkPrintJob
{
  GObject parent_instance;

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

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);
};

81
GType                    gtk_print_job_get_type               (void) G_GNUC_CONST;
82 83 84 85 86 87
GtkPrintJob             *gtk_print_job_new                    (const gchar              *title,
							       GtkPrinter               *printer,
							       GtkPrintSettings         *settings,
							       GtkPageSetup             *page_setup);
GtkPrintSettings        *gtk_print_job_get_settings           (GtkPrintJob              *job);
GtkPrinter              *gtk_print_job_get_printer            (GtkPrintJob              *job);
88
const gchar *            gtk_print_job_get_title              (GtkPrintJob              *job);
89 90 91 92 93 94 95 96 97
GtkPrintStatus           gtk_print_job_get_status             (GtkPrintJob              *job);
gboolean                 gtk_print_job_set_source_file        (GtkPrintJob              *job,
							       const gchar              *filename,
							       GError                  **error);
cairo_surface_t         *gtk_print_job_get_surface            (GtkPrintJob              *job,
							       GError                  **error);
void                     gtk_print_job_set_track_print_status (GtkPrintJob              *job,
							       gboolean                  track_status);
gboolean                 gtk_print_job_get_track_print_status (GtkPrintJob              *job);
98
void                     gtk_print_job_send                   (GtkPrintJob              *job,
99 100
							       GtkPrintJobCompleteFunc   callback,
							       gpointer                  user_data,
101
							       GDestroyNotify            dnotify);
102

103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
GtkPrintPages     gtk_print_job_get_pages       (GtkPrintJob       *job);
void              gtk_print_job_set_pages       (GtkPrintJob       *job,
                                                 GtkPrintPages      pages);
GtkPageRange *    gtk_print_job_get_page_ranges (GtkPrintJob       *job,
                                                 gint              *n_ranges);
void              gtk_print_job_set_page_ranges (GtkPrintJob       *job,
                                                 GtkPageRange      *ranges,
                                                 gint               n_ranges);
GtkPageSet        gtk_print_job_get_page_set    (GtkPrintJob       *job);
void              gtk_print_job_set_page_set    (GtkPrintJob       *job,
                                                 GtkPageSet         page_set);
gint              gtk_print_job_get_num_copies  (GtkPrintJob       *job);
void              gtk_print_job_set_num_copies  (GtkPrintJob       *job,
                                                 gint               num_copies);
gdouble           gtk_print_job_get_scale       (GtkPrintJob       *job);
void              gtk_print_job_set_scale       (GtkPrintJob       *job,
                                                 gdouble            scale);
guint             gtk_print_job_get_n_up        (GtkPrintJob       *job);
void              gtk_print_job_set_n_up        (GtkPrintJob       *job,
                                                 guint              n_up);
GtkNumberUpLayout gtk_print_job_get_n_up_layout (GtkPrintJob       *job);
void              gtk_print_job_set_n_up_layout (GtkPrintJob       *job,
                                                 GtkNumberUpLayout  layout);
gboolean          gtk_print_job_get_rotate      (GtkPrintJob       *job);
void              gtk_print_job_set_rotate      (GtkPrintJob       *job,
                                                 gboolean           rotate);
gboolean          gtk_print_job_get_collate     (GtkPrintJob       *job);
void              gtk_print_job_set_collate     (GtkPrintJob       *job,
                                                 gboolean           collate);
gboolean          gtk_print_job_get_reverse     (GtkPrintJob       *job);
void              gtk_print_job_set_reverse     (GtkPrintJob       *job,
                                                 gboolean           reverse);

136 137 138
G_END_DECLS

#endif /* __GTK_PRINT_JOB_H__ */