~efargaspro/+junk/codeblocks-16.01-release

« back to all changes in this revision

Viewing changes to src/plugins/contrib/source_exporter/wxPdfDocument/include/wx/pdflinks.h

  • Committer: damienlmoore at gmail
  • Date: 2016-02-02 02:43:22 UTC
  • Revision ID: damienlmoore@gmail.com-20160202024322-yql5qmtbwdyamdwd
Code::BlocksĀ 16.01

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
///////////////////////////////////////////////////////////////////////////////
 
2
// Name:        pdflinks.h
 
3
// Purpose:     
 
4
// Author:      Ulrich Telle
 
5
// Modified by:
 
6
// Created:     2009-06-24
 
7
// Copyright:   (c) Ulrich Telle
 
8
// Licence:     wxWindows licence
 
9
///////////////////////////////////////////////////////////////////////////////
 
10
 
 
11
/// \file pdflinks.h Interface of the wxPdfLink and wxPdfPageLink classes
 
12
 
 
13
#ifndef _PDF_LINKS_H_
 
14
#define _PDF_LINKS_H_
 
15
 
 
16
// wxWidgets headers
 
17
#include <wx/string.h>
 
18
 
 
19
// wxPdfDocument headers
 
20
#include "wx/pdfdocdef.h"
 
21
 
 
22
/// Class representing internal or external links.
 
23
class WXDLLIMPEXP_PDFDOC wxPdfLink
 
24
{
 
25
public:
 
26
  /// Constructor for internal link
 
27
  /**
 
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()
 
30
  */
 
31
  wxPdfLink(int linkRef);
 
32
 
 
33
  /// Constructor for external link
 
34
  /**
 
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()
 
37
  */
 
38
  wxPdfLink(const wxString& linkURL);
 
39
 
 
40
  /// Copy constructor
 
41
  wxPdfLink(const wxPdfLink& pdfLink);
 
42
 
 
43
  /// Destructor
 
44
  virtual ~wxPdfLink();
 
45
 
 
46
  /// Check whether this instance is a valid link reference
 
47
  bool  IsValid() const { return m_isValid; }
 
48
 
 
49
  /// Check whether this instance is an internal reference
 
50
  bool  IsLinkRef() const { return m_isRef; }
 
51
 
 
52
  /// Get the internal link reference
 
53
  int   GetLinkRef() const { return m_linkRef; }
 
54
 
 
55
  /// Get the external link reference
 
56
  const wxString GetLinkURL() const { return m_linkURL; }
 
57
 
 
58
  /// Set page number and position on page
 
59
  void   SetLink(int page, double ypos) { m_page = page; m_ypos = ypos; }
 
60
 
 
61
  /// Get the page this link refers to
 
62
  int    GetPage() { return m_page; }
 
63
 
 
64
  /// Get the page position this link refers to
 
65
  double GetPosition() { return m_ypos; }
 
66
 
 
67
private:
 
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
 
74
};
 
75
 
 
76
/// Class representing the sensitive area of links referring to a page. (For internal use only)
 
77
class WXDLLIMPEXP_PDFDOC wxPdfPageLink : public wxPdfLink
 
78
{
 
79
public:
 
80
  /// Constructor
 
81
  wxPdfPageLink(double x, double y, double w, double h, const wxPdfLink& pdfLink);
 
82
 
 
83
  /// Destructor
 
84
  virtual ~wxPdfPageLink();
 
85
 
 
86
  /// Get the X offset
 
87
  double GetX() { return m_x; }
 
88
 
 
89
  /// Get the Y offset
 
90
  double GetY() { return m_y; }
 
91
 
 
92
  /// Get the width
 
93
  double GetWidth() { return m_w; }
 
94
 
 
95
  /// Get the height
 
96
  double GetHeight() { return m_h; }
 
97
 
 
98
private:
 
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
 
103
};
 
104
 
 
105
#endif