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 _EvJobFonts EvJobFonts;
55 typedef struct _EvJobFontsClass EvJobFontsClass;
57 typedef struct _EvJobLoad EvJobLoad;
58 typedef struct _EvJobLoadClass EvJobLoadClass;
60 typedef struct _EvJobSave EvJobSave;
61 typedef struct _EvJobSaveClass EvJobSaveClass;
63 typedef struct _EvJobFind EvJobFind;
64 typedef struct _EvJobFindClass EvJobFindClass;
66 typedef struct _EvJobLayers EvJobLayers;
67 typedef struct _EvJobLayersClass EvJobLayersClass;
69 typedef struct _EvJobExport EvJobExport;
70 typedef struct _EvJobExportClass EvJobExportClass;
72 typedef struct _EvJobPrint EvJobPrint;
73 typedef struct _EvJobPrintClass EvJobPrintClass;
75 #define EV_TYPE_JOB (ev_job_get_type())
76 #define EV_JOB(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB, EvJob))
77 #define EV_JOB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB, EvJobClass))
78 #define EV_IS_JOB(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB))
79 #define EV_JOB_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS((object), EV_TYPE_JOB, EvJobClass))
81 #define EV_TYPE_JOB_LINKS (ev_job_links_get_type())
82 #define EV_JOB_LINKS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LINKS, EvJobLinks))
83 #define EV_JOB_LINKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LINKS, EvJobLinksClass))
84 #define EV_IS_JOB_LINKS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LINKS))
86 #define EV_TYPE_JOB_ATTACHMENTS (ev_job_attachments_get_type())
87 #define EV_JOB_ATTACHMENTS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachments))
88 #define EV_JOB_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_ATTACHMENTS, EvJobAttachmentsClass))
89 #define EV_IS_JOB_ATTACHMENTS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_ATTACHMENTS))
91 #define EV_TYPE_JOB_RENDER (ev_job_render_get_type())
92 #define EV_JOB_RENDER(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_RENDER, EvJobRender))
93 #define EV_JOB_RENDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_RENDER, EvJobRenderClass))
94 #define EV_IS_JOB_RENDER(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_RENDER))
96 #define EV_TYPE_JOB_PAGE_DATA (ev_job_page_data_get_type())
97 #define EV_JOB_PAGE_DATA(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_PAGE_DATA, EvJobPageData))
98 #define EV_JOB_PAGE_DATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_PAGE_DATA, EvJobPageDataClass))
99 #define EV_IS_JOB_PAGE_DATA(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_PAGE_DATA))
101 #define EV_TYPE_JOB_THUMBNAIL (ev_job_thumbnail_get_type())
102 #define EV_JOB_THUMBNAIL(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_THUMBNAIL, EvJobThumbnail))
103 #define EV_JOB_THUMBNAIL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_THUMBNAIL, EvJobThumbnailClass))
104 #define EV_IS_JOB_THUMBNAIL(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_THUMBNAIL))
106 #define EV_TYPE_JOB_FONTS (ev_job_fonts_get_type())
107 #define EV_JOB_FONTS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_FONTS, EvJobFonts))
108 #define EV_JOB_FONTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_FONTS, EvJobFontsClass))
109 #define EV_IS_JOB_FONTS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_FONTS))
111 #define EV_TYPE_JOB_LOAD (ev_job_load_get_type())
112 #define EV_JOB_LOAD(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LOAD, EvJobLoad))
113 #define EV_JOB_LOAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LOAD, EvJobLoadClass))
114 #define EV_IS_JOB_LOAD(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LOAD))
116 #define EV_TYPE_JOB_SAVE (ev_job_save_get_type())
117 #define EV_JOB_SAVE(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_SAVE, EvJobSave))
118 #define EV_JOB_SAVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_SAVE, EvJobSaveClass))
119 #define EV_IS_JOB_SAVE(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_SAVE))
121 #define EV_TYPE_JOB_FIND (ev_job_find_get_type())
122 #define EV_JOB_FIND(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_FIND, EvJobFind))
123 #define EV_JOB_FIND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_FIND, EvJobFindClass))
124 #define EV_IS_JOB_FIND(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_FIND))
126 #define EV_TYPE_JOB_LAYERS (ev_job_layers_get_type())
127 #define EV_JOB_LAYERS(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_LAYERS, EvJobLayers))
128 #define EV_JOB_LAYERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_LAYERS, EvJobLayersClass))
129 #define EV_IS_JOB_LAYERS(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_LAYERS))
131 #define EV_TYPE_JOB_EXPORT (ev_job_export_get_type())
132 #define EV_JOB_EXPORT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_EXPORT, EvJobExport))
133 #define EV_JOB_EXPORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_EXPORT, EvJobExportClass))
134 #define EV_IS_JOB_EXPORT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_EXPORT))
136 #define EV_TYPE_JOB_PRINT (ev_job_print_get_type())
137 #define EV_JOB_PRINT(object) (G_TYPE_CHECK_INSTANCE_CAST((object), EV_TYPE_JOB_PRINT, EvJobPrint))
138 #define EV_JOB_PRINT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), EV_TYPE_JOB_PRINT, EvJobPrintClass))
139 #define EV_IS_JOB_PRINT(object) (G_TYPE_CHECK_INSTANCE_TYPE((object), EV_TYPE_JOB_PRINT))
150 EvDocument *document;
152 EvJobRunMode run_mode;
159 GCancellable *cancellable;
161 guint idle_finished_id;
162 guint idle_cancelled_id;
167 GObjectClass parent_class;
169 gboolean (*run) (EvJob *job);
172 void (* cancelled) (EvJob *job);
173 void (* finished) (EvJob *job);
183 struct _EvJobLinksClass
185 EvJobClass parent_class;
188 struct _EvJobAttachments
195 struct _EvJobAttachmentsClass
197 EvJobClass parent_class;
211 cairo_surface_t *surface;
213 gboolean include_selection;
214 cairo_surface_t *selection;
215 GdkRegion *selection_region;
216 EvRectangle selection_points;
217 EvSelectionStyle selection_style;
222 struct _EvJobRenderClass
224 EvJobClass parent_class;
228 EV_PAGE_DATA_INCLUDE_NONE = 0,
229 EV_PAGE_DATA_INCLUDE_LINKS = 1 << 0,
230 EV_PAGE_DATA_INCLUDE_TEXT = 1 << 1,
231 EV_PAGE_DATA_INCLUDE_TEXT_MAPPING = 1 << 2,
232 EV_PAGE_DATA_INCLUDE_TEXT_LAYOUT = 1 << 3,
233 EV_PAGE_DATA_INCLUDE_IMAGES = 1 << 4,
234 EV_PAGE_DATA_INCLUDE_FORMS = 1 << 5,
235 EV_PAGE_DATA_INCLUDE_ANNOTS = 1 << 6,
236 EV_PAGE_DATA_INCLUDE_ALL = (1 << 7) - 1
237 } EvJobPageDataFlags;
239 struct _EvJobPageData
244 EvJobPageDataFlags flags;
247 GList *image_mapping;
248 GList *form_field_mapping;
249 GList *annot_mapping;
250 GdkRegion *text_mapping;
252 EvRectangle *text_layout;
253 guint text_layout_length;
256 struct _EvJobPageDataClass
258 EvJobClass parent_class;
261 struct _EvJobThumbnail
269 GdkPixbuf *thumbnail;
272 struct _EvJobThumbnailClass
274 EvJobClass parent_class;
280 gboolean scan_completed;
283 struct _EvJobFontsClass
285 EvJobClass parent_class;
288 void (* updated) (EvJobFonts *job,
300 struct _EvJobLoadClass
302 EvJobClass parent_class;
313 struct _EvJobSaveClass
315 EvJobClass parent_class;
327 gboolean case_sensitive;
328 gboolean has_results;
331 struct _EvJobFindClass
333 EvJobClass parent_class;
336 void (* updated) (EvJobFind *job,
347 struct _EvJobLayersClass
349 EvJobClass parent_class;
360 struct _EvJobExportClass
362 EvJobClass parent_class;
373 struct _EvJobPrintClass
375 EvJobClass parent_class;
379 GType ev_job_get_type (void) G_GNUC_CONST;
380 gboolean ev_job_run (EvJob *job);
381 void ev_job_cancel (EvJob *job);
382 void ev_job_failed (EvJob *job,
387 void ev_job_failed_from_error (EvJob *job,
389 void ev_job_succeeded (EvJob *job);
390 gboolean ev_job_is_finished (EvJob *job);
391 gboolean ev_job_is_failed (EvJob *job);
392 EvJobRunMode ev_job_get_run_mode (EvJob *job);
393 void ev_job_set_run_mode (EvJob *job,
394 EvJobRunMode run_mode);
397 GType ev_job_links_get_type (void) G_GNUC_CONST;
398 EvJob *ev_job_links_new (EvDocument *document);
400 /* EvJobAttachments */
401 GType ev_job_attachments_get_type (void) G_GNUC_CONST;
402 EvJob *ev_job_attachments_new (EvDocument *document);
405 GType ev_job_render_get_type (void) G_GNUC_CONST;
406 EvJob *ev_job_render_new (EvDocument *document,
412 void ev_job_render_set_selection_info (EvJobRender *job,
413 EvRectangle *selection_points,
414 EvSelectionStyle selection_style,
418 GType ev_job_page_data_get_type (void) G_GNUC_CONST;
419 EvJob *ev_job_page_data_new (EvDocument *document,
421 EvJobPageDataFlags flags);
424 GType ev_job_thumbnail_get_type (void) G_GNUC_CONST;
425 EvJob *ev_job_thumbnail_new (EvDocument *document,
430 GType ev_job_fonts_get_type (void) G_GNUC_CONST;
431 EvJob *ev_job_fonts_new (EvDocument *document);
434 GType ev_job_load_get_type (void) G_GNUC_CONST;
435 EvJob *ev_job_load_new (const gchar *uri);
436 void ev_job_load_set_uri (EvJobLoad *load,
438 void ev_job_load_set_password (EvJobLoad *job,
439 const gchar *password);
442 GType ev_job_save_get_type (void) G_GNUC_CONST;
443 EvJob *ev_job_save_new (EvDocument *document,
445 const gchar *document_uri);
447 GType ev_job_find_get_type (void) G_GNUC_CONST;
448 EvJob *ev_job_find_new (EvDocument *document,
452 gboolean case_sensitive);
453 gint ev_job_find_get_n_results (EvJobFind *job,
455 gdouble ev_job_find_get_progress (EvJobFind *job);
456 gboolean ev_job_find_has_results (EvJobFind *job);
457 GList **ev_job_find_get_results (EvJobFind *job);
460 GType ev_job_layers_get_type (void) G_GNUC_CONST;
461 EvJob *ev_job_layers_new (EvDocument *document);
464 GType ev_job_export_get_type (void) G_GNUC_CONST;
465 EvJob *ev_job_export_new (EvDocument *document);
466 void ev_job_export_set_page (EvJobExport *job,
469 GType ev_job_print_get_type (void) G_GNUC_CONST;
470 EvJob *ev_job_print_new (EvDocument *document);
471 void ev_job_print_set_page (EvJobPrint *job,
473 void ev_job_print_set_cairo (EvJobPrint *job,
478 #endif /* __EV_JOBS_H__ */