1 //========================================================================
2 //
3 // This file comes from pdftohtml project
4 // http://pdftohtml.sourceforge.net
5 //
6 // Copyright from:
7 // Gueorgui Ovtcharov
8 // Rainer Dorsch <http://www.ra.informatik.uni-stuttgart.de/~rainer/>
9 // Mikhail Kruk <meshko@cs.brandeis.edu>
10 //
11 //========================================================================
12 
13 //========================================================================
14 //
15 // Modified under the Poppler project - http://poppler.freedesktop.org
16 //
17 // All changes made under the Poppler project to this file are licensed
18 // under GPL version 2 or later
19 //
20 // Copyright (C) 2010 Albert Astals Cid <aacid@kde.org>
21 //
22 // To see a description of the changes please see the Changelog file that
23 // came with your tarball or type make ChangeLog if you are building from git
24 //
25 //========================================================================
26 
27 #ifndef _HTML_LINKS
28 #define _HTML_LINKS
29 
30 #include <stdlib.h>
31 #include <string.h>
32 #include <vector>
33 #include "goo/GooString.h"
34 
35 class HtmlLink{
36 
37 private:
38   double Xmin;
39   double Ymin;
40   double Xmax;
41   double Ymax;
42   GooString* dest;
43 
44 public:
45   HtmlLink(const HtmlLink& x);
46   HtmlLink(double xmin,double ymin,double xmax,double ymax,GooString *_dest);
47   ~HtmlLink();
48   GBool isEqualDest(const HtmlLink& x) const;
getDest()49   GooString *getDest(){return new GooString(dest);}
getX1()50   double getX1() const {return Xmin;}
getX2()51   double getX2() const {return Xmax;}
getY1()52   double getY1() const {return Ymin;}
getY2()53   double getY2() const {return Ymax;}
54   GBool inLink(double xmin,double ymin,double xmax,double ymax) const ;
55   //GooString *Link(GooString *content);
56   GooString* getLinkStart();
57 
58 };
59 
60 class HtmlLinks{
61 private:
62  std::vector<HtmlLink> *accu;
63 public:
64  HtmlLinks();
65  ~HtmlLinks();
AddLink(const HtmlLink & x)66  void AddLink(const HtmlLink& x) {accu->push_back(x);}
67  GBool inLink(double xmin,double ymin,double xmax,double ymax,int& p) const;
68  HtmlLink* getLink(int i) const;
69 
70 };
71 
72 #endif
73 
74