]> Pileus Git - ~andy/gtk/blob - gtk/gtkprintoperation-private.h
Add a boolean show-progress property, and show a progress dialog if it is
[~andy/gtk] / gtk / gtkprintoperation-private.h
1 /* GTK - The GIMP Toolkit
2  * gtkprintoperation.h: Print Operation
3  * Copyright (C) 2006, Red Hat, Inc.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __GTK_PRINT_OPERATION_PRIVATE_H__
22 #define __GTK_PRINT_OPERATION_PRIVATE_H__
23
24 #include "gtkprintoperation.h"
25
26 G_BEGIN_DECLS
27
28 struct _GtkPrintOperationPrivate
29 {
30   GtkPrintStatus status;
31   gchar *status_string;
32   GtkPageSetup *default_page_setup;
33   GtkPrintSettings *print_settings;
34   gchar *job_name;
35   gint nr_of_pages;
36   gint current_page;
37   GtkUnit unit;
38   gchar *pdf_target;
39   guint use_full_page      : 1;
40   guint show_dialog        : 1;
41   guint track_print_status : 1;
42   guint show_progress      : 1;
43   guint cancelled          : 1;
44
45   guint print_pages_idle_id;
46   guint show_progress_timeout_id;
47
48   /* Data for the print job: */
49   cairo_surface_t *surface;
50   gdouble dpi_x, dpi_y;
51
52   GtkPrintPages print_pages;
53   GtkPageRange *page_ranges;
54   gint num_page_ranges;
55   
56   gint manual_num_copies;
57   guint manual_collation   : 1;
58   guint manual_reverse     : 1;
59   guint manual_orientation : 1;
60   double manual_scale;
61   GtkPageSet manual_page_set;
62   GtkWidget *custom_widget;
63   
64   gpointer platform_data;
65   GDestroyNotify free_platform_data;
66
67   void (*start_page) (GtkPrintOperation *operation,
68                       GtkPrintContext   *print_context,
69                       GtkPageSetup      *page_setup);
70   void (*end_page)   (GtkPrintOperation *operation,
71                       GtkPrintContext   *print_context);
72   void (*end_run)    (GtkPrintOperation *operation,
73                       gboolean           wait,
74                       gboolean           cancelled);
75 };
76
77 GtkPrintOperationResult _gtk_print_operation_platform_backend_run_dialog (GtkPrintOperation *operation,
78                                                                           GtkWindow         *parent,
79                                                                           gboolean          *do_print,
80                                                                           GError           **error);
81
82 typedef void (* GtkPrintOperationPrintFunc) (GtkPrintOperation *op,
83                                              GtkWindow         *parent,
84                                              gboolean           wait);
85
86 void _gtk_print_operation_platform_backend_run_dialog_async (GtkPrintOperation          *op,
87                                                              GtkWindow                  *parent,
88                                                              GtkPrintOperationPrintFunc  print_cb);
89
90 void _gtk_print_operation_set_status (GtkPrintOperation *op,
91                                       GtkPrintStatus     status,
92                                       const gchar       *string);
93
94 /* GtkPrintContext private functions: */
95
96 GtkPrintContext *_gtk_print_context_new                             (GtkPrintOperation *op);
97 void             _gtk_print_context_set_page_setup                  (GtkPrintContext   *context,
98                                                                      GtkPageSetup      *page_setup);
99 void             _gtk_print_context_translate_into_margin           (GtkPrintContext   *context);
100 void             _gtk_print_context_rotate_according_to_orientation (GtkPrintContext   *context);
101
102 G_END_DECLS
103
104 #endif /* __GTK_PRINT_OPERATION_PRIVATE_H__ */