2006-04-21 15:09:32 +00:00
|
|
|
/* 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))
|
|
|
|
|
2006-05-24 10:50:57 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
2006-06-12 16:47:41 +00:00
|
|
|
GTK_PRINT_CAPABILITY_PAGE_SET = 1 << 0,
|
|
|
|
GTK_PRINT_CAPABILITY_COPIES = 1 << 1,
|
|
|
|
GTK_PRINT_CAPABILITY_COLLATE = 1 << 2,
|
|
|
|
GTK_PRINT_CAPABILITY_REVERSE = 1 << 3,
|
|
|
|
GTK_PRINT_CAPABILITY_SCALE = 1 << 4,
|
2006-06-19 04:21:22 +00:00
|
|
|
GTK_PRINT_CAPABILITY_GENERATE_PDF = 1 << 5,
|
|
|
|
GTK_PRINT_CAPABILITY_GENERATE_PS = 1 << 6
|
2006-05-24 10:50:57 +00:00
|
|
|
} GtkPrintCapabilities;
|
2006-04-21 15:09:32 +00:00
|
|
|
|
2006-04-24 09:27:40 +00:00
|
|
|
typedef struct _GtkPrintJob GtkPrintJob;
|
2006-04-21 15:09:32 +00:00
|
|
|
typedef struct _GtkPrintJobClass GtkPrintJobClass;
|
|
|
|
typedef struct _GtkPrintJobPrivate GtkPrintJobPrivate;
|
|
|
|
|
|
|
|
typedef void (*GtkPrintJobCompleteFunc) (GtkPrintJob *print_job,
|
2006-04-24 03:47:22 +00:00
|
|
|
gpointer user_data,
|
|
|
|
GError *error);
|
2006-04-21 15:09:32 +00:00
|
|
|
|
|
|
|
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;
|
2006-06-11 00:23:57 +00:00
|
|
|
gint num_page_ranges;
|
2006-04-21 15:09:32 +00:00
|
|
|
GtkPageSet page_set;
|
2006-06-11 00:23:57 +00:00
|
|
|
gint num_copies;
|
|
|
|
gdouble scale;
|
2006-06-14 12:58:14 +00:00
|
|
|
guint rotate_to_orientation : 1;
|
|
|
|
guint collate : 1;
|
|
|
|
guint reverse : 1;
|
2006-04-21 15:09:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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);
|
|
|
|
};
|
|
|
|
|
2006-06-11 00:23:57 +00:00
|
|
|
GType gtk_print_job_get_type (void) G_GNUC_CONST;
|
2006-05-15 16:22:38 +00:00
|
|
|
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);
|
|
|
|
G_CONST_RETURN gchar *gtk_print_job_get_title (GtkPrintJob *job);
|
|
|
|
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);
|
2006-06-21 18:16:58 +00:00
|
|
|
void gtk_print_job_send (GtkPrintJob *job,
|
2006-05-15 16:22:38 +00:00
|
|
|
GtkPrintJobCompleteFunc callback,
|
|
|
|
gpointer user_data,
|
2006-06-21 18:16:58 +00:00
|
|
|
GDestroyNotify dnotify);
|
2006-05-15 16:22:38 +00:00
|
|
|
|
2006-06-11 00:23:57 +00:00
|
|
|
GType gtk_print_capabilities_get_type (void) G_GNUC_CONST;
|
2006-04-21 15:09:32 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GTK_PRINT_JOB_H__ */
|