]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 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 <config.h> | |
13 | ||
14 | #ifdef USE_GCC_PRAGMAS | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | class XRef; | |
19 | class Catalog; | |
20 | class Gfx; | |
21 | ||
22 | //------------------------------------------------------------------------ | |
23 | // Annot | |
24 | //------------------------------------------------------------------------ | |
25 | ||
26 | class Annot { | |
27 | public: | |
28 | ||
29 | Annot(XRef *xrefA, Dict *acroForm, Dict *dict); | |
30 | ~Annot(); | |
31 | GBool isOk() { return ok; } | |
32 | ||
33 | void draw(Gfx *gfx); | |
34 | ||
35 | // Get appearance object. | |
36 | Object *getAppearance(Object *obj) { return appearance.fetch(xref, obj); } | |
37 | ||
38 | private: | |
39 | ||
40 | void generateAppearance(Dict *acroForm, Dict *dict); | |
41 | ||
42 | XRef *xref; // the xref table for this PDF file | |
43 | Object appearance; // a reference to the Form XObject stream | |
44 | // for the normal appearance | |
45 | GString *appearBuf; | |
46 | double xMin, yMin, // annotation rectangle | |
47 | xMax, yMax; | |
48 | GBool ok; | |
49 | }; | |
50 | ||
51 | //------------------------------------------------------------------------ | |
52 | // Annots | |
53 | //------------------------------------------------------------------------ | |
54 | ||
55 | class Annots { | |
56 | public: | |
57 | ||
58 | // Extract non-link annotations from array of annotations. | |
59 | Annots(XRef *xref, Catalog *catalog, Object *annotsObj); | |
60 | ||
61 | ~Annots(); | |
62 | ||
63 | // Iterate through list of annotations. | |
64 | int getNumAnnots() { return nAnnots; } | |
65 | Annot *getAnnot(int i) { return annots[i]; } | |
66 | ||
67 | private: | |
68 | ||
69 | Annot **annots; | |
70 | int nAnnots; | |
71 | }; | |
72 | ||
73 | #endif |