1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * gnome-print-dialog.h: A system print dialog |
---|
4 | * |
---|
5 | * This program is free software; you can redistribute it and/or |
---|
6 | * modify it under the terms of the GNU Library General Public License |
---|
7 | * as published by the Free Software Foundation; either version 2 of |
---|
8 | * the License, or (at your option) any later version. |
---|
9 | * |
---|
10 | * This program 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 |
---|
13 | * GNU Library General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU Library General Public |
---|
16 | * License along with this program; if not, write to the Free Software |
---|
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
---|
18 | * |
---|
19 | * Authors: |
---|
20 | * Michael Zucchi <notzed@helixcode.com> |
---|
21 | * Chema Celorio <chema@celorio.com> |
---|
22 | * Lauris Kaplinski <lauris@ximian.com> |
---|
23 | * Andreas J. Guelzow <aguelzow@taliesin.ca> |
---|
24 | * |
---|
25 | * Copyright (C) 2000-2002 Ximian Inc. |
---|
26 | * Copyright (C) 2004 Andreas J. Guelzow |
---|
27 | * |
---|
28 | */ |
---|
29 | |
---|
30 | #ifndef __GNOME_PRINT_DIALOG_H__ |
---|
31 | #define __GNOME_PRINT_DIALOG_H__ |
---|
32 | |
---|
33 | #include <glib.h> |
---|
34 | |
---|
35 | G_BEGIN_DECLS |
---|
36 | |
---|
37 | #define GNOME_TYPE_PRINT_DIALOG (gnome_print_dialog_get_type ()) |
---|
38 | #define GNOME_PRINT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_TYPE_PRINT_DIALOG, GnomePrintDialog)) |
---|
39 | #define GNOME_PRINT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNOME_TYPE_PRINT_DIALOG, GnomePrintDialogClass)) |
---|
40 | #define GNOME_IS_PRINT_DIALOG(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_TYPE_PRINT_DIALOG)) |
---|
41 | #define GNOME_IS_PRINT_DIALOG_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_TYPE_PRINT_DIALOG)) |
---|
42 | #define GNOME_PRINT_DIALOG_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GNOME_TYPE_PRINT_DIALOG), GnomePrintDialogClass) |
---|
43 | |
---|
44 | typedef struct _GnomePrintDialog GnomePrintDialog; |
---|
45 | typedef struct _GnomePrintDialogClass GnomePrintDialogClass; |
---|
46 | |
---|
47 | #include <gtk/gtk.h> |
---|
48 | #include <libgnomeprint/gnome-print-job.h> |
---|
49 | |
---|
50 | /* |
---|
51 | * Used to track what type of range selection has been setup |
---|
52 | * |
---|
53 | * This is used internally and has little use for outside world |
---|
54 | */ |
---|
55 | typedef enum { |
---|
56 | GNOME_PRINT_RANGETYPE_NONE, |
---|
57 | GNOME_PRINT_RANGETYPE_CUSTOM, |
---|
58 | GNOME_PRINT_RANGETYPE_PAGES |
---|
59 | } GnomePrintRangeType; |
---|
60 | |
---|
61 | /* |
---|
62 | * Flags for creation of range widget |
---|
63 | */ |
---|
64 | enum GnomePrintDialogRangeFlags { |
---|
65 | GNOME_PRINT_RANGE_CURRENT = (1 << 0), |
---|
66 | GNOME_PRINT_RANGE_ALL = (1 << 1), |
---|
67 | GNOME_PRINT_RANGE_RANGE = (1 << 2), |
---|
68 | GNOME_PRINT_RANGE_SELECTION = (1 << 3), |
---|
69 | GNOME_PRINT_RANGE_SELECTION_UNSENSITIVE = (1 << 4) |
---|
70 | }; |
---|
71 | |
---|
72 | /* |
---|
73 | * Flags to specify, whether we want range and copies widgets |
---|
74 | */ |
---|
75 | enum GnomePrintDialogFlags { |
---|
76 | GNOME_PRINT_DIALOG_RANGE = (1 << 0), |
---|
77 | GNOME_PRINT_DIALOG_COPIES = (1 << 1) |
---|
78 | }; |
---|
79 | |
---|
80 | /* |
---|
81 | * The button numbers corresponding to the standard buttons |
---|
82 | * Used with the GtkDialog "clicked" signal. |
---|
83 | */ |
---|
84 | enum GnomePrintButtons { |
---|
85 | GNOME_PRINT_DIALOG_RESPONSE_PRINT = 1, |
---|
86 | GNOME_PRINT_DIALOG_RESPONSE_PREVIEW, |
---|
87 | GNOME_PRINT_DIALOG_RESPONSE_CANCEL = GTK_RESPONSE_CANCEL |
---|
88 | }; |
---|
89 | |
---|
90 | GType gnome_print_dialog_get_type (void); |
---|
91 | |
---|
92 | GtkWidget * gnome_print_dialog_new (GnomePrintJob *gpj, const guchar *title, gint flags); |
---|
93 | |
---|
94 | /* For language bindings */ |
---|
95 | void gnome_print_dialog_construct (GnomePrintDialog *gpd, const guchar *title, gint flags); |
---|
96 | void gnome_print_dialog_construct_range_custom (GnomePrintDialog *gpd, GtkWidget *custom); |
---|
97 | void gnome_print_dialog_construct_range_any (GnomePrintDialog *gpd, gint flags, |
---|
98 | GtkWidget *range_widget, |
---|
99 | const guchar *currentlabel, const guchar *rangelabel); |
---|
100 | void gnome_print_dialog_construct_range_page (GnomePrintDialog *gpd, gint flags, |
---|
101 | gint start, gint end, |
---|
102 | const guchar *currentlabel, const guchar *rangelabel); |
---|
103 | |
---|
104 | void gnome_print_dialog_get_copies (GnomePrintDialog *gpd, gint *copies, gboolean *collate); |
---|
105 | void gnome_print_dialog_set_copies (GnomePrintDialog *gpd, gint copies, gint collate); |
---|
106 | GnomePrintConfig * gnome_print_dialog_get_config (GnomePrintDialog *gpd); |
---|
107 | GnomePrintRangeType gnome_print_dialog_get_range (GnomePrintDialog *gpd); |
---|
108 | int gnome_print_dialog_get_range_page (GnomePrintDialog *gpd, gint *start, gint *end); |
---|
109 | |
---|
110 | /* gnome_print_dialog_run is intended as a dropin replacement for */ |
---|
111 | /* gtk_dialog_run */ |
---|
112 | gint gnome_print_dialog_run (GnomePrintDialog const *gpd); |
---|
113 | |
---|
114 | G_END_DECLS |
---|
115 | |
---|
116 | #endif /* __GNOME_PRINT_DIALOG_H__ */ |
---|