Link.h 15 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2 3 4 5 6 7 8
//========================================================================
//
// Link.h
//
// Copyright 1996-2003 Glyph & Cog, LLC
//
//========================================================================

9 10 11 12
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
13 14 15
// All changes made under the Poppler project to this file are licensed
// under GPL version 2 or later
//
16 17
// Copyright (C) 2006, 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
Albert Astals Cid's avatar
Albert Astals Cid committed
18
// Copyright (C) 2010, 2011 Carlos Garcia Campos <carlosgc@gnome.org>
19
// Copyright (C) 2012 Tobias Koening <tobias.koenig@kdab.com>
20
// Copyright (C) 2018 Albert Astals Cid <aacid@kde.org>
Albert Astals Cid's avatar
Albert Astals Cid committed
21
// Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
22
// Copyright (C) 2018 Intevation GmbH <intevation@intevation.de>
23 24 25 26 27 28
//
// 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
//
//========================================================================

Kristian Høgsberg's avatar
Kristian Høgsberg committed
29 30 31 32 33 34 35 36
#ifndef LINK_H
#define LINK_H

#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif

#include "Object.h"
37
#include <memory>
38
#include <set>
Kristian Høgsberg's avatar
Kristian Høgsberg committed
39 40

class GooString;
41
class GooList;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
42 43
class Array;
class Dict;
44
class Sound;
45
class MediaRendition;
46 47
class AnnotLink;
class Annots;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
48 49 50 51 52 53 54 55 56 57 58 59

//------------------------------------------------------------------------
// LinkAction
//------------------------------------------------------------------------

enum LinkActionKind {
  actionGoTo,			// go to destination
  actionGoToR,			// go to destination in new file
  actionLaunch,			// launch app (or open document)
  actionURI,			// URI
  actionNamed,			// named action
  actionMovie,			// movie action
60
  actionRendition,		// rendition action
61
  actionSound,			// sound action
62
  actionJavaScript,		// JavaScript action
63
  actionOCGState,               // Set-OCG-State action
64
  actionHide,			// Hide action
Kristian Høgsberg's avatar
Kristian Høgsberg committed
65 66 67 68 69 70
  actionUnknown			// anything else
};

class LinkAction {
public:

71
  LinkAction();
72 73 74
  LinkAction(const LinkAction &) = delete;
  LinkAction& operator=(const LinkAction &other) = delete;

Kristian Høgsberg's avatar
Kristian Høgsberg committed
75
  // Destructor.
76
  virtual ~LinkAction();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
77 78

  // Was the LinkAction created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
79
  virtual GBool isOk() const = 0;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
80 81

  // Check link action type.
Albert Astals Cid's avatar
Albert Astals Cid committed
82
  virtual LinkActionKind getKind() const = 0;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
83 84

  // Parse a destination (old-style action) name, string, or array.
Albert Astals Cid's avatar
Albert Astals Cid committed
85
  static LinkAction *parseDest(const Object *obj);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
86 87

  // Parse an action dictionary.
88
  static LinkAction *parseAction(const Object *obj, const GooString *baseURI = nullptr);
89 90 91 92 93 94 95 96 97

  // A List of the next actions to execute in order.
  // The list contains pointer to LinkAction objects.
  const GooList *nextActions() const;

  // Sets the next action list. Takes ownership of the actions.
  void setNextActions(GooList *actions);

private:
98 99
  static LinkAction *parseAction(const Object *obj, const GooString *baseURI, std::set<int> *seenNextActions);

100
  GooList *nextActionList;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
};

//------------------------------------------------------------------------
// LinkDest
//------------------------------------------------------------------------

enum LinkDestKind {
  destXYZ,
  destFit,
  destFitH,
  destFitV,
  destFitR,
  destFitB,
  destFitBH,
  destFitBV
};

class LinkDest {
public:

  // Build a LinkDest from the array.
Albert Astals Cid's avatar
Albert Astals Cid committed
122
  LinkDest(const Array *a);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
123 124

  // Copy a LinkDest.
Albert Astals Cid's avatar
Albert Astals Cid committed
125
  LinkDest *copy() const { return new LinkDest(this); }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
126 127

