1
///////////////////////////////////////////////////////////////////////////////
4
// Author: Ulrich Telle
7
// Copyright: (c) Ulrich Telle
8
// Licence: wxWindows licence
9
///////////////////////////////////////////////////////////////////////////////
11
/// \file pdflinks.h Interface of the wxPdfLink and wxPdfPageLink classes
17
#include <wx/string.h>
19
// wxPdfDocument headers
20
#include "wx/pdfdocdef.h"
22
/// Class representing internal or external links.
23
class WXDLLIMPEXP_PDFDOC wxPdfLink
26
/// Constructor for internal link
28
* Use this constructor to create an \b internal link reference.
29
* \see wxPdfDocument::Link(), wxPdfDocument::Write(), wxPdfDocument::Cell(), wxPdfDocument::ClippedCell(), wxPdfDocument::Image(), wxPdfDocument::RotatedImage()
31
wxPdfLink(int linkRef);
33
/// Constructor for external link
35
* Use this constructor to create an \b external link reference.
36
* \see wxPdfDocument::Link(), wxPdfDocument::Write(), wxPdfDocument::Cell(), wxPdfDocument::ClippedCell(), wxPdfDocument::Image(), wxPdfDocument::RotatedImage()
38
wxPdfLink(const wxString& linkURL);
41
wxPdfLink(const wxPdfLink& pdfLink);
46
/// Check whether this instance is a valid link reference
47
bool IsValid() const { return m_isValid; }
49
/// Check whether this instance is an internal reference
50
bool IsLinkRef() const { return m_isRef; }
52
/// Get the internal link reference
53
int GetLinkRef() const { return m_linkRef; }
55
/// Get the external link reference
56
const wxString GetLinkURL() const { return m_linkURL; }
58
/// Set page number and position on page
59
void SetLink(int page, double ypos) { m_page = page; m_ypos = ypos; }
61
/// Get the page this link refers to
62
int GetPage() { return m_page; }
64
/// Get the page position this link refers to
65
double GetPosition() { return m_ypos; }
68
bool m_isValid; ///< Flag whether this instance is valid
69
bool m_isRef; ///< Flag whether this is an internal link reference
70
int m_linkRef; ///< Internal link reference
71
wxString m_linkURL; ///< External link reference
72
int m_page; ///< Page number this link refers to
73
double m_ypos; ///< Position on page this link refers to
76
/// Class representing the sensitive area of links referring to a page. (For internal use only)
77
class WXDLLIMPEXP_PDFDOC wxPdfPageLink : public wxPdfLink
81
wxPdfPageLink(double x, double y, double w, double h, const wxPdfLink& pdfLink);
84
virtual ~wxPdfPageLink();
87
double GetX() { return m_x; }
90
double GetY() { return m_y; }
93
double GetWidth() { return m_w; }
96
double GetHeight() { return m_h; }
99
double m_x; ///< X offset of sensitive area
100
double m_y; ///< Y offset of sensitive area
101
double m_w; ///< Width of sensitive area
102
double m_h; ///< Height of sensitive area