Annot.h
1//========================================================================
2//
3// Annot.h
4//
5// Copyright 2000-2002 Glyph & Cog, LLC
6//
7//========================================================================
8
9#ifndef ANNOT_H
10#define ANNOT_H
11
12#include <aconf.h>
13
14#ifdef USE_GCC_PRAGMAS
15#pragma interface
16#endif
17
18class XRef;
19class Gfx;
20
21//------------------------------------------------------------------------
22// Annot
23//------------------------------------------------------------------------
24
25class Annot {
26public:
27
28 Annot(XRef *xrefA, Dict *dict);
29 ~Annot();
30 GBool isOk() { return ok; }
31
32 void draw(Gfx *gfx);
33
34 // Get appearance object.
35 Object *getAppearance(Object *obj) { return appearance.fetch(xref, obj); }
36
37private:
38
39 XRef *xref; // the xref table for this PDF file
40 Object appearance; // a reference to the Form XObject stream
41 // for the normal appearance
42 double xMin, yMin, // annotation rectangle
43 xMax, yMax;
44 GBool ok;
45};
46
47//------------------------------------------------------------------------
48// Annots
49//------------------------------------------------------------------------
50
51class Annots {
52public:
53
54 // Extract non-link annotations from array of annotations.
55 Annots(XRef *xref, Object *annotsObj);
56
57 ~Annots();
58
59 // Iterate through list of annotations.
60 int getNumAnnots() { return nAnnots; }
61 Annot *getAnnot(int i) { return annots[i]; }
62
63private:
64
65 Annot **annots;
66 int nAnnots;
67};
68
69#endif