2009-12-29 [colin] 3.7.3cvs46
[claws.git] / src / printing.h
1 /* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
2  * Copyright (C) 2007-2009 Holger Berndt <hb@claws-mail.org> 
3  * and the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (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 General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef __PRINTING_H__
21 #define __PRINTING_H__
22
23 #include <gtk/gtk.h>
24
25 #ifdef HAVE_CONFIG_H
26 #  include "config.h"
27 #endif
28
29 #if GTK_CHECK_VERSION(2,10,0) && !defined(USE_GNOMEPRINT)
30
31 typedef struct _PrintData               PrintData;
32
33 typedef struct _PrintRenderer {
34         PangoContext *(*get_pango_context)(gpointer renderer_data);
35         gpointer (*get_data_to_print)(gpointer renderer_data, gint sel_start, gint sel_end);
36         void (*cb_begin_print)(GtkPrintOperation *op, GtkPrintContext *context,
37                                 gpointer user_data);
38         void (*cb_draw_page)(GtkPrintOperation* op, GtkPrintContext*, gint page_nr,
39                              gpointer user_data);
40 } PrintRenderer;
41
42 void printing_print(GtkTextView*, GtkWindow*, gint, gint);
43 void printing_print_full(GtkWindow *parent, PrintRenderer *renderer, gpointer renderer_data, 
44                          gint sel_start, gint sel_end);
45 void printing_page_setup(GtkWindow*);
46 gpointer printing_get_renderer_data(PrintData *print_data);
47 gdouble  printing_get_zoom(PrintData *print_data);
48 void     printing_set_n_pages(PrintData *print_data, gint n_pages);
49 GtkPrintSettings *printing_get_settings(void);
50 GtkPageSetup *printing_get_page_setup(void);
51 void printing_store_settings(GtkPrintSettings *new_settings);
52
53 #endif /* GTK+ >= 2.10.0 */
54
55 #endif /* __PRINTING_H__ */