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 | |
27 | G_BEGIN_DECLS |
28 | |
29 | POPPLER_PUBLIC |
30 | GQuark 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 | */ |
44 | typedef 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 | */ |
75 | typedef 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 | */ |
99 | typedef 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 | */ |
113 | typedef 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 | */ |
127 | typedef 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 | */ |
145 | typedef 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 | */ |
171 | typedef 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 | |
181 | typedef struct _PopplerDocument PopplerDocument; |
182 | typedef struct _PopplerIndexIter PopplerIndexIter; |
183 | typedef struct _PopplerFontsIter PopplerFontsIter; |
184 | typedef struct _PopplerLayersIter PopplerLayersIter; |
185 | typedef struct _PopplerPoint PopplerPoint; |
186 | typedef struct _PopplerRectangle PopplerRectangle; |
187 | typedef struct _PopplerTextAttributes PopplerTextAttributes; |
188 | typedef struct _PopplerColor PopplerColor; |
189 | typedef struct _PopplerLinkMapping PopplerLinkMapping; |
190 | typedef struct _PopplerPageTransition PopplerPageTransition; |
191 | typedef struct _PopplerImageMapping PopplerImageMapping; |
192 | typedef struct _PopplerFormFieldMapping PopplerFormFieldMapping; |
193 | typedef struct _PopplerAnnotMapping PopplerAnnotMapping; |
194 | typedef struct _PopplerPage PopplerPage; |
195 | typedef struct _PopplerFontInfo PopplerFontInfo; |
196 | typedef struct _PopplerLayer PopplerLayer; |
197 | typedef struct _PopplerPSFile PopplerPSFile; |
198 | typedef union _PopplerAction PopplerAction; |
199 | typedef struct _PopplerDest PopplerDest; |
200 | typedef struct _PopplerActionLayer PopplerActionLayer; |
201 | typedef struct _PopplerFormField PopplerFormField; |
202 | typedef struct _PopplerAttachment PopplerAttachment; |
203 | typedef struct _PopplerMovie PopplerMovie; |
204 | typedef struct _PopplerMedia PopplerMedia; |
205 | typedef struct _PopplerAnnot PopplerAnnot; |
206 | typedef struct _PopplerAnnotMarkup PopplerAnnotMarkup; |
207 | typedef struct _PopplerAnnotText PopplerAnnotText; |
208 | typedef struct _PopplerAnnotTextMarkup PopplerAnnotTextMarkup; |
209 | typedef struct _PopplerAnnotFreeText PopplerAnnotFreeText; |
210 | typedef struct _PopplerAnnotFileAttachment PopplerAnnotFileAttachment; |
211 | typedef struct _PopplerAnnotMovie PopplerAnnotMovie; |
212 | typedef struct _PopplerAnnotScreen PopplerAnnotScreen; |
213 | typedef struct _PopplerAnnotCalloutLine PopplerAnnotCalloutLine; |
214 | typedef struct _PopplerAnnotLine PopplerAnnotLine; |
215 | typedef struct _PopplerAnnotCircle PopplerAnnotCircle; |
216 | typedef struct _PopplerAnnotSquare PopplerAnnotSquare; |
217 | typedef struct _PopplerQuadrilateral PopplerQuadrilateral; |
218 | typedef struct _PopplerStructureElement PopplerStructureElement; |
219 | typedef struct _PopplerStructureElementIter PopplerStructureElementIter; |
220 | typedef struct _PopplerTextSpan PopplerTextSpan; |
221 | typedef struct _PopplerPageRange ; |
222 | typedef struct _PopplerSignatureInfo PopplerSignatureInfo; |
223 | typedef struct _PopplerAnnotStamp PopplerAnnotStamp; |
224 | typedef struct _PopplerCertificateInfo PopplerCertificateInfo; |
225 | typedef 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 | */ |
235 | typedef enum |
236 | { |
237 | POPPLER_BACKEND_UNKNOWN, |
238 | POPPLER_BACKEND_SPLASH, |
239 | POPPLER_BACKEND_CAIRO |
240 | } PopplerBackend; |
241 | |
242 | POPPLER_PUBLIC |
243 | PopplerBackend poppler_get_backend(void); |
244 | POPPLER_PUBLIC |
245 | const char *poppler_get_version(void); |
246 | |
247 | G_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 | |