mupdf-qt  0.1
Qt5 interface of the popular PDF library MuPDF
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
mupdf-link.cpp
Go to the documentation of this file.
1 #include "mupdf-link.h"
2 #include "mupdf-link_p.h"
3 extern "C" {
4 #include <mupdf/fitz.h>
5 }
6 #include <QRectF>
7 #include <QString>
8 
9 namespace MuPDF
10 {
11 
13 {
14  delete d;
15 }
16 
20 QRectF Link::linkArea() const
21 {
22  return QRectF(QPointF(d->link->rect.x0, d->link->rect.y0),
23  QPointF(d->link->rect.x1, d->link->rect.y1));
24 }
25 
29 int LinkGoto::page() const
30 {
31  return d->dest.ld.gotor.page;
32 }
33 
38 {
39  return d->dest.ld.gotor.flags & fz_link_flag_fit_h;
40 }
41 
46 {
47  return d->dest.ld.gotor.flags & fz_link_flag_fit_v;
48 }
49 
55 float LinkGoto::zoom() const
56 {
57  if (d->dest.ld.gotor.flags & fz_link_flag_r_is_zoom) {
58  return d->dest.ld.gotor.rb.x;
59  }
60 
61  return 0.0f;
62 }
63 
67 QString LinkURI::uri() const
68 {
69  return d->dest.ld.uri.uri;
70 }
71 
76 bool LinkURI::isMap() const
77 {
78  return d->dest.ld.uri.is_map;
79 }
80 
84 QString LinkLaunch::file() const
85 {
86  return d->dest.ld.launch.file_spec;
87 }
88 
93 {
94  return d->dest.ld.launch.new_window;
95 }
96 
100 bool LinkLaunch::isURI() const
101 {
102  return d->dest.ld.launch.is_uri;
103 }
104 
108 QString LinkNamed::named() const
109 {
110  return d->dest.ld.named.named;
111 }
112 
118 int LinkGotoR::page() const
119 {
120  return d->dest.ld.gotor.page;
121 }
122 
128 QString LinkGotoR::destination() const
129 {
130  return d->dest.ld.gotor.dest;
131 }
132 
137 QString LinkGotoR::file() const
138 {
139  return d->dest.ld.gotor.file_spec;
140 }
141 
146 {
147  return d->dest.ld.gotor.new_window;
148 }
149 
150 }