1 /*
2  *
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful, but
8  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
10  * for more details.
11  *
12  * You should have received a copy of the GNU Lesser General Public License
13  * along with this program; if not, see <http://www.gnu.org/licenses/>.
14  *
15  *
16  * Authors:
17  *		Chris Lahey <clahey@ximian.com>
18  *
19  * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
20  *
21  */
22 
23 #if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
24 #error "Only <e-util/e-util.h> should be included directly."
25 #endif
26 
27 #ifndef E_PRINTABLE_H
28 #define E_PRINTABLE_H
29 
30 #include <gtk/gtk.h>
31 
32 /* Standard GObject macros */
33 #define E_TYPE_PRINTABLE \
34 	(e_printable_get_type ())
35 #define E_PRINTABLE(obj) \
36 	(G_TYPE_CHECK_INSTANCE_CAST \
37 	((obj), E_TYPE_PRINTABLE, EPrintable))
38 #define E_PRINTABLE_CLASS(cls) \
39 	(G_TYPE_CHECK_CLASS_CAST \
40 	((cls), E_TYPE_PRINTABLE, EPrintableClass))
41 #define E_IS_PRINTABLE(obj) \
42 	(G_TYPE_CHECK_INSTANCE_TYPE \
43 	((obj), E_TYPE_PRINTABLE))
44 #define E_IS_PRINTABLE_CLASS(cls) \
45 	(G_TYPE_CHECK_CLASS_TYPE \
46 	((cls), E_TYPE_PRINTABLE))
47 #define E_PRINTABLE_GET_CLASS(obj) \
48 	(G_TYPE_INSTANCE_GET_CLASS \
49 	((obj), E_TYPE_PRINTABLE, EPrintableClass))
50 
51 G_BEGIN_DECLS
52 
53 typedef struct _EPrintable EPrintable;
54 typedef struct _EPrintableClass EPrintableClass;
55 
56 struct _EPrintable {
57 	GObject parent;
58 };
59 
60 struct _EPrintableClass {
61 	GObjectClass parent_class;
62 
63 	/* Signals */
64 	void		(*print_page)		(EPrintable *printable,
65 						 GtkPrintContext *context,
66 						 gdouble width,
67 						 gdouble height,
68 						 gboolean quantized);
69 	gboolean	(*data_left)		(EPrintable *printable);
70 	void		(*reset)		(EPrintable *printable);
71 	gdouble		(*height)		(EPrintable *printable,
72 						 GtkPrintContext *context,
73 						 gdouble width,
74 						 gdouble max_height,
75 						 gboolean quantized);
76 
77 	/* e_printable_will_fit (ep, ...) should be equal in value to
78 	 * (e_printable_print_page (ep, ...),
79 	 * !e_printable_data_left(ep)) except that the latter has the
80 	 * side effect of doing the printing and advancing the
81 	 * position of the printable.
82 	 */
83 	gboolean	(*will_fit)		(EPrintable *printable,
84 						 GtkPrintContext *context,
85 						 gdouble width,
86 						 gdouble max_height,
87 						 gboolean quantized);
88 };
89 
90 GType		e_printable_get_type		(void) G_GNUC_CONST;
91 EPrintable *	e_printable_new			(void);
92 void		e_printable_print_page		(EPrintable *e_printable,
93 						 GtkPrintContext *context,
94 						 gdouble width,
95 						 gdouble height,
96 						 gboolean quantized);
97 gboolean	e_printable_data_left		(EPrintable *printable);
98 void		e_printable_reset		(EPrintable *printable);
99 gdouble		e_printable_height		(EPrintable *printable,
100 						 GtkPrintContext *context,
101 						 gdouble width,
102 						 gdouble max_height,
103 						 gboolean quantized);
104 gboolean	e_printable_will_fit		(EPrintable *printable,
105 						 GtkPrintContext *context,
106 						 gdouble width,
107 						 gdouble max_height,
108 						 gboolean quantized);
109 
110 G_END_DECLS
111 
112 #endif /* E_PRINTABLE_H */
113