poppler.h 8.18 KB
Newer Older
1
/* poppler.h: glib interface to poppler
2 3 4 5 6 7 8 9 10 11 12 13 14 15
 * Copyright (C) 2004, Red Hat, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
Albert Astals Cid's avatar
Albert Astals Cid committed
16
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17 18 19 20 21 22 23 24 25 26 27 28 29
 */

#ifndef __POPPLER_GLIB_H__
#define __POPPLER_GLIB_H__

#include <glib-object.h>

G_BEGIN_DECLS

GQuark poppler_error_quark (void);

#define POPPLER_ERROR poppler_error_quark ()

30 31 32 33 34 35 36 37 38 39
/**
 * PopplerError:
 * @POPPLER_ERROR_INVALID: Generic error when a document opration fails
 * @POPPLER_ERROR_ENCRYPTED: Document is encrypted
 * @POPPLER_ERROR_OPEN_FILE: File could not be opened for writing when saving document
 * @POPPLER_ERROR_BAD_CATALOG: Failed to read the document catalog
 * @POPPLER_ERROR_DAMAGED: Document is damaged
 *
 * Error codes returned by #PopplerDocument
 */
40 41 42
typedef enum
{
  POPPLER_ERROR_INVALID,
43 44 45 46
  POPPLER_ERROR_ENCRYPTED,
  POPPLER_ERROR_OPEN_FILE,
  POPPLER_ERROR_BAD_CATALOG,
  POPPLER_ERROR_DAMAGED
47 48
} PopplerError;

49 50
typedef enum
{
51 52 53 54
  POPPLER_ORIENTATION_PORTRAIT,
  POPPLER_ORIENTATION_LANDSCAPE,
  POPPLER_ORIENTATION_UPSIDEDOWN,
  POPPLER_ORIENTATION_SEASCAPE
55 56
} PopplerOrientation;

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
/**
 * PopplerPageTransitionType:
 * @POPPLER_PAGE_TRANSITION_REPLACE: the new page replace the old one
 * @POPPLER_PAGE_TRANSITION_SPLIT: two lines sweep across the screen, revealing the new page
 * @POPPLER_PAGE_TRANSITION_BLINDS: multiple lines, evenly spaced across the screen, synchronously
 * sweep in the same direction to reveal the new page
 * @POPPLER_PAGE_TRANSITION_BOX: a rectangular box sweeps inward from the edges of the page or
 * outward from the center revealing the new page
 * @POPPLER_PAGE_TRANSITION_WIPE: a single line sweeps across the screen from one edge to the other
 * revealing the new page
 * @POPPLER_PAGE_TRANSITION_DISSOLVE: the old page dissolves gradually to reveal the new one
 * @POPPLER_PAGE_TRANSITION_GLITTER: similar to #POPPLER_PAGE_TRANSITION_DISSOLVE, except that the effect
 * sweeps across the page in a wide band moving from one side of the screen to the other
 * @POPPLER_PAGE_TRANSITION_FLY: changes are flown out or in to or from a location that is offscreen
 * @POPPLER_PAGE_TRANSITION_PUSH: the old page slides off the screen while the new page slides in
 * @POPPLER_PAGE_TRANSITION_COVER: the new page slides on to the screen covering the old page
 * @POPPLER_PAGE_TRANSITION_UNCOVER: the old page slides off the screen uncovering the new page
 * @POPPLER_PAGE_TRANSITION_FADE: the new page gradually becomes visible through the old one
 *
 * Page transition types
 */
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
typedef enum
{
  POPPLER_PAGE_TRANSITION_REPLACE,
  POPPLER_PAGE_TRANSITION_SPLIT,
  POPPLER_PAGE_TRANSITION_BLINDS,
  POPPLER_PAGE_TRANSITION_BOX,
  POPPLER_PAGE_TRANSITION_WIPE,
  POPPLER_PAGE_TRANSITION_DISSOLVE,
  POPPLER_PAGE_TRANSITION_GLITTER,
  POPPLER_PAGE_TRANSITION_FLY,
  POPPLER_PAGE_TRANSITION_PUSH,
  POPPLER_PAGE_TRANSITION_COVER,
  POPPLER_PAGE_TRANSITION_UNCOVER,
  POPPLER_PAGE_TRANSITION_FADE
} PopplerPageTransitionType;

94 95 96 97 98 99 100 101
/**
 * PopplerPageTransitionAlignment:
 * @POPPLER_PAGE_TRANSITION_HORIZONTAL: horizontal dimension
 * @POPPLER_PAGE_TRANSITION_VERTICAL: vertical dimension
 *
 * Page transition alignment types for #POPPLER_PAGE_TRANSITION_SPLIT
 * and #POPPLER_PAGE_TRANSITION_BLINDS transition types
 */
102 103 104 105 106 107
typedef enum
{
  POPPLER_PAGE_TRANSITION_HORIZONTAL,
  POPPLER_PAGE_TRANSITION_VERTICAL
} PopplerPageTransitionAlignment;

108 109 110 111 112 113 114 115
/**
 * PopplerPageTransitionDirection:
 * @POPPLER_PAGE_TRANSITION_INWARD: inward from the edges of the page
 * @POPPLER_PAGE_TRANSITION_OUTWARD: outward from the center of the page
 *
 * Page transition direction types for #POPPLER_PAGE_TRANSITION_SPLIT,
 * #POPPLER_PAGE_TRANSITION_BOX and #POPPLER_PAGE_TRANSITION_FLY transition types
 */
