summaryrefslogtreecommitdiff
path: root/Build/source/libs/poppler/poppler-0.12.4/glib/poppler-action.h
blob: a89351af36b1fa8b35b6dff1940af256fb3f7308 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/* poppler-action.h: glib interface to poppler
 * 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
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
 */

#ifndef __POPPLER_ACTION_H__
#define __POPPLER_ACTION_H__

#include <glib-object.h>
#include "poppler.h"

G_BEGIN_DECLS

typedef enum
{
	POPPLER_ACTION_UNKNOWN,		/* unknown action */
	POPPLER_ACTION_NONE,            /* no action specified */
	POPPLER_ACTION_GOTO_DEST,	/* go to destination */
	POPPLER_ACTION_GOTO_REMOTE,	/* go to destination in new file */
	POPPLER_ACTION_LAUNCH,		/* launch app (or open document) */
	POPPLER_ACTION_URI,		/* URI */
	POPPLER_ACTION_NAMED,		/* named action*/
	POPPLER_ACTION_MOVIE		/* movie action */
} PopplerActionType;

typedef enum
{
	POPPLER_DEST_UNKNOWN,
	POPPLER_DEST_XYZ,
	POPPLER_DEST_FIT,
	POPPLER_DEST_FITH,
	POPPLER_DEST_FITV,
	POPPLER_DEST_FITR,
	POPPLER_DEST_FITB,
	POPPLER_DEST_FITBH,
	POPPLER_DEST_FITBV,
	POPPLER_DEST_NAMED
} PopplerDestType;

/* Define the PopplerAction types */
typedef struct _PopplerActionAny        PopplerActionAny;
typedef struct _PopplerActionGotoDest   PopplerActionGotoDest;
typedef struct _PopplerActionGotoRemote PopplerActionGotoRemote;
typedef struct _PopplerActionLaunch     PopplerActionLaunch;
typedef struct _PopplerActionUri        PopplerActionUri;
typedef struct _PopplerActionNamed      PopplerActionNamed;
typedef struct _PopplerActionMovie      PopplerActionMovie;

struct _PopplerDest
{
	PopplerDestType type;

	int page_num;
	double left;
	double bottom;
	double right;
	double top;
	double zoom;
	gchar *named_dest;
	guint change_left : 1;
	guint change_top : 1;
	guint change_zoom : 1;
};


struct _PopplerActionAny
{
	PopplerActionType type;
	gchar *title;
};

struct _PopplerActionGotoDest
{
	PopplerActionType type;
	gchar *title;

	PopplerDest *dest;
};

struct _PopplerActionGotoRemote
{
	PopplerActionType type;
	gchar *title;

	gchar *file_name;
	PopplerDest *dest;
};

struct _PopplerActionLaunch
{
	PopplerActionType type;
	gchar *title;

	gchar *file_name;
	gchar *params;
};

struct _PopplerActionUri
{
	PopplerActionType type;
	gchar *title;

	char *uri;
};

struct _PopplerActionNamed
{
	PopplerActionType type;
	gchar *title;

	gchar *named_dest;
};

struct _PopplerActionMovie
{
	PopplerActionType type;
	gchar *title;
};

union _PopplerAction
{
	PopplerActionType type;
	PopplerActionAny any;
	PopplerActionGotoDest goto_dest;
	PopplerActionGotoRemote goto_remote;
	PopplerActionLaunch launch;
	PopplerActionUri uri;
	PopplerActionNamed named;
	PopplerActionMovie movie;
};

#define POPPLER_TYPE_ACTION             (poppler_action_get_type ())
#define POPPLER_ACTION(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ACTION, PopplerAction))

GType          poppler_action_get_type (void) G_GNUC_CONST;

void           poppler_action_free     (PopplerAction *action);
PopplerAction *poppler_action_copy     (PopplerAction *action);


#define POPPLER_TYPE_DEST              (poppler_dest_get_type ())
GType          poppler_dest_get_type   (void) G_GNUC_CONST;

void           poppler_dest_free       (PopplerDest   *dest);
PopplerDest   *poppler_dest_copy       (PopplerDest   *dest);

G_END_DECLS

#endif /* __POPPLER_GLIB_H__ */