1 /* this file is part of evince, a gnome document viewer
3 * Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
4 * Copyright (C) 2005 Red Hat, Inc
6 * Evince is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Evince is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #if !defined (__EV_EVINCE_VIEW_H_INSIDE__) && !defined (EVINCE_COMPILATION)
22 #error "Only <evince-view.h> can be included directly."
32 #include <evince-document.h>
36 typedef struct _EvJob EvJob;
37 typedef struct _EvJobClass EvJobClass;
39 typedef struct _EvJobRender EvJobRender;
40 typedef struct _EvJobRenderClass EvJobRenderClass;
42 typedef struct _EvJobPageData EvJobPageData;
43 typedef struct _EvJobPageDataClass EvJobPageDataClass;
45 typedef struct _EvJobThumbnail EvJobThumbnail;
46 typedef struct _EvJobThumbnailClass EvJobThumbnailClass;
48 typedef struct _EvJobLinks EvJobLinks;
49 typedef struct _EvJobLinksClass EvJobLinksClass;
51 typedef struct _EvJobAttachments EvJobAttachments;
52 typedef struct _EvJobAttachmentsClass EvJobAttachmentsClass;
54 typedef struct _EvJobAnnots EvJobAnnots;
55 typedef struct _EvJobAnnotsClass EvJobAnnotsClass;
57 typedef struct _EvJobFonts EvJobFonts;
58 typedef struct _EvJobFontsClass EvJobFontsClass;
60 typedef struct _EvJobLoad EvJobLoad;
61 typedef struct _EvJobLoadClass EvJobLoadClass;
63 typedef struct _EvJobSave EvJobSave;
64 typedef struct _EvJobSaveClass EvJobSaveClass;
66 typedef struct _EvJobFind EvJobFind;
67 typedef struct _EvJobFindClass EvJobFindClass;
69 typedef struct _EvJobLayers EvJobLayers;
70 typedef struct _EvJobLayersClass EvJobLayersClass;
72 typedef struct _EvJobExport EvJobExport;
73 typedef struct _EvJobExportClass EvJobExportClass;
75 typedef struct _EvJobPrint EvJobPrint;
76 typedef struct _EvJobPrintClass EvJobPrintClass;
78 #define EV_TYPE_JOB (ev_job_get_type())
79 #define EV_JOB(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB, EvJob))
80 #define EV_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB, EvJobClass))
81 #define EV_IS_JOB(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB))
82 #define EV_JOB_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_JOB, EvJobClass))
84 #define EV_TYPE_JOB_LINKS (ev_job_links_get_type())
85 #define EV_JOB_LINKS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LINKS, EvJobLinks))
86 #define EV_JOB_LINKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LINKS, EvJobLinksClass))
87 #define EV_IS_JOB_LINKS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LINKS))
89 #define EV_TYPE_JOB_ATTACHMENTS (ev_job_attachments_get_type())
90 #define EV_JOB_ATTACHMENTS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachments))
91 #define EV_JOB_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachmentsClass))
92 #define EV_IS_JOB_ATTACHMENTS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_ATTACHMENTS))
94 #define EV_TYPE_JOB_ANNOTS (ev_job_annots_get_type())
95 #define EV_JOB_ANNOTS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_ANNOTS, EvJobAnnots))
96 #define EV_JOB_ANNOTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_ANNOTS, EvJobAnnotsClass))
97 #define EV_IS_JOB_ANNOTS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_ANNOTS))
99 #define EV_TYPE_JOB_RENDER (ev_job_render_get_type())
100 #define EV_JOB_RENDER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_RENDER, EvJobRender))
101 #define EV_JOB_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_RENDER, EvJobRenderClass))
102 #define EV_IS_JOB_RENDER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_RENDER))
104 #define EV_TYPE_JOB_PAGE_DATA (ev_job_page_data_get_type())
105 #define EV_JOB_PAGE_DATA(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_PAGE_DATA, EvJobPageData))
106 #define EV_JOB_PAGE_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_PAGE_DATA, EvJobPageDataClass))
107 #define EV_IS_JOB_PAGE_DATA(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_PAGE_DATA))
109 #define EV_TYPE_JOB_THUMBNAIL (ev_job_thumbnail_get_type())
110 #define EV_JOB_THUMBNAIL(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_THUMBNAIL, EvJobThumbnail))
111 #define EV_JOB_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_THUMBNAIL, EvJobThumbnailClass))
112 #define EV_IS_JOB_THUMBNAIL(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_THUMBNAIL))
114 #define EV_TYPE_JOB_FONTS (ev_job_fonts_get_type())
115 #define EV_JOB_FONTS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_FONTS, EvJobFonts))
116 #define EV_JOB_FONTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_FONTS, EvJobFontsClass))
117 #define EV_IS_JOB_FONTS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_FONTS))
119 #define EV_TYPE_JOB_LOAD (ev_job_load_get_type())
120 #define EV_JOB_LOAD(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LOAD, EvJobLoad))
121 #define EV_JOB_LOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LOAD, EvJobLoadClass))
122 #define EV_IS_JOB_LOAD(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LOAD))
124 #define EV_TYPE_JOB_SAVE (ev_job_save_get_type())
125 #define EV_JOB_SAVE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_SAVE, EvJobSave))
126 #define EV_JOB_SAVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_SAVE, EvJobSaveClass))
127 #define EV_IS_JOB_SAVE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_SAVE))
129 #define EV_TYPE_JOB_FIND (ev_job_find_get_type())
130 #define EV_JOB_FIND(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_FIND, EvJobFind))
131 #define EV_JOB_FIND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_FIND, EvJobFindClass))
132 #define EV_IS_JOB_FIND(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_FIND))
134 #define EV_TYPE_JOB_LAYERS (ev_job_layers_get_type())
135 #define EV_JOB_LAYERS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LAYERS, EvJobLayers))
136 #define EV_JOB_LAYERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LAYERS, EvJobLayersClass))
137 #define EV_IS_JOB_LAYERS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LAYERS))
139 #define EV_TYPE_JOB_EXPORT (ev_job_export_get_type())
140 #define EV_JOB_EXPORT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_EXPORT, EvJobExport))
141 #define EV_JOB_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_EXPORT, EvJobExportClass))
142 #define EV_IS_JOB_EXPORT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_EXPORT))
144 #define EV_TYPE_JOB_PRINT (ev_job_print_get_type())
145 #define EV_JOB_PRINT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_PRINT, EvJobPrint))
146 #define EV_JOB_PRINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_PRINT, EvJobPrintClass))
147 #define EV_IS_JOB_PRINT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_PRINT))
158 EvDocument *document;
160 EvJobRunMode run_mode;
167 GCancellable *cancellable;
169 guint idle_finished_id;
170 guint idle_cancelled_id;
175 GObjectClass parent_class;
177 gboolean (*run) (EvJob *job);
180 void (* cancelled) (EvJob *job);
181 void (* finished) (EvJob *job);
191 struct _EvJobLinksClass
193 EvJobClass parent_class;
196 struct _EvJobAttachments
203 struct _EvJobAttachmentsClass
205 EvJobClass parent_class;
215 struct _EvJobAnnotsClass
217 EvJobClass parent_class;
231 cairo_surface_t *surface;
233 gboolean include_selection;
234 cairo_surface_t *selection;
235 cairo_region_t *selection_region;
236 EvRectangle selection_points;
237 EvSelectionStyle selection_style;
242 struct _EvJobRenderClass
244 EvJobClass parent_class;
248 EV_PAGE_DATA_INCLUDE_NONE = 0,
249 EV_PAGE_DATA_INCLUDE_LINKS = 1 << 0,
250 EV_PAGE_DATA_INCLUDE_TEXT = 1 << 1,
251 EV_PAGE_DATA_INCLUDE_TEXT_MAPPING = 1 << 2,
252 EV_PAGE_DATA_INCLUDE_TEXT_LAYOUT = 1 << 3,
253 EV_PAGE_DATA_INCLUDE_IMAGES = 1 << 4,
254 EV_PAGE_DATA_INCLUDE_FORMS = 1 << 5,
255 EV_PAGE_DATA_INCLUDE_ANNOTS = 1 << 6,
256 EV_PAGE_DATA_INCLUDE_ALL = (1 << 7) - 1
257 } EvJobPageDataFlags;
259 struct _EvJobPageData
264 EvJobPageDataFlags flags;
266 EvMappingList *link_mapping;
267 EvMappingList *image_mapping;
268 EvMappingList *form_field_mapping;
269 EvMappingList *annot_mapping;
270 cairo_region_t *text_mapping;
272 EvRectangle *text_layout;
273 guint text_layout_length;
276 struct _EvJobPageDataClass
278 EvJobClass parent_class;
281 struct _EvJobThumbnail
289 GdkPixbuf *thumbnail;
292 struct _EvJobThumbnailClass
294 EvJobClass parent_class;
300 gboolean scan_completed;
303 struct _EvJobFontsClass
305 EvJobClass parent_class;
308 void (* updated) (EvJobFonts *job,
320 struct _EvJobLoadClass
322 EvJobClass parent_class;
333 struct _EvJobSaveClass
335 EvJobClass parent_class;
347 gboolean case_sensitive;
348 gboolean has_results;
351 struct _EvJobFindClass
353 EvJobClass parent_class;
356 void (* updated) (EvJobFind *job,
367 struct _EvJobLayersClass
369 EvJobClass parent_class;
380 struct _EvJobExportClass
382 EvJobClass parent_class;
393 struct _EvJobPrintClass
395 EvJobClass parent_class;
399 GType ev_job_get_type (void) G_GNUC_CONST;
400 gboolean ev_job_run (EvJob *job);
401 void ev_job_cancel (EvJob *job);
402 void ev_job_failed (EvJob *job,
407 void ev_job_failed_from_error (EvJob *job,
409 void ev_job_succeeded (EvJob *job);
410 gboolean ev_job_is_finished (EvJob *job);
411 gboolean ev_job_is_failed (EvJob *job);
412 EvJobRunMode ev_job_get_run_mode (EvJob *job);
413 void ev_job_set_run_mode (EvJob *job,
414 EvJobRunMode run_mode);
417 GType ev_job_links_get_type (void) G_GNUC_CONST;
418 EvJob *ev_job_links_new (EvDocument *document);
420 /* EvJobAttachments */
421 GType ev_job_attachments_get_type (void) G_GNUC_CONST;
422 EvJob *ev_job_attachments_new (EvDocument *document);
425 GType ev_job_annots_get_type (void) G_GNUC_CONST;
426 EvJob *ev_job_annots_new (EvDocument *document);
429 GType ev_job_render_get_type (void) G_GNUC_CONST;
430 EvJob *ev_job_render_new (EvDocument *document,
436 void ev_job_render_set_selection_info (EvJobRender *job,
437 EvRectangle *selection_points,
438 EvSelectionStyle selection_style,
442 GType ev_job_page_data_get_type (void) G_GNUC_CONST;
443 EvJob *ev_job_page_data_new (EvDocument *document,
445 EvJobPageDataFlags flags);
448 GType ev_job_thumbnail_get_type (void) G_GNUC_CONST;
449 EvJob *ev_job_thumbnail_new (EvDocument *document,
454 GType ev_job_fonts_get_type (void) G_GNUC_CONST;
455 EvJob *ev_job_fonts_new (EvDocument *document);
458 GType ev_job_load_get_type (void) G_GNUC_CONST;
459 EvJob *ev_job_load_new (const gchar *uri);
460 void ev_job_load_set_uri (EvJobLoad *load,
462 void ev_job_load_set_password (EvJobLoad *job,
463 const gchar *password);
466 GType ev_job_save_get_type (void) G_GNUC_CONST;
467 EvJob *ev_job_save_new (EvDocument *document,
469 const gchar *document_uri);
471 GType ev_job_find_get_type (void) G_GNUC_CONST;
472 EvJob *ev_job_find_new (EvDocument *document,
476 gboolean case_sensitive);
477 gint ev_job_find_get_n_results (EvJobFind *job,
479 gdouble ev_job_find_get_progress (EvJobFind *job);
480 gboolean ev_job_find_has_results (EvJobFind *job);
481 GList **ev_job_find_get_results (EvJobFind *job);
484 GType ev_job_layers_get_type (void) G_GNUC_CONST;
485 EvJob *ev_job_layers_new (EvDocument *document);
488 GType ev_job_export_get_type (void) G_GNUC_CONST;
489 EvJob *ev_job_export_new (EvDocument *document);
490 void ev_job_export_set_page (EvJobExport *job,
493 GType ev_job_print_get_type (void) G_GNUC_CONST;
494 EvJob *ev_job_print_new (EvDocument *document);
495 void ev_job_print_set_page (EvJobPrint *job,
497 void ev_job_print_set_cairo (EvJobPrint *job,
502 #endif /* __EV_JOBS_H__ */