blob: e1358d4ce4879d56b5a8e17bd020d392062aad39 [file] [log] [blame]
// This file comes from pdftohtml project
// Copyright from:
// Gueorgui Ovtcharov
// Rainer Dorsch <>
// Mikhail Kruk <>
// Modified under the Poppler project -
// 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 <>
// 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 <stdlib.h>
#include <string.h>
#include <vector>
#include "goo/GooString.h"
class HtmlLink{
double Xmin;
double Ymin;
double Xmax;
double Ymax;
GooString* dest;
HtmlLink(const HtmlLink& x);
HtmlLink(double xmin,double ymin,double xmax,double ymax,GooString *_dest);
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{
std::vector<HtmlLink> *accu;
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;