]> www.fi.muni.cz Git - evince.git/blob - pdf/xpdf/Annot.h
New file with some random thoughts.
[evince.git] / pdf / xpdf / Annot.h
1 //========================================================================
2 //
3 // Annot.h
4 //
5 // Copyright 2000-2003 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
18 class XRef;
19 class Gfx;
20
21 //------------------------------------------------------------------------
22 // Annot
23 //------------------------------------------------------------------------
24
25 class Annot {
26 public:
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
37   // Get subtype object
38   Object *getSubtype(Object *obj) {return subtype.copy(obj); };
39
40   // Get dictionary
41   Dict *getDict() {return dict; };
42
43   // Get annot appearance ID
44   int getRefNum() {return appearance.getRefNum();};
45   int getRefGen() {return appearance.getRefGen();};
46   
47 private:
48
49   XRef *xref;                   // the xref table for this PDF file
50   Dict *dict;
51   Object subtype;
52   Object appearance;            // a reference to the Form XObject stream
53                                 //   for the normal appearance
54   double xMin, yMin,            // annotation rectangle
55          xMax, yMax;
56   GBool ok;
57 };
58
59 //------------------------------------------------------------------------
60 // Annots
61 //------------------------------------------------------------------------
62
63 class Annots {
64 public:
65
66   // Extract non-link annotations from array of annotations.
67   Annots(XRef *xref, Object *annotsObj);
68
69   ~Annots();
70
71   // Iterate through list of annotations.
72   int getNumAnnots() { return nAnnots; }
73   Annot *getAnnot(int i) { return annots[i]; }
74
75 private:
76
77   Annot **annots;
78   int nAnnots;
79 };
80
81 #endif