1 /* this file is part of atril, a mate document viewer 2 * 3 * Copyright (C) 2004 Martin Kretzschmar 4 * 5 * Author: 6 * Martin Kretzschmar <martink@gnome.org> 7 * 8 * Atril is free software; you can redistribute it and/or modify it 9 * under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * Atril is distributed in the hope that it will be useful, but 14 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 * General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 */ 22 23 #if !defined (__EV_ATRIL_DOCUMENT_H_INSIDE__) && !defined (ATRIL_COMPILATION) 24 #error "Only <atril-document.h> can be included directly." 25 #endif 26 27 #ifndef EV_FILE_EXPORTER_H 28 #define EV_FILE_EXPORTER_H 29 30 #include <glib-object.h> 31 32 #include "ev-render-context.h" 33 34 G_BEGIN_DECLS 35 36 typedef enum { 37 EV_FILE_FORMAT_UNKNOWN, 38 EV_FILE_FORMAT_PS, 39 EV_FILE_FORMAT_PDF 40 } EvFileExporterFormat; 41 42 typedef enum { 43 EV_FILE_EXPORTER_CAN_PAGE_SET = 1 << 0, 44 EV_FILE_EXPORTER_CAN_COPIES = 1 << 1, 45 EV_FILE_EXPORTER_CAN_COLLATE = 1 << 2, 46 EV_FILE_EXPORTER_CAN_REVERSE = 1 << 3, 47 EV_FILE_EXPORTER_CAN_SCALE = 1 << 4, 48 EV_FILE_EXPORTER_CAN_GENERATE_PDF = 1 << 5, 49 EV_FILE_EXPORTER_CAN_GENERATE_PS = 1 << 6, 50 EV_FILE_EXPORTER_CAN_PREVIEW = 1 << 7, 51 EV_FILE_EXPORTER_CAN_NUMBER_UP = 1 << 8 52 } EvFileExporterCapabilities; 53 54 typedef struct { 55 EvFileExporterFormat format; 56 const gchar *filename; 57 gint first_page; 58 gint last_page; 59 gdouble paper_width; 60 gdouble paper_height; 61 gboolean duplex; 62 gint pages_per_sheet; 63 } EvFileExporterContext; 64 65 #define EV_TYPE_FILE_EXPORTER (ev_file_exporter_get_type ()) 66 #define EV_FILE_EXPORTER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EV_TYPE_FILE_EXPORTER, EvFileExporter)) 67 #define EV_FILE_EXPORTER_IFACE(k) (G_TYPE_CHECK_CLASS_CAST((k), EV_TYPE_FILE_EXPORTER, EvFileExporterInterface)) 68 #define EV_IS_FILE_EXPORTER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EV_TYPE_FILE_EXPORTER)) 69 #define EV_IS_FILE_EXPORTER_IFACE(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EV_TYPE_FILE_EXPORTER)) 70 #define EV_FILE_EXPORTER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), EV_TYPE_FILE_EXPORTER, EvFileExporterInterface)) 71 72 typedef struct _EvFileExporter EvFileExporter; 73 typedef struct _EvFileExporterInterface EvFileExporterInterface; 74 75 struct _EvFileExporterInterface { 76 GTypeInterface base_iface; 77 78 /* Methods */ 79 void (* begin) (EvFileExporter *exporter, 80 EvFileExporterContext *fc); 81 void (* begin_page) (EvFileExporter *exporter); 82 void (* do_page) (EvFileExporter *exporter, 83 EvRenderContext *rc); 84 void (* end_page) (EvFileExporter *exporter); 85 void (* end) (EvFileExporter *exporter); 86 EvFileExporterCapabilities (* get_capabilities) (EvFileExporter *exporter); 87 }; 88 89 GType ev_file_exporter_get_type (void) G_GNUC_CONST; 90 void ev_file_exporter_begin (EvFileExporter *exporter, 91 EvFileExporterContext *fc); 92 void ev_file_exporter_begin_page (EvFileExporter *exporter); 93 void ev_file_exporter_do_page (EvFileExporter *exporter, 94 EvRenderContext *rc); 95 void ev_file_exporter_end_page (EvFileExporter *exporter); 96 void ev_file_exporter_end (EvFileExporter *exporter); 97 EvFileExporterCapabilities ev_file_exporter_get_capabilities (EvFileExporter *exporter); 98 99 G_END_DECLS 100 101 #endif 102