  // Was the LinkDest created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
128
  GBool isOk() const { return ok; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
129 130

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
131 132 133 134 135 136 137 138 139 140 141 142
  LinkDestKind getKind() const { return kind; }
  GBool isPageRef() const { return pageIsRef; }
  int getPageNum() const { return pageNum; }
  Ref getPageRef() const { return pageRef; }
  double getLeft() const { return left; }
  double getBottom() const { return bottom; }
  double getRight() const { return right; }
  double getTop() const { return top; }
  double getZoom() const { return zoom; }
  GBool getChangeLeft() const { return changeLeft; }
  GBool getChangeTop() const { return changeTop; }
  GBool getChangeZoom() const { return changeZoom; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
143 144 145 146 147 148 149 150 151 152 153 154

private:

  LinkDestKind kind;		// destination type
  GBool pageIsRef;		// is the page a reference or number?
  union {
    Ref pageRef;		// reference to page
    int pageNum;		// one-relative page number
  };
  double left, bottom;		// position
  double right, top;
  double zoom;			// zoom factor
155 156 157 158
  GBool changeLeft, changeTop;	// which position components to change:
  GBool changeZoom;		//   destXYZ uses all three;
				//   destFitH/BH use changeTop;
				//   destFitV/BV use changeLeft
Kristian Høgsberg's avatar
Kristian Høgsberg committed
159 160
  GBool ok;			// set if created successfully

Albert Astals Cid's avatar
Albert Astals Cid committed
161
  LinkDest(const LinkDest *dest);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
162 163 164 165 166 167 168 169 170 171
};

//------------------------------------------------------------------------
// LinkGoTo
//------------------------------------------------------------------------

class LinkGoTo: public LinkAction {
public:

  // Build a LinkGoTo from a destination (dictionary, name, or string).
Albert Astals Cid's avatar
Albert Astals Cid committed
172
  LinkGoTo(const Object *destObj);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
173 174

  // Destructor.
Albert Astals Cid's avatar
Albert Astals Cid committed
175
  ~LinkGoTo();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
176 177

  // Was the LinkGoTo created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
178
  GBool isOk() const override { return dest || namedDest; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
179 180

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
181 182
  LinkActionKind getKind() const override { return actionGoTo; }
  const LinkDest *getDest() const { return dest; }
Albert Astals Cid's avatar
Albert Astals Cid committed
183
  const GooString *getNamedDest() const { return namedDest; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
184 185 186 187 188

private:

  LinkDest *dest;		// regular destination (NULL for remote
				//   link with bad destination)
189
  GooString *namedDest;	// named destination (only one of dest and
Kristian Høgsberg's avatar
Kristian Høgsberg committed
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
				//   and namedDest may be non-NULL)
};

//------------------------------------------------------------------------
// LinkGoToR
//------------------------------------------------------------------------

class LinkGoToR: public LinkAction {
public:

  // Build a LinkGoToR from a file spec (dictionary) and destination
  // (dictionary, name, or string).
  LinkGoToR(Object *fileSpecObj, Object *destObj);

  // Destructor.
Albert Astals Cid's avatar
Albert Astals Cid committed
205
  ~LinkGoToR();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
206 207

  // Was the LinkGoToR created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
208
  GBool isOk() const override { return fileName && (dest || namedDest); }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
209 210

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
211
  LinkActionKind getKind() const override { return actionGoToR; }
Albert Astals Cid's avatar
Albert Astals Cid committed
212
  const GooString *getFileName() const { return fileName; }
Albert Astals Cid's avatar
Albert Astals Cid committed
213
  const LinkDest *getDest() const { return dest; }
Albert Astals Cid's avatar
Albert Astals Cid committed
214
  const GooString *getNamedDest() const { return namedDest; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
215 216 217 218 219 220

private:

  GooString *fileName;		// file name
  LinkDest *dest;		// regular destination (NULL for remote
				//   link with bad destination)
221
  GooString *namedDest;	// named destination (only one of dest and
Kristian Høgsberg's avatar
Kristian Høgsberg committed
222 223 224 225 226 227 228 229 230 231 232
				//   and namedDest may be non-NULL)
};

//------------------------------------------------------------------------
// LinkLaunch
//------------------------------------------------------------------------

class LinkLaunch: public LinkAction {
public:

  // Build a LinkLaunch from an action dictionary.
Albert Astals Cid's avatar
Albert Astals Cid committed
233
  LinkLaunch(const Object *actionObj);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
234 235

  // Destructor.
Albert Astals Cid's avatar
Albert Astals Cid committed
236
  ~LinkLaunch();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
237 238

  // Was the LinkLaunch created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
239
  GBool isOk() const override { return fileName != NULL; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
240 241

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
242
  LinkActionKind getKind() const override { return actionLaunch; }
Albert Astals Cid's avatar
Albert Astals Cid committed
243 244
  const GooString *getFileName() const { return fileName; }
  const GooString *getParams() const { return params; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
245 246 247 248 249 250 251 252 253 254 255 256 257 258 259

private:

  GooString *fileName;		// file name
  GooString *params;		// parameters
};

//------------------------------------------------------------------------
// LinkURI
//------------------------------------------------------------------------

class LinkURI: public LinkAction {
public:

  // Build a LinkURI given the URI (string) and base URI.
Albert Astals Cid's avatar
Albert Astals Cid committed
260
  LinkURI(const Object *uriObj, const GooString *baseURI);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
261 262

  // Destructor.
Albert Astals Cid's avatar
Albert Astals Cid committed
263
  ~LinkURI();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
264 265

  // Was the LinkURI created successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
266
  GBool isOk() const override { return uri != NULL; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
267 268

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
269
  LinkActionKind getKind() const override { return actionURI; }
Albert Astals Cid's avatar
Albert Astals Cid committed
270
  const GooString *getURI() const { return uri; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
271 272 273 274 275 276 277 278 279 280 281 282 283 284

private:

  GooString *uri;			// the URI
};

//------------------------------------------------------------------------
// LinkNamed
//------------------------------------------------------------------------

class LinkNamed: public LinkAction {
public:

  // Build a LinkNamed given the action name.
Albert Astals Cid's avatar
Albert Astals Cid committed
285
  LinkNamed(const Object *nameObj);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
286

Albert Astals Cid's avatar
Albert Astals Cid committed
287
  ~LinkNamed();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
288

Albert Astals Cid's avatar
Albert Astals Cid committed
289
  GBool isOk() const override { return name != NULL; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
290

Albert Astals Cid's avatar
Albert Astals Cid committed
291
  LinkActionKind getKind() const override { return actionNamed; }
Albert Astals Cid's avatar
Albert Astals Cid committed
292
  const GooString *getName() const { return name; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
293 294 295 296 297 298

private:

  GooString *name;
};

Hugo Mercier's avatar
Hugo Mercier committed
299

Kristian Høgsberg's avatar
Kristian Høgsberg committed
300 301 302 303 304 305 306
//------------------------------------------------------------------------
// LinkMovie
//------------------------------------------------------------------------

class LinkMovie: public LinkAction {
public:

Hugo Mercier's avatar
Hugo Mercier committed
307 308 309 310 311 312
  enum OperationType {
    operationTypePlay,
    operationTypePause,
    operationTypeResume,
    operationTypeStop
  };
Kristian Høgsberg's avatar
Kristian Høgsberg committed
313

Albert Astals Cid's avatar
Albert Astals Cid committed
314
  LinkMovie(const Object *obj);
Albert Astals Cid's avatar
Albert Astals Cid committed
315
  ~LinkMovie();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
316

Albert Astals Cid's avatar
Albert Astals Cid committed
317 318
  GBool isOk() const override { return annotRef.num >= 0 || annotTitle != NULL; }
  LinkActionKind getKind() const override { return actionMovie; }
Hugo Mercier's avatar
Hugo Mercier committed
319 320 321 322

  // a movie action stores either an indirect reference to a movie annotation
  // or the movie annotation title

Albert Astals Cid's avatar
Albert Astals Cid committed
323 324 325
  GBool hasAnnotRef() const { return annotRef.num >= 0; }
  GBool hasAnnotTitle() const { return annotTitle != NULL; }
  const Ref *getAnnotRef() const { return &annotRef; }
Albert Astals Cid's avatar
Albert Astals Cid committed
326
  const GooString *getAnnotTitle() const { return annotTitle; }
Hugo Mercier's avatar
Hugo Mercier committed
327

Albert Astals Cid's avatar
Albert Astals Cid committed
328
  OperationType getOperation() const { return operation; }
Hugo Mercier's avatar
Hugo Mercier committed
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344

private:

  Ref annotRef;            // Annotation
  GooString *annotTitle;   // T

  OperationType operation; // Operation
};


//------------------------------------------------------------------------
// LinkRendition
//------------------------------------------------------------------------

class LinkRendition: public LinkAction {
public:
345 346 347 348 349 350 351 352 353 354
  /**
   * Describes the possible rendition operations.
   */
  enum RenditionOperation {
    NoRendition,
    PlayRendition,
    StopRendition,
    PauseRendition,
    ResumeRendition
  };
Hugo Mercier's avatar
Hugo Mercier committed
355

Albert Astals Cid's avatar
Albert Astals Cid committed
356
  LinkRendition(const Object *Obj);
Hugo Mercier's avatar
Hugo Mercier committed
357

Albert Astals Cid's avatar
Albert Astals Cid committed
358
  ~LinkRendition();
Hugo Mercier's avatar
Hugo Mercier committed
359

Albert Astals Cid's avatar
Albert Astals Cid committed
360
  GBool isOk() const override { return true; }
Hugo Mercier's avatar
Hugo Mercier committed
361

Albert Astals Cid's avatar
Albert Astals Cid committed
362
  LinkActionKind getKind() const override { return actionRendition; }
Hugo Mercier's avatar
Hugo Mercier committed
363

Albert Astals Cid's avatar
Albert Astals Cid committed
364 365
  GBool hasRenditionObject() const { return renditionObj.isDict(); }
  const Object* getRenditionObject() const { return &renditionObj; }
Hugo Mercier's avatar
Hugo Mercier committed
366

Albert Astals Cid's avatar
Albert Astals Cid committed
367 368
  GBool hasScreenAnnot() const { return screenRef.isRef(); }
  Ref getScreenAnnot() const { return screenRef.getRef(); }
Hugo Mercier's avatar
Hugo Mercier committed
369

Albert Astals Cid's avatar
Albert Astals Cid committed
370
  RenditionOperation getOperation() const { return operation; }
Hugo Mercier's avatar
Hugo Mercier committed
371

Albert Astals Cid's avatar
Albert Astals Cid committed
372
  const MediaRendition* getMedia() const { return media; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
373

Albert Astals Cid's avatar
Albert Astals Cid committed
374
  const GooString *getScript() const { return js; }
375

Kristian Høgsberg's avatar
Kristian Høgsberg committed
376 377
private:

378
  Object screenRef;
Hugo Mercier's avatar
Hugo Mercier committed
379
  Object renditionObj;
380
  RenditionOperation operation;
Hugo Mercier's avatar
Hugo Mercier committed
381

382
  MediaRendition* media;
383 384

  GooString *js;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
385 386
};

387 388 389 390 391 392 393
//------------------------------------------------------------------------
// LinkSound
//------------------------------------------------------------------------

class LinkSound: public LinkAction {
public:

Albert Astals Cid's avatar
Albert Astals Cid committed
394
  LinkSound(const Object *soundObj);
395

Albert Astals Cid's avatar
Albert Astals Cid committed
396
  ~LinkSound();
397

Albert Astals Cid's avatar
Albert Astals Cid committed
398
  GBool isOk() const override { return sound != NULL; }
399

Albert Astals Cid's avatar
Albert Astals Cid committed
400
  LinkActionKind getKind() const override { return actionSound; }
401

Albert Astals Cid's avatar
Albert Astals Cid committed
402 403 404 405 406
  double getVolume() const { return volume; }
  GBool getSynchronous() const { return sync; }
  GBool getRepeat() const { return repeat; }
  GBool getMix() const { return mix; }
  Sound *getSound() const { return sound; }
407 408 409 410 411 412 413 414 415 416

private:

  double volume;
  GBool sync;
  GBool repeat;
  GBool mix;
  Sound *sound;
};

417 418 419 420 421 422 423 424 425 426
//------------------------------------------------------------------------
// LinkJavaScript
//------------------------------------------------------------------------

class LinkJavaScript: public LinkAction {
public:

  // Build a LinkJavaScript given the action name.
  LinkJavaScript(Object *jsObj);

Albert Astals Cid's avatar
Albert Astals Cid committed
427
  ~LinkJavaScript();
428

Albert Astals Cid's avatar
Albert Astals Cid committed
429
  GBool isOk() const override { return js != NULL; }
430

Albert Astals Cid's avatar
Albert Astals Cid committed
431
  LinkActionKind getKind() const override { return actionJavaScript; }
Albert Astals Cid's avatar
Albert Astals Cid committed
432
  const GooString *getScript() const { return js; }
433 434 435 436 437 438

private:

  GooString *js;
};

439 440 441 442 443
//------------------------------------------------------------------------
// LinkOCGState
//------------------------------------------------------------------------
class LinkOCGState: public LinkAction {
public:
Albert Astals Cid's avatar
Albert Astals Cid committed
444
  LinkOCGState(const Object *obj);
445

Albert Astals Cid's avatar
Albert Astals Cid committed
446
  ~LinkOCGState();
447

Albert Astals Cid's avatar
Albert Astals Cid committed
448
  GBool isOk() const override { return stateList != NULL; }
449

Albert Astals Cid's avatar
Albert Astals Cid committed
450
  LinkActionKind getKind() const override { return actionOCGState; }
451 452 453

  enum State { On, Off, Toggle};
  struct StateList {
Albert Astals Cid's avatar
Albert Astals Cid committed
454
    StateList() { list = nullptr; }
455
    ~StateList();
456 457
    StateList(const StateList &) = delete;
    StateList& operator=(const StateList &) = delete;
458 459 460 461
    State st;
    GooList *list;
  };

Albert Astals Cid's avatar
Albert Astals Cid committed
462 463
  const GooList *getStateList() const { return stateList; }
  GBool getPreserveRB() const { return preserveRB; }
464 465 466 467 468 469

private:
  GooList *stateList;
  GBool preserveRB;
};

470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
//------------------------------------------------------------------------
// LinkHide
//------------------------------------------------------------------------

class LinkHide: public LinkAction {
public:
  LinkHide(const Object *hideObj);

  ~LinkHide();

  GBool isOk() const override { return targetName != nullptr; }
  LinkActionKind getKind() const override { return actionHide; }

  // According to spec the target can be either:
  // a) A text string containing the fully qualified name of the target
  //    field.
  // b) An indirect reference to an annotation dictionary.
  // c) An array of "such dictionaries or text strings".
  //
  // While b / c appear to be very uncommon and can't easily be
  // created with Adobe Acrobat DC. So only support hide
  // actions with named targets (yet).
  GBool hasTargetName() const { return targetName != nullptr; }
  const GooString *getTargetName() const { return targetName; }

  // Should this action show or hide.
  GBool isShowAction() const { return show; }

private:
  GooString *targetName;
  GBool show;
};

Kristian Høgsberg's avatar
Kristian Høgsberg committed
503 504 505 506 507 508 509 510
//------------------------------------------------------------------------
// LinkUnknown
//------------------------------------------------------------------------

class LinkUnknown: public LinkAction {
public:

  // Build a LinkUnknown with the specified action type.
511
  LinkUnknown(const char *actionA);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
512 513

  // Destructor.
Albert Astals Cid's avatar
Albert Astals Cid committed
514
  ~LinkUnknown();
Kristian Høgsberg's avatar
Kristian Høgsberg committed
515 516

  // Was the LinkUnknown create successfully?
Albert Astals Cid's avatar
Albert Astals Cid committed
517
  GBool isOk() const override { return action != NULL; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
518 519

  // Accessors.
Albert Astals Cid's avatar
Albert Astals Cid committed
520
  LinkActionKind getKind() const override { return actionUnknown; }
Albert Astals Cid's avatar
Albert Astals Cid committed
521
  const GooString *getAction() const { return action; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
522 523 524 525 526 527 528 529 530 531 532 533 534 535

private:

  GooString *action;		// action subtype
};

//------------------------------------------------------------------------
// Links
//------------------------------------------------------------------------

class Links {
public:

  // Extract links from array of annotations.
536
  Links(Annots *annots);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
537 538 539 540

  // Destructor.
  ~Links();

541 542 543
  Links(const Links &) = delete;
  Links& operator=(const Links &) = delete;

Kristian Høgsberg's avatar
Kristian Høgsberg committed
544 545
  // Iterate through list of links.
  int getNumLinks() const { return numLinks; }
546
  AnnotLink *getLink(int i) const { return links[i]; }
Kristian Høgsberg's avatar
Kristian Høgsberg committed
547 548 549 550 551 552 553 554 555 556

  // If point <x>,<y> is in a link, return the associated action;
  // else return NULL.
  LinkAction *find(double x, double y) const;

  // Return true if <x>,<y> is in a link.
  GBool onLink(double x, double y) const;

private:

557
  AnnotLink **links;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
558 559 560 561
  int numLinks;
};

#endif