116 117 118 119 120 121
typedef enum
{
  POPPLER_PAGE_TRANSITION_INWARD,
  POPPLER_PAGE_TRANSITION_OUTWARD
} PopplerPageTransitionDirection;

122 123 124 125 126 127 128 129
/**
 * PopplerSelectionStyle:
 * @POPPLER_SELECTION_GLYPH: glyph is the minimum unit for selection
 * @POPPLER_SELECTION_WORD: word is the minimum unit for selection
 * @POPPLER_SELECTION_LINE: line is the minimum unit for selection
 *
 * Selection styles
 */
130 131
typedef enum
{
132
  POPPLER_SELECTION_GLYPH,
133
  POPPLER_SELECTION_WORD,
134
  POPPLER_SELECTION_LINE
135 136
} PopplerSelectionStyle;

137 138 139 140
/**
 * PopplerPrintFlags:
 * @POPPLER_PRINT_DOCUMENT: print main document contents
 * @POPPLER_PRINT_MARKUP_ANNOTS: print document and markup annotations
Adrian Johnson's avatar
Adrian Johnson committed
141
 * @POPPLER_PRINT_STAMP_ANNOTS_ONLY: print document and only stamp annotations
142 143 144 145 146 147 148 149 150 151 152 153 154 155
 * @POPPLER_PRINT_ALL: print main document contents and all markup annotations
 *
 * Printing flags
 *
 * Since: 0.16
 */
typedef enum /*< flags >*/
{
  POPPLER_PRINT_DOCUMENT          = 0,
  POPPLER_PRINT_MARKUP_ANNOTS     = 1 << 0,
  POPPLER_PRINT_STAMP_ANNOTS_ONLY = 1 << 1,
  POPPLER_PRINT_ALL               = POPPLER_PRINT_MARKUP_ANNOTS
} PopplerPrintFlags;

156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
/**
 * PopplerFindFlags:
 * @POPPLER_FIND_CASE_SENSITIVE: do case sensitive search
 * @POPPLER_FIND_BACKWARDS: search backwards
 * @POPPLER_FIND_WHOLE_WORDS_ONLY: search only whole words
 *
 * Flags using while searching text in a page
 *
 * Since: 0.22
 */
typedef enum /*< flags >*/
{
  POPPLER_FIND_DEFAULT          = 0,
  POPPLER_FIND_CASE_SENSITIVE   = 1 << 0,
  POPPLER_FIND_BACKWARDS        = 1 << 1,
  POPPLER_FIND_WHOLE_WORDS_ONLY = 1 << 2
} PopplerFindFlags;

174 175 176 177 178
typedef struct _PopplerDocument            PopplerDocument;
typedef struct _PopplerIndexIter           PopplerIndexIter;
typedef struct _PopplerFontsIter           PopplerFontsIter;
typedef struct _PopplerLayersIter          PopplerLayersIter;
typedef struct _PopplerRectangle           PopplerRectangle;
179
typedef struct _PopplerTextAttributes      PopplerTextAttributes;
180 181 182 183 184 185 186 187 188 189 190 191
typedef struct _PopplerColor               PopplerColor;
typedef struct _PopplerLinkMapping         PopplerLinkMapping;
typedef struct _PopplerPageTransition      PopplerPageTransition;
typedef struct _PopplerImageMapping        PopplerImageMapping;
typedef struct _PopplerFormFieldMapping    PopplerFormFieldMapping;
typedef struct _PopplerAnnotMapping        PopplerAnnotMapping;
typedef struct _PopplerPage                PopplerPage;
typedef struct _PopplerFontInfo            PopplerFontInfo;
typedef struct _PopplerLayer               PopplerLayer;
typedef struct _PopplerPSFile              PopplerPSFile;
typedef union  _PopplerAction              PopplerAction;
typedef struct _PopplerDest                PopplerDest;
192
typedef struct _PopplerActionLayer         PopplerActionLayer;
193 194
typedef struct _PopplerFormField           PopplerFormField;
typedef struct _PopplerAttachment          PopplerAttachment;
195
typedef struct _PopplerMovie               PopplerMovie;
196
typedef struct _PopplerMedia               PopplerMedia;
197 198 199 200 201
typedef struct _PopplerAnnot               PopplerAnnot;
typedef struct _PopplerAnnotMarkup         PopplerAnnotMarkup;
typedef struct _PopplerAnnotText           PopplerAnnotText;
typedef struct _PopplerAnnotFreeText       PopplerAnnotFreeText;
typedef struct _PopplerAnnotFileAttachment PopplerAnnotFileAttachment;
202
typedef struct _PopplerAnnotMovie          PopplerAnnotMovie;
203
typedef struct _PopplerAnnotScreen         PopplerAnnotScreen;
204
typedef struct _PopplerAnnotCalloutLine    PopplerAnnotCalloutLine;
205 206 207 208 209 210 211 212 213 214 215

typedef enum
{
  POPPLER_BACKEND_UNKNOWN,
  POPPLER_BACKEND_SPLASH,
  POPPLER_BACKEND_CAIRO
} PopplerBackend;

PopplerBackend poppler_get_backend (void);
const char *   poppler_get_version (void);

216 217
G_END_DECLS

218
#include "poppler-features.h"
219 220
#include "poppler-document.h"
#include "poppler-page.h"
221
#include "poppler-layer.h"
222
#include "poppler-action.h"
223
#include "poppler-form-field.h"
224
#include "poppler-enums.h"
225
#include "poppler-attachment.h"
226
#include "poppler-annot.h"
227
#include "poppler-date.h"
228
#include "poppler-movie.h"
229
#include "poppler-media.h"
230 231

#endif /* __POPPLER_GLIB_H__ */