gtkprintjob.h 3.9 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* GtkPrintJob 
 * Copyright (C) 2006 Red Hat,Inc. 
 *
 * 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.
 */
#ifndef __GTK_PRINT_JOB_H__
#define __GTK_PRINT_JOB_H__

#include <glib-object.h>
#include <cairo.h>

#include <gtk/gtkprinter.h>
#include <gtk/gtkprintoperation.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
38
typedef struct _GtkPrintJob          GtkPrintJob;
39
40
41
42
typedef struct _GtkPrintJobClass     GtkPrintJobClass;
typedef struct _GtkPrintJobPrivate   GtkPrintJobPrivate;

typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
43
44
                                         gpointer     user_data, 
                                         GError      *error);
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

struct _GtkPrinter;

struct _GtkPrintJob
{
  GObject parent_instance;

  GtkPrintJobPrivate *priv;

  /* Settings the client has to implement:
   * (These are read-only, set at initialization)
   */
  GtkPrintPages print_pages;
  GtkPageRange *page_ranges;
  int num_page_ranges;
  GtkPageSet page_set;
  int num_copies;
  gboolean collate;
  gboolean reverse;
  double scale;
  gboolean rotate_to_orientation;
};

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);
  void (*_gtk_reserved5) (void);
  void (*_gtk_reserved6) (void);
  void (*_gtk_reserved7) (void);
};

GType                    gtk_print_job_get_type     (void) G_GNUC_CONST;
GtkPrintJob             *gtk_print_job_new          (const gchar              *title,
						     GtkPrinter               *printer,
						     GtkPrintSettings         *settings,
						     GtkPageSetup             *page_setup);
89
90
91
92
GtkPrintSettings        *gtk_print_job_get_settings (GtkPrintJob              *job);
GtkPrinter              *gtk_print_job_get_printer  (GtkPrintJob              *job);
G_CONST_RETURN gchar    *gtk_print_job_get_title    (GtkPrintJob              *job);
GtkPrintStatus           gtk_print_job_get_status   (GtkPrintJob              *job);
93

94
95
gboolean                 gtk_print_job_set_source_file (GtkPrintJob              *job,
							const gchar              *filename,
96
							GError                  **error);
97
cairo_surface_t         *gtk_print_job_get_surface     (GtkPrintJob              *job,
98
							GError                  **error);
99
gboolean                 gtk_print_job_send            (GtkPrintJob              *job,
100
101
102
103
104
105
106
107
							GtkPrintJobCompleteFunc   callback,
							gpointer                  user_data,
							GDestroyNotify            dnotify,
							GError                  **error);

G_END_DECLS

#endif /* __GTK_PRINT_JOB_H__ */