summaryrefslogtreecommitdiff
path: root/utils/HtmlLinks.h
blob: 78bbb11ec74171ccd389520d23c36abde78d2d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//========================================================================
//
// This file comes from pdftohtml project
// http://pdftohtml.sourceforge.net
//
// Copyright from:
// Gueorgui Ovtcharov
// Rainer Dorsch <http://www.ra.informatik.uni-stuttgart.de/~rainer/>
// Mikhail Kruk <meshko@cs.brandeis.edu>
//
//========================================================================

//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
// Copyright (C) 2010, 2018 Albert Astals Cid <aacid@kde.org>
//
// To see a description of the changes please see the Changelog file that
// came with your tarball or type make ChangeLog if you are building from git
//
//========================================================================

#ifndef _HTML_LINKS
#define _HTML_LINKS

#include <cstdlib>
#include <cstring>
#include <vector>
#include "goo/GooString.h"

class HtmlLink{

private:  
  double Xmin;
  double Ymin;
  double Xmax;
  double Ymax;
  GooString* dest;

public:
  HtmlLink(const HtmlLink& x);
  HtmlLink(double xmin,double ymin,double xmax,double ymax,GooString *_dest);
  ~HtmlLink();
  HtmlLink& operator=(const HtmlLink &) = delete;
  bool isEqualDest(const HtmlLink& x) const;
  GooString *getDest(){return new GooString(dest);}
  double getX1() const {return Xmin;}
  double getX2() const {return Xmax;}
  double getY1() const {return Ymin;}
  double getY2() const {return Ymax;}
  bool inLink(double xmin,double ymin,double xmax,double ymax) const ;
  //GooString *Link(GooString *content);
  GooString* getLinkStart();
  
};

class HtmlLinks{
private:
 std::vector<HtmlLink> *accu;
public:
 HtmlLinks();
 ~HtmlLinks();
 HtmlLinks(const HtmlLinks &) = delete;
 HtmlLinks& operator=(const HtmlLinks &) = delete;
 void AddLink(const HtmlLink& x) {accu->push_back(x);}
 bool inLink(double xmin,double ymin,double xmax,double ymax,int& p) const;
 HtmlLink* getLink(int i) const;

};

#endif