~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/poppler/glib/poppler-action.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* poppler-action.h: glib interface to poppler
 
2
 * Copyright (C) 2004, Red Hat, Inc.
 
3
 *
 
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)
 
7
 * any later version.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
#ifndef __POPPLER_ACTION_H__
 
20
#define __POPPLER_ACTION_H__
 
21
 
 
22
#include <glib-object.h>
 
23
#include "poppler.h"
 
24
 
 
25
G_BEGIN_DECLS
 
26
 
 
27
/**
 
28
 * PopplerActionType:
 
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
 
39
 *
 
40
 * Action types
 
41
 */
 
42
typedef enum
 
43
{
 
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 */
 
54
} PopplerActionType;
 
55
 
 
56
/**
 
57
 * PopplerDestType:
 
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
 
64
 * vertically
 
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()
 
85
 *
 
86
 * Destination types
 
87
 */
 
88
typedef enum
 
89
{
 
90
        POPPLER_DEST_UNKNOWN,
 
91
        POPPLER_DEST_XYZ,
 
92
        POPPLER_DEST_FIT,
 
93
        POPPLER_DEST_FITH,
 
94
        POPPLER_DEST_FITV,
 
95
        POPPLER_DEST_FITR,
 
96
        POPPLER_DEST_FITB,
 
97
        POPPLER_DEST_FITBH,
 
98
        POPPLER_DEST_FITBV,
 
99
        POPPLER_DEST_NAMED
 
100
} PopplerDestType;
 
101
 
 
102
/**
 
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
 
108
 *
 
109
 * Movie operations
 
110
 *
 
111
 * Since: 0.14
 
112
 */
 
113
typedef enum
 
114
{
 
115
        POPPLER_ACTION_MOVIE_PLAY,
 
116
        POPPLER_ACTION_MOVIE_PAUSE,
 
117
        POPPLER_ACTION_MOVIE_RESUME,
 
118
        POPPLER_ACTION_MOVIE_STOP
 
119
} PopplerActionMovieOperation;
 
120
 
 
121
/**
 
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
 
126
 *
 
127
 * Layer actions
 
128
 *
 
129
 * Since: 0.14
 
130
 */
 
131
typedef enum
 
132
{
 
133
        POPPLER_ACTION_LAYER_ON,
 
134
        POPPLER_ACTION_LAYER_OFF,
 
135
        POPPLER_ACTION_LAYER_TOGGLE
 
136
} PopplerActionLayerAction;
 
137
 
 
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;
 
148
 
 
149
/**
 
150
 * PopplerDest:
 
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
 
162
 *
 
163
 * Data structure for holding a destination
 
164
 */
 
165
struct _PopplerDest
 
166
{
 
167
        PopplerDestType type;
 
168
 
 
169
        int page_num;
 
170
        double left;
 
171
        double bottom;
 
172
        double right;
 
173
        double top;
 
174
        double zoom;
 
175
        gchar *named_dest;
 
176
        guint change_left : 1;
 
177
        guint change_top : 1;
 
178
        guint change_zoom : 1;
 
179
};
 
180
 
 
181
/**
 
182
 * PopplerActionLayer:
 
183
 * @action: a #PopplerActionLayerAction
 
184
 * @layers: list of #PopplerLayer<!-- -->s
 
185
 *
 
186
 * Action to perform over a list of layers
 
187
 */
 
188
struct _PopplerActionLayer
 
189
{
 
190
        PopplerActionLayerAction action;
 
191
        GList *layers;
 
192
};
 
193
 
 
194
struct _PopplerActionAny
 
195
{
 
196
        PopplerActionType type;
 
197
        gchar *title;
 
198
};
 
199
 
 
200
struct _PopplerActionGotoDest
 
201
{
 
202
        PopplerActionType type;
 
203
        gchar *title;
 
204
 
 
205
        PopplerDest *dest;
 
206
};
 
207
 
 
208
struct _PopplerActionGotoRemote
 
209
{
 
210
        PopplerActionType type;
 
211
        gchar *title;
 
212
 
 
213
        gchar *file_name;
 
214
        PopplerDest *dest;
 
215
};
 
216
 
 
217
struct _PopplerActionLaunch
 
218
{
 
219
        PopplerActionType type;
 
220
        gchar *title;
 
221
 
 
222
        gchar *file_name;
 
223
        gchar *params;
 
224
};
 
225
 
 
226
struct _PopplerActionUri
 
227
{
 
228
        PopplerActionType type;
 
229
        gchar *title;
 
230
 
 
231
        char *uri;
 
232
};
 
233
 
 
234
struct _PopplerActionNamed
 
235
{
 
236
        PopplerActionType type;
 
237
        gchar *title;
 
238
 
 
239
        gchar *named_dest;
 
240
};
 
241
 
 
242
struct _PopplerActionMovie
 
243
{
 
244
        PopplerActionType           type;
 
245
        gchar                      *title;
 
246
 
 
247
        PopplerActionMovieOperation operation;
 
248
        PopplerMovie               *movie;
 
249
};
 
250
 
 
251
struct _PopplerActionRendition
 
252
{
 
253
        PopplerActionType type;
 
254
        gchar            *title;
 
255
 
 
256
        gint               op;
 
257
        PopplerMedia      *media;
 
258
};
 
259
 
 
260
struct _PopplerActionOCGState
 
261
{
 
262
        PopplerActionType type;
 
263
        gchar            *title;
 
264
 
 
265
        GList            *state_list;
 
266
};
 
267
 
 
268
/**
 
269
 * PopplerAction:
 
270
 *
 
271
 * A data structure for holding actions
 
272
 */
 
273
union _PopplerAction
 
274
{
 
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;
 
285
};
 
286
 
 
287
#define POPPLER_TYPE_ACTION             (poppler_action_get_type ())
 
288
#define POPPLER_ACTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ACTION, PopplerAction))
 
289
 
 
290
GType          poppler_action_get_type (void) G_GNUC_CONST;
 
291
 
 
292
void           poppler_action_free     (PopplerAction *action);
 
293
PopplerAction *poppler_action_copy     (PopplerAction *action);
 
294
 
 
295
 
 
296
#define POPPLER_TYPE_DEST              (poppler_dest_get_type ())
 
297
GType          poppler_dest_get_type   (void) G_GNUC_CONST;
 
298
 
 
299
void           poppler_dest_free       (PopplerDest   *dest);
 
300
PopplerDest   *poppler_dest_copy       (PopplerDest   *dest);
 
301
 
 
302
G_END_DECLS
 
303
 
 
304
#endif /* __POPPLER_GLIB_H__ */