mupdf-qt  0.1
Qt5 interface of the popular PDF library MuPDF
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
mupdf-link.h
Go to the documentation of this file.
1 #ifndef MUPDF_LINK_H
2 #define MUPDF_LINK_H
3 
4 class QRectF;
5 class QString;
6 
7 namespace MuPDF
8 {
9 
10 class LinkPrivate;
11 
12 class Link
13 {
14 public:
15  enum LinkType
16  {
17  None = 0,
18  Goto,
19  URI,
23  };
24 
25  virtual ~Link();
26 
27  virtual LinkType linkType() const {return None;}
28  virtual QRectF linkArea() const;
29 
30 protected:
31  Link(LinkPrivate *linkp) : d(linkp) {}
32 
33  LinkPrivate *d;
34 
35 friend class OutlineItemPrivate;
36 };
37 
41 class LinkGoto : public Link
42 {
43 public:
44  LinkType linkType() const {return Goto;}
45  int page() const;
46  bool fitHorizontally() const;
47  bool fitVertically() const;
48  float zoom() const;
49 
50 protected:
51  LinkGoto(LinkPrivate *linkp) : Link(linkp) {}
52 
53 friend class OutlineItemPrivate;
54 };
55 
59 class LinkURI : public Link
60 {
61 public:
62  LinkType linkType() const {return URI;}
63  QString uri() const;
64  bool isMap() const;
65 
66 private:
67  LinkURI(LinkPrivate *linkp) : Link(linkp) {}
68 
69 friend class OutlineItemPrivate;
70 };
71 
75 class LinkLaunch : public Link
76 {
77 public:
78  LinkType linkType() const {return Launch;}
79  QString file() const;
80  bool newWindow() const;
81  bool isURI() const;
82 
83 private:
84  LinkLaunch(LinkPrivate *linkp) : Link(linkp) {}
85 
86 friend class OutlineItemPrivate;
87 };
88 
92 class LinkNamed : public Link
93 {
94 public:
95  LinkType linkType() const {return Named;}
96  QString named() const;
97 
98 private:
99  LinkNamed(LinkPrivate *linkp) : Link(linkp) {}
100 
101 friend class OutlineItemPrivate;
102 };
103 
107 class LinkGotoR : public LinkGoto
108 {
109 public:
110  LinkType linkType() const {return GotoR;}
111  int page() const;
112  QString destination() const;
113  QString file() const;
114  bool newWindow() const;
115 
116 private:
117  LinkGotoR(LinkPrivate *linkp) : LinkGoto(linkp) {}
118 
119 friend class OutlineItemPrivate;
120 };
121 
122 }
123 
124 #endif // end MUPDF_LINK_H