00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _POPPLER_LINK_H_
00023 #define _POPPLER_LINK_H_
00024
00025 #include <QtCore/QString>
00026 #include <QtCore/QRectF>
00027 #include <QtCore/QSharedDataPointer>
00028 #include "poppler-export.h"
00029
00030 namespace Poppler {
00031
00032 class LinkPrivate;
00033 class LinkGotoPrivate;
00034 class LinkExecutePrivate;
00035 class LinkBrowsePrivate;
00036 class LinkActionPrivate;
00037 class LinkSoundPrivate;
00038 class LinkJavaScriptPrivate;
00039 class LinkMoviePrivate;
00040 class LinkDestinationData;
00041 class LinkDestinationPrivate;
00042 class SoundObject;
00043
00053 class POPPLER_QT4_EXPORT LinkDestination
00054 {
00055 public:
00059 enum Kind
00060 {
00067 destXYZ = 1,
00068 destFit = 2,
00069 destFitH = 3,
00070 destFitV = 4,
00071 destFitR = 5,
00072 destFitB = 6,
00073 destFitBH = 7,
00074 destFitBV = 8
00075 };
00076
00078 LinkDestination(const LinkDestinationData &data);
00079 LinkDestination(const QString &description);
00081
00084 LinkDestination(const LinkDestination &other);
00088 ~LinkDestination();
00089
00090
00094 Kind kind() const;
00101 int pageNumber() const;
00106 double left() const;
00107 double bottom() const;
00108 double right() const;
00113 double top() const;
00114 double zoom() const;
00121 bool isChangeLeft() const;
00128 bool isChangeTop() const;
00134 bool isChangeZoom() const;
00135
00139 QString toString() const;
00140
00146 QString destinationName() const;
00147
00151 LinkDestination& operator=(const LinkDestination &other);
00152
00153 private:
00154 QSharedDataPointer< LinkDestinationPrivate > d;
00155 };
00156
00164 class POPPLER_QT4_EXPORT Link
00165 {
00166 public:
00168 Link( const QRectF &linkArea );
00170
00176 enum LinkType
00177 {
00178 None,
00179 Goto,
00180 Execute,
00181 Browse,
00182 Action,
00183 Sound,
00184 Movie,
00185 JavaScript
00186 };
00187
00191 virtual LinkType linkType() const;
00192
00196 virtual ~Link();
00197
00204 QRectF linkArea() const;
00205
00206 protected:
00208 Link( LinkPrivate &dd );
00209 Q_DECLARE_PRIVATE( Link )
00210 LinkPrivate *d_ptr;
00212
00213 private:
00214 Q_DISABLE_COPY( Link )
00215 };
00216
00217
00226 class POPPLER_QT4_EXPORT LinkGoto : public Link
00227 {
00228 public:
00236 LinkGoto( const QRectF &linkArea, QString extFileName, const LinkDestination & destination );
00240 ~LinkGoto();
00241
00246 bool isExternal() const;
00247
00252 QString fileName() const;
00256 LinkDestination destination() const;
00257 LinkType linkType() const;
00258
00259 private:
00260 Q_DECLARE_PRIVATE( LinkGoto )
00261 Q_DISABLE_COPY( LinkGoto )
00262 };
00263
00272 class POPPLER_QT4_EXPORT LinkExecute : public Link
00273 {
00274 public:
00278 QString fileName() const;
00282 QString parameters() const;
00283
00291 LinkExecute( const QRectF &linkArea, const QString & file, const QString & params );
00295 ~LinkExecute();
00296 LinkType linkType() const;
00297
00298 private:
00299 Q_DECLARE_PRIVATE( LinkExecute )
00300 Q_DISABLE_COPY( LinkExecute )
00301 };
00302
00311 class POPPLER_QT4_EXPORT LinkBrowse : public Link
00312 {
00313 public:
00317 QString url() const;
00318
00325 LinkBrowse( const QRectF &linkArea, const QString &url );
00329 ~LinkBrowse();
00330 LinkType linkType() const;
00331
00332 private:
00333 Q_DECLARE_PRIVATE( LinkBrowse )
00334 Q_DISABLE_COPY( LinkBrowse )
00335 };
00336
00343 class POPPLER_QT4_EXPORT LinkAction : public Link
00344 {
00345 public:
00349 enum ActionType { PageFirst = 1,
00350 PagePrev = 2,
00351 PageNext = 3,
00352 PageLast = 4,
00353 HistoryBack = 5,
00354 HistoryForward = 6,
00355 Quit = 7,
00356 Presentation = 8,
00357 EndPresentation = 9,
00358 Find = 10,
00359 GoToPage = 11,
00360 Close = 12 };
00361
00365 ActionType actionType() const;
00366
00374 LinkAction( const QRectF &linkArea, ActionType actionType );
00378 ~LinkAction();
00379 LinkType linkType() const;
00380
00381 private:
00382 Q_DECLARE_PRIVATE( LinkAction )
00383 Q_DISABLE_COPY( LinkAction )
00384 };
00385
00391 class POPPLER_QT4_EXPORT LinkSound : public Link
00392 {
00393 public:
00394
00395 LinkSound( const QRectF &linkArea, double volume, bool sync, bool repeat, bool mix, SoundObject *sound );
00399 virtual ~LinkSound();
00400
00401 LinkType linkType() const;
00402
00410 double volume() const;
00415 bool synchronous() const;
00420 bool repeat() const;
00428 bool mix() const;
00432 SoundObject *sound() const;
00433
00434 private:
00435 Q_DECLARE_PRIVATE( LinkSound )
00436 Q_DISABLE_COPY( LinkSound )
00437 };
00438
00444 class POPPLER_QT4_EXPORT LinkJavaScript : public Link
00445 {
00446 public:
00453 LinkJavaScript( const QRectF &linkArea, const QString &js );
00457 virtual ~LinkJavaScript();
00458
00459 LinkType linkType() const;
00460
00464 QString script() const;
00465
00466 private:
00467 Q_DECLARE_PRIVATE( LinkJavaScript )
00468 Q_DISABLE_COPY( LinkJavaScript )
00469 };
00470
00471 #if 0
00472
00473 class POPPLER_QT4_EXPORT LinkMovie : public Link
00474
00475 {
00476 public:
00477 LinkMovie( const QRectF &linkArea );
00478 ~LinkMovie();
00479 LinkType linkType() const;
00480
00481 private:
00482 Q_DECLARE_PRIVATE( LinkMovie )
00483 Q_DISABLE_COPY( LinkMovie )
00484 };
00485 #endif
00486
00487 }
00488
00489 #endif