1/* poppler.h: glib interface to poppler
2 * Copyright (C) 2004, Red Hat, Inc.
3 * Copyright (C) 2021 André Guerreiro <aguerreiro1985@gmail.com>
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 2, or (at your option)
8 * 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, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef __POPPLER_GLIB_H__
21#define __POPPLER_GLIB_H__
22
23#include <glib-object.h>
24
25#include "poppler-macros.h"
26
27G_BEGIN_DECLS
28
29POPPLER_PUBLIC
30GQuark poppler_error_quark(void);
31
32#define POPPLER_ERROR poppler_error_quark()
33
34/**
35 * PopplerError:
36 * @POPPLER_ERROR_INVALID: Generic error when a document operation fails
37 * @POPPLER_ERROR_ENCRYPTED: Document is encrypted
38 * @POPPLER_ERROR_OPEN_FILE: File could not be opened for writing when saving document
39 * @POPPLER_ERROR_BAD_CATALOG: Failed to read the document catalog
40 * @POPPLER_ERROR_DAMAGED: Document is damaged
41 *
42 * Error codes returned by #PopplerDocument
43 */
44typedef enum
45{
46 POPPLER_ERROR_INVALID,
47 POPPLER_ERROR_ENCRYPTED,
48 POPPLER_ERROR_OPEN_FILE,
49 POPPLER_ERROR_BAD_CATALOG,
50 POPPLER_ERROR_DAMAGED,
51 POPPLER_ERROR_SIGNING
52} PopplerError;
53
54/**
55 * PopplerPageTransitionType:
56 * @POPPLER_PAGE_TRANSITION_REPLACE: the new page replace the old one
57 * @POPPLER_PAGE_TRANSITION_SPLIT: two lines sweep across the screen, revealing the new page
58 * @POPPLER_PAGE_TRANSITION_BLINDS: multiple lines, evenly spaced across the screen, synchronously
59 * sweep in the same direction to reveal the new page
60 * @POPPLER_PAGE_TRANSITION_BOX: a rectangular box sweeps inward from the edges of the page or
61 * outward from the center revealing the new page
62 * @POPPLER_PAGE_TRANSITION_WIPE: a single line sweeps across the screen from one edge to the other
63 * revealing the new page
64 * @POPPLER_PAGE_TRANSITION_DISSOLVE: the old page dissolves gradually to reveal the new one
65 * @POPPLER_PAGE_TRANSITION_GLITTER: similar to #POPPLER_PAGE_TRANSITION_DISSOLVE, except that the effect
66 * sweeps across the page in a wide band moving from one side of the screen to the other
67 * @POPPLER_PAGE_TRANSITION_FLY: changes are flown out or in to or from a location that is offscreen
68 * @POPPLER_PAGE_TRANSITION_PUSH: the old page slides off the screen while the new page slides in
69 * @POPPLER_PAGE_TRANSITION_COVER: the new page slides on to the screen covering the old page
70 * @POPPLER_PAGE_TRANSITION_UNCOVER: the old page slides off the screen uncovering the new page
71 * @POPPLER_PAGE_TRANSITION_FADE: the new page gradually becomes visible through the old one
72 *
73 * Page transition types
74 */
75typedef enum
76{
77 POPPLER_PAGE_TRANSITION_REPLACE,
78 POPPLER_PAGE_TRANSITION_SPLIT,
79 POPPLER_PAGE_TRANSITION_BLINDS,
80 POPPLER_PAGE_TRANSITION_BOX,
81 POPPLER_PAGE_TRANSITION_WIPE,
82 POPPLER_PAGE_TRANSITION_DISSOLVE,
83 POPPLER_PAGE_TRANSITION_GLITTER,
84 POPPLER_PAGE_TRANSITION_FLY,
85 POPPLER_PAGE_TRANSITION_PUSH,
86 POPPLER_PAGE_TRANSITION_COVER,
87 POPPLER_PAGE_TRANSITION_UNCOVER,
88 POPPLER_PAGE_TRANSITION_FADE
89} PopplerPageTransitionType;
90
91/**
92 * PopplerPageTransitionAlignment:
93 * @POPPLER_PAGE_TRANSITION_HORIZONTAL: horizontal dimension
94 * @POPPLER_PAGE_TRANSITION_VERTICAL: vertical dimension
95 *
96 * Page transition alignment types for #POPPLER_PAGE_TRANSITION_SPLIT
97 * and #POPPLER_PAGE_TRANSITION_BLINDS transition types
98 */
99typedef enum
100{
101 POPPLER_PAGE_TRANSITION_HORIZONTAL,
102 POPPLER_PAGE_TRANSITION_VERTICAL
103} PopplerPageTransitionAlignment;
104
105/**
106 * PopplerPageTransitionDirection:
107 * @POPPLER_PAGE_TRANSITION_INWARD: inward from the edges of the page
108 * @POPPLER_PAGE_TRANSITION_OUTWARD: outward from the center of the page
109 *
110 * Page transition direction types for #POPPLER_PAGE_TRANSITION_SPLIT,
111 * #POPPLER_PAGE_TRANSITION_BOX and #POPPLER_PAGE_TRANSITION_FLY transition types
112 */
113typedef enum
114{
115 POPPLER_PAGE_TRANSITION_INWARD,
116 POPPLER_PAGE_TRANSITION_OUTWARD
117} PopplerPageTransitionDirection;
118
119/**
120 * PopplerSelectionStyle:
121 * @POPPLER_SELECTION_GLYPH: glyph is the minimum unit for selection
122 * @POPPLER_SELECTION_WORD: word is the minimum unit for selection
123 * @POPPLER_SELECTION_LINE: line is the minimum unit for selection
124 *
125 * Selection styles
126 */
127typedef enum
128{
129 POPPLER_SELECTION_GLYPH,
130 POPPLER_SELECTION_WORD,
131 POPPLER_SELECTION_LINE
132} PopplerSelectionStyle;
133
134/**
135 * PopplerPrintFlags:
136 * @POPPLER_PRINT_DOCUMENT: print main document contents
137 * @POPPLER_PRINT_MARKUP_ANNOTS: print document and markup annotations
138 * @POPPLER_PRINT_STAMP_ANNOTS_ONLY: print document and only stamp annotations
139 * @POPPLER_PRINT_ALL: print main document contents and all markup annotations
140 *
141 * Printing flags
142 *
143 * Since: 0.16
144 */
145typedef enum /*< flags >*/
146{
147 POPPLER_PRINT_DOCUMENT = 0,
148 POPPLER_PRINT_MARKUP_ANNOTS = 1 << 0,
149 POPPLER_PRINT_STAMP_ANNOTS_ONLY = 1 << 1,
150 POPPLER_PRINT_ALL = POPPLER_PRINT_MARKUP_ANNOTS
151} PopplerPrintFlags;
152
153/**
154 * PopplerFindFlags:
155 * @POPPLER_FIND_DEFAULT: use default search settings
156 * @POPPLER_FIND_CASE_SENSITIVE: do case sensitive search
157 * @POPPLER_FIND_BACKWARDS: search backwards
158 * @POPPLER_FIND_WHOLE_WORDS_ONLY: search only whole words
159 * @POPPLER_FIND_IGNORE_DIACRITICS: do diacritics insensitive search,
160 * i.e. ignore accents, umlauts, diaeresis,etc. while matching. This
161 * option will be ignored if the search term is not pure ascii. Since 0.73.
162 * @POPPLER_FIND_MULTILINE: allows to match on text spanning from
163 * end of a line to the next line. (Currently it won't match on text spanning
164 * more than two lines.) Automatically ignores hyphen at end of line, and
165 * allows whitespace in search term to match on newline char. Since: 21.05.0.
166 *
167 * Flags using while searching text in a page
168 *
169 * Since: 0.22
170 */
171typedef enum /*< flags >*/
172{
173 POPPLER_FIND_DEFAULT = 0,
174 POPPLER_FIND_CASE_SENSITIVE = 1 << 0,
175 POPPLER_FIND_BACKWARDS = 1 << 1,
176 POPPLER_FIND_WHOLE_WORDS_ONLY = 1 << 2,
177 POPPLER_FIND_IGNORE_DIACRITICS = 1 << 3,
178 POPPLER_FIND_MULTILINE = 1 << 4
179} PopplerFindFlags;
180
181typedef struct _PopplerDocument PopplerDocument;
182typedef struct _PopplerIndexIter PopplerIndexIter;
183typedef struct _PopplerFontsIter PopplerFontsIter;
184typedef struct _PopplerLayersIter PopplerLayersIter;
185typedef struct _PopplerPoint PopplerPoint;
186typedef struct _PopplerRectangle PopplerRectangle;
187typedef struct _PopplerTextAttributes PopplerTextAttributes;
188typedef struct _PopplerColor PopplerColor;
189typedef struct _PopplerLinkMapping PopplerLinkMapping;
190typedef struct _PopplerPageTransition PopplerPageTransition;
191typedef struct _PopplerImageMapping PopplerImageMapping;
192typedef struct _PopplerFormFieldMapping PopplerFormFieldMapping;
193typedef struct _PopplerAnnotMapping PopplerAnnotMapping;
194typedef struct _PopplerPage PopplerPage;
195typedef struct _PopplerFontInfo PopplerFontInfo;
196typedef struct _PopplerLayer PopplerLayer;
197typedef struct _PopplerPSFile PopplerPSFile;
198typedef union _PopplerAction PopplerAction;
199typedef struct _PopplerDest PopplerDest;
200typedef struct _PopplerActionLayer PopplerActionLayer;
201typedef struct _PopplerFormField PopplerFormField;
202typedef struct _PopplerAttachment PopplerAttachment;
203typedef struct _PopplerMovie PopplerMovie;
204typedef struct _PopplerMedia PopplerMedia;
205typedef struct _PopplerAnnot PopplerAnnot;
206typedef struct _PopplerAnnotMarkup PopplerAnnotMarkup;
207typedef struct _PopplerAnnotText PopplerAnnotText;
208typedef struct _PopplerAnnotTextMarkup PopplerAnnotTextMarkup;
209typedef struct _PopplerAnnotFreeText PopplerAnnotFreeText;
210typedef struct _PopplerAnnotFileAttachment PopplerAnnotFileAttachment;
211typedef struct _PopplerAnnotMovie PopplerAnnotMovie;
212typedef struct _PopplerAnnotScreen PopplerAnnotScreen;
213typedef struct _PopplerAnnotCalloutLine PopplerAnnotCalloutLine;
214typedef struct _PopplerAnnotLine PopplerAnnotLine;
215typedef struct _PopplerAnnotCircle PopplerAnnotCircle;
216typedef struct _PopplerAnnotSquare PopplerAnnotSquare;
217typedef struct _PopplerQuadrilateral PopplerQuadrilateral;
218typedef struct _PopplerStructureElement PopplerStructureElement;
219typedef struct _PopplerStructureElementIter PopplerStructureElementIter;
220typedef struct _PopplerTextSpan PopplerTextSpan;
221typedef struct _PopplerPageRange PopplerPageRange;
222typedef struct _PopplerSignatureInfo PopplerSignatureInfo;
223typedef struct _PopplerAnnotStamp PopplerAnnotStamp;
224typedef struct _PopplerCertificateInfo PopplerCertificateInfo;
225typedef struct _PopplerSigningData PopplerSigningData;
226
227/**
228 * PopplerBackend:
229 * @POPPLER_BACKEND_UNKNOWN: Unknown backend
230 * @POPPLER_BACKEND_SPLASH: Splash backend
231 * @POPPLER_BACKEND_CAIRO: Cairo backend
232 *
233 * Backend codes returned by poppler_get_backend().
234 */
235typedef enum
236{
237 POPPLER_BACKEND_UNKNOWN,
238 POPPLER_BACKEND_SPLASH,
239 POPPLER_BACKEND_CAIRO
240} PopplerBackend;
241
242POPPLER_PUBLIC
243PopplerBackend poppler_get_backend(void);
244POPPLER_PUBLIC
245const char *poppler_get_version(void);
246
247G_END_DECLS
248
249#include "poppler-features.h"
250#include "poppler-document.h"
251#include "poppler-page.h"
252#include "poppler-layer.h"
253#include "poppler-action.h"
254#include "poppler-form-field.h"
255#include "poppler-enums.h"
256#include "poppler-attachment.h"
257#include "poppler-annot.h"
258#include "poppler-date.h"
259#include "poppler-movie.h"
260#include "poppler-media.h"
261#include "poppler-structure-element.h"
262
263#endif /* __POPPLER_GLIB_H__ */
264

source code of poppler/glib/poppler.h