Annot.h 1.59 KB
Newer Older
Kristian Høgsberg's avatar
Kristian Høgsberg committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
//========================================================================
//
// Annot.h
//
// Copyright 2000-2003 Glyph & Cog, LLC
//
//========================================================================

#ifndef ANNOT_H
#define ANNOT_H

#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif

class XRef;
class Gfx;
18
class Catalog;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
19 20 21 22 23 24 25 26

//------------------------------------------------------------------------
// Annot
//------------------------------------------------------------------------

class Annot {
public:

27
  Annot(XRef *xrefA, Dict *acroForm, Dict *dict);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
28 29 30 31 32 33 34 35 36 37
  ~Annot();
  GBool isOk() { return ok; }

  void draw(Gfx *gfx);

  // Get appearance object.
  Object *getAppearance(Object *obj) { return appearance.fetch(xref, obj); }

private:

38
  void generateAppearance(Dict *acroForm, Dict *dict);
Albert Astals Cid's avatar
Albert Astals Cid committed
39
  void readArrayNum(Object *pdfArray, int key, double *value);
40

Kristian Høgsberg's avatar
Kristian Høgsberg committed
41 42 43
  XRef *xref;			// the xref table for this PDF file
  Object appearance;		// a reference to the Form XObject stream
				//   for the normal appearance
44
  GooString *appearBuf;
Kristian Høgsberg's avatar
Kristian Høgsberg committed
45 46 47 48 49 50 51 52 53 54 55 56 57
  double xMin, yMin,		// annotation rectangle
         xMax, yMax;
  GBool ok;
};

//------------------------------------------------------------------------
// Annots
//------------------------------------------------------------------------

class Annots {
public:

  // Extract non-link annotations from array of annotations.
58
  Annots(XRef *xref, Catalog *catalog, Object *annotsObj);
Kristian Høgsberg's avatar
Kristian Høgsberg committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72

  ~Annots();

  // Iterate through list of annotations.
  int getNumAnnots() { return nAnnots; }
  Annot *getAnnot(int i) { return annots[i]; }

private:

  Annot **annots;
  int nAnnots;
};

#endif