1
/* poppler-action.h: glib interface to poppler
2
* Copyright (C) 2004, Red Hat, Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2, or (at your option)
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
19
#ifndef __POPPLER_ACTION_H__
20
#define __POPPLER_ACTION_H__
22
#include <glib-object.h>
29
* @POPPLER_ACTION_UNKNOWN: unknown action
30
* @POPPLER_ACTION_NONE: no action specified
31
* @POPPLER_ACTION_GOTO_DEST: go to destination
32
* @POPPLER_ACTION_GOTO_REMOTE: go to destination in another document
33
* @POPPLER_ACTION_LAUNCH: launch app (or open document
34
* @POPPLER_ACTION_URI: URI
35
* @POPPLER_ACTION_NAMED: predefined action
36
* @POPPLER_ACTION_MOVIE: play movies. Since 0.14
37
* @POPPLER_ACTION_RENDITION: play multimedia content. Since 0.14
38
* @POPPLER_ACTION_OCG_STATE: state of layer. Since 0.14
44
POPPLER_ACTION_UNKNOWN, /* unknown action */
45
POPPLER_ACTION_NONE, /* no action specified */
46
POPPLER_ACTION_GOTO_DEST, /* go to destination */
47
POPPLER_ACTION_GOTO_REMOTE, /* go to destination in new file */
48
POPPLER_ACTION_LAUNCH, /* launch app (or open document) */
49
POPPLER_ACTION_URI, /* URI */
50
POPPLER_ACTION_NAMED, /* named action*/
51
POPPLER_ACTION_MOVIE, /* movie action */
52
POPPLER_ACTION_RENDITION, /* rendition action */
53
POPPLER_ACTION_OCG_STATE /* Set-OCG-State action */
58
* @POPPLER_DEST_UNKNOWN: unknown destination
59
* @POPPLER_DEST_XYZ: go to page with coordinates (left, top)
60
* positioned at the upper-left corner of the window and the contents of
61
* the page magnified by the factor zoom
62
* @POPPLER_DEST_FIT: go to page with its contents magnified just
63
* enough to fit the entire page within the window both horizontally and
65
* @POPPLER_DEST_FITH: go to page with the vertical coordinate top
66
* positioned at the top edge of the window and the contents of the page
67
* magnified just enough to fit the entire width of the page within the window
68
* @POPPLER_DEST_FITV: go to page with the horizontal coordinate
69
* left positioned at the left edge of the window and the contents of the
70
* page magnified just enough to fit the entire height of the page within the window
71
* @POPPLER_DEST_FITR: go to page with its contents magnified just
72
* enough to fit the rectangle specified by the coordinates left, bottom,
73
* right, and top entirely within the window both horizontally and vertically
74
* @POPPLER_DEST_FITB: go to page with its contents magnified just enough to fit
75
* its bounding box entirely within the window both horizontally and vertically
76
* @POPPLER_DEST_FITBH: go to page with the vertical
77
* coordinate top positioned at the top edge of the window and the
78
* contents of the page magnified just enough to fit the entire width of its
79
* bounding box within the window
80
* @POPPLER_DEST_FITBV: go to page with the horizontal
81
* coordinate left positioned at the left edge of the window and the
82
* contents of the page magnified just enough to fit the entire height of its
83
* bounding box within the window
84
* @POPPLER_DEST_NAMED: got to page specified by a name. See poppler_document_find_dest()
103
* PopplerActionMovieOperation:
104
* @POPPLER_ACTION_MOVIE_PLAY: play movie
105
* @POPPLER_ACTION_MOVIE_PAUSE: pause playing movie
106
* @POPPLER_ACTION_MOVIE_RESUME: resume paused movie
107
* @POPPLER_ACTION_MOVIE_STOP: stop playing movie
115
POPPLER_ACTION_MOVIE_PLAY,
116
POPPLER_ACTION_MOVIE_PAUSE,
117
POPPLER_ACTION_MOVIE_RESUME,
118
POPPLER_ACTION_MOVIE_STOP
119
} PopplerActionMovieOperation;
122
* PopplerActionLayerAction:
123
* @POPPLER_ACTION_LAYER_ON: set layer visibility on
124
* @POPPLER_ACTION_LAYER_OFF: set layer visibility off
125
* @POPPLER_ACTION_LAYER_TOGGLE: reverse the layer visibility state
133
POPPLER_ACTION_LAYER_ON,
134
POPPLER_ACTION_LAYER_OFF,
135
POPPLER_ACTION_LAYER_TOGGLE
136
} PopplerActionLayerAction;
138
/* Define the PopplerAction types */
139
typedef struct _PopplerActionAny PopplerActionAny;
140
typedef struct _PopplerActionGotoDest PopplerActionGotoDest;
141
typedef struct _PopplerActionGotoRemote PopplerActionGotoRemote;
142
typedef struct _PopplerActionLaunch PopplerActionLaunch;
143
typedef struct _PopplerActionUri PopplerActionUri;
144
typedef struct _PopplerActionNamed PopplerActionNamed;
145
typedef struct _PopplerActionMovie PopplerActionMovie;
146
typedef struct _PopplerActionRendition PopplerActionRendition;
147
typedef struct _PopplerActionOCGState PopplerActionOCGState;
151
* @type: type of destination
152
* @page_num: page number
153
* @left: left coordinate
154
* @bottom: bottom coordinate
155
* @right: right coordinate
156
* @top: top coordinate
157
* @zoom: scale factor
158
* @named_dest: name of the destination (#POPPLER_DEST_NAMED only)
159
* @change_left: whether left coordinate should be changed
160
* @change_top: whether top coordinate should be changed
161
* @change_zoom: whether scale factor should be changed
163
* Data structure for holding a destination
167
PopplerDestType type;
176
guint change_left : 1;
177
guint change_top : 1;
178
guint change_zoom : 1;
182
* PopplerActionLayer:
183
* @action: a #PopplerActionLayerAction
184
* @layers: list of #PopplerLayer<!-- -->s
186
* Action to perform over a list of layers
188
struct _PopplerActionLayer
190
PopplerActionLayerAction action;
194
struct _PopplerActionAny
196
PopplerActionType type;
200
struct _PopplerActionGotoDest
202
PopplerActionType type;
208
struct _PopplerActionGotoRemote
210
PopplerActionType type;
217
struct _PopplerActionLaunch
219
PopplerActionType type;
226
struct _PopplerActionUri
228
PopplerActionType type;
234
struct _PopplerActionNamed
236
PopplerActionType type;
242
struct _PopplerActionMovie
244
PopplerActionType type;
247
PopplerActionMovieOperation operation;
251
struct _PopplerActionRendition
253
PopplerActionType type;
260
struct _PopplerActionOCGState
262
PopplerActionType type;
271
* A data structure for holding actions
275
PopplerActionType type;
276
PopplerActionAny any;
277
PopplerActionGotoDest goto_dest;
278
PopplerActionGotoRemote goto_remote;
279
PopplerActionLaunch launch;
280
PopplerActionUri uri;
281
PopplerActionNamed named;
282
PopplerActionMovie movie;
283
PopplerActionRendition rendition;
284
PopplerActionOCGState ocg_state;
287
#define POPPLER_TYPE_ACTION (poppler_action_get_type ())
288
#define POPPLER_ACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ACTION, PopplerAction))
290
GType poppler_action_get_type (void) G_GNUC_CONST;
292
void poppler_action_free (PopplerAction *action);
293
PopplerAction *poppler_action_copy (PopplerAction *action);
296
#define POPPLER_TYPE_DEST (poppler_dest_get_type ())
297
GType poppler_dest_get_type (void) G_GNUC_CONST;
299
void poppler_dest_free (PopplerDest *dest);
300
PopplerDest *poppler_dest_copy (PopplerDest *dest);
304
#endif /* __POPPLER_GLIB_H__ */