1namespace Poppler {
2
3class Link {
4%TypeHeaderCode
5#include <qt5/poppler-qt5.h>
6#include <qt5/poppler-link.h>
7%End
8
9public:
10    Link( const QRectF &linkArea );
11    enum LinkType
12    {
13        None,
14        Goto,
15        Execute,
16        Browse,
17        Action,
18        Sound,
19        Movie,
20        Rendition,
21        JavaScript,
22%If(POPPLER_V0_50_0 -)
23        OCGState,
24%End
25    };
26    virtual LinkType linkType() const;
27    virtual ~Link();
28    QRectF linkArea() const;
29
30private:
31    Link(const Poppler::Link&);
32
33%ConvertToSubClassCode
34    switch (sipCpp->linkType()) {
35        case Poppler::Link::Goto:
36            sipType = sipType_Poppler_LinkGoto;
37            break;
38        case Poppler::Link::Execute:
39            sipType = sipType_Poppler_LinkExecute;
40            break;
41        case Poppler::Link::Browse:
42            sipType = sipType_Poppler_LinkBrowse;
43            break;
44        case Poppler::Link::Action:
45            sipType = sipType_Poppler_LinkAction;
46            break;
47        case Poppler::Link::Sound:
48            sipType = sipType_Poppler_LinkSound;
49            break;
50        case Poppler::Link::Movie:
51            sipType = sipType_Poppler_LinkMovie;
52             break;
53        case Poppler::Link::Rendition:
54            sipType = sipType_Poppler_LinkRendition;
55            break;
56        case Poppler::Link::JavaScript:
57            sipType = sipType_Poppler_LinkJavaScript;
58            break;
59        default:
60            sipType = sipType_Poppler_Link;
61    }
62%End
63
64}; // class Link
65
66
67class LinkGoto : Poppler::Link {
68%TypeHeaderCode
69#include <qt5/poppler-qt5.h>
70#include <qt5/poppler-link.h>
71%End
72
73public:
74    LinkGoto( const QRectF &linkArea, QString extFileName, const Poppler::LinkDestination & destination );
75    ~LinkGoto();
76    bool isExternal() const;
77    QString fileName() const;
78    Poppler::LinkDestination destination() const;
79    LinkType linkType() const;
80
81private:
82    LinkGoto(const Poppler::LinkGoto&);
83
84}; // class LinkGoto
85
86
87class LinkExecute : Poppler::Link {
88%TypeHeaderCode
89#include <qt5/poppler-qt5.h>
90#include <qt5/poppler-link.h>
91%End
92
93public:
94    QString fileName() const;
95    QString parameters() const;
96    LinkExecute( const QRectF &linkArea, const QString & file, const QString & params );
97    ~LinkExecute();
98    LinkType linkType() const;
99
100private:
101    LinkExecute(const Poppler::LinkExecute&);
102
103}; // class LinkExecute
104
105
106class LinkBrowse : Poppler::Link {
107%TypeHeaderCode
108#include <qt5/poppler-qt5.h>
109#include <qt5/poppler-link.h>
110%End
111
112public:
113    QString url() const;
114    LinkBrowse( const QRectF &linkArea, const QString &url );
115    ~LinkBrowse();
116    LinkType linkType() const;
117
118private:
119    LinkBrowse(const Poppler::LinkBrowse&);
120
121}; // class LinkBrowse
122
123
124class LinkAction : Poppler::Link {
125%TypeHeaderCode
126#include <qt5/poppler-qt5.h>
127#include <qt5/poppler-link.h>
128%End
129
130public:
131    enum ActionType {
132        PageFirst = 1,
133        PagePrev = 2,
134        PageNext = 3,
135        PageLast = 4,
136        HistoryBack = 5,
137        HistoryForward = 6,
138        Quit = 7,
139        Presentation = 8,
140        EndPresentation = 9,
141        Find = 10,
142        GoToPage = 11,
143        Close = 12,
144        Print = 13,
145    };
146    ActionType actionType() const;
147    LinkAction( const QRectF &linkArea, ActionType actionType );
148    ~LinkAction();
149    LinkType linkType() const;
150
151private:
152    LinkAction(const Poppler::LinkAction&);
153
154}; // class LinkAction
155
156
157class LinkSound : Poppler::Link {
158%TypeHeaderCode
159#include <qt5/poppler-qt5.h>
160#include <qt5/poppler-link.h>
161%End
162
163public:
164    LinkSound( const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, Poppler::SoundObject *sound );
165    virtual ~LinkSound();
166    LinkType linkType() const;
167    double volume() const;
168    bool synchronous() const;
169    bool repeat() const;
170    bool mix() const;
171    Poppler::SoundObject *sound() const;
172
173private:
174    LinkSound(const Poppler::LinkSound&);
175
176}; // class LinkSound
177
178%If(POPPLER_V0_22_0 -)
179class LinkRendition : Poppler::Link
180{
181%TypeHeaderCode
182#include <qt5/poppler-qt5.h>
183#include <qt5/poppler-link.h>
184%End
185
186	public:
187		enum RenditionAction
188        {
189			NoRendition,
190			PlayRendition,
191			StopRendition,
192			PauseRendition,
193			ResumeRendition
194		};
195		//LinkRendition( const QRectF &linkArea, Poppler::MediaRendition *rendition, int operation, const QString &script, const Ref &annotationReference );
196		virtual ~LinkRendition();
197		LinkType linkType() const;
198		MediaRendition *rendition() const;
199		RenditionAction action() const;
200		QString script() const;
201		bool isReferencedAnnotation( const Poppler::ScreenAnnotation *annotation ) const;
202    private:
203        LinkRendition(const Poppler::LinkRendition&);
204
205}; // class LinkRendition
206%End
207
208
209class LinkJavaScript : Poppler::Link {
210%TypeHeaderCode
211#include <qt5/poppler-qt5.h>
212#include <qt5/poppler-link.h>
213%End
214
215public:
216    LinkJavaScript( const QRectF &linkArea, const QString &js );
217    virtual ~LinkJavaScript();
218    LinkType linkType() const;
219    QString script() const;
220
221private:
222    LinkJavaScript(const Poppler::LinkJavaScript&);
223
224}; // class LinkJavaScript
225
226class LinkMovie : Poppler::Link
227{
228%Docstring
229Movie: a movie to be played.
230%End
231%TypeHeaderCode
232#include <qt5/poppler-qt5.h>
233#include <qt5/poppler-link.h>
234%End
235	public:
236		/**
237		 * Describes the operation to be performed on the movie.
238		 */
239		enum Operation
240        {
241            Play,
242            Stop,
243		    Pause,
244		    Resume
245		};
246
247		/**
248		 * Create a new Movie link.
249		 *
250		 * \param linkArea the active area of the link
251		 * \param operation the operation to be performed on the movie
252		 * \param annotationTitle the title of the movie annotation identifying the movie to be played
253		 * \param annotationReference the object reference of the movie annotation identifying the movie to be played
254		 *
255		 * Note: This constructor is supposed to be used by Poppler::Page only.
256		 */
257		//LinkMovie( const QRectF &linkArea, Operation operation, const QString &annotationTitle, const Ref &annotationReference );
258		/**
259		 * Destructor.
260		 */
261		~LinkMovie();
262		LinkType linkType() const;
263		/**
264		 * Returns the operation to be performed on the movie.
265		 */
266		Operation operation() const;
267		/**
268		 * Returns whether the given @p annotation is the referenced movie annotation for this movie @p link.
269		 */
270		bool isReferencedAnnotation( const Poppler::MovieAnnotation *annotation ) const;
271    private:
272        LinkMovie(const Poppler::LinkMovie&);
273
274}; // class LinkMovie
275
276%If(POPPLER_V0_50_0 -)
277class LinkOCGState : Poppler::Link
278{
279		LinkType linkType() const;
280    private:
281        LinkOCGState(const Poppler::LinkOCGState&);
282}; // class LinkOCGState
283%End
284
285}; // namespace Poppler
286
287/* kate: indent-width 4; space-indent on; hl c++; indent-mode cstyle; */
288