Initial revision
[swftools.git] / pdf2swf / xpdf / FormWidget.h
1 //========================================================================
2 //
3 // FormWidget.h
4 //
5 // Copyright 2000 Derek B. Noonburg
6 //
7 //========================================================================
8
9 #ifndef FORMWIDGET_H
10 #define FORMWIDGET_H
11
12 #ifdef __GNUC__
13 #pragma interface
14 #endif
15
16 class Gfx;
17
18 //------------------------------------------------------------------------
19 // FormWidget
20 //------------------------------------------------------------------------
21
22 class FormWidget {
23 public:
24
25   FormWidget(Dict *dict);
26   ~FormWidget();
27   GBool isOk() { return ok; }
28
29   void draw(Gfx *gfx);
30
31   // Get appearance object.
32   Object *getAppearance(Object *obj) { return appearance.fetch(obj); }
33
34 private:
35
36   Object appearance;            // a reference to the Form XObject stream
37                                 //   for the normal appearance
38   double xMin, yMin,            // widget rectangle
39          xMax, yMax;
40   GBool ok;
41 };
42
43 //------------------------------------------------------------------------
44 // FormWidgets
45 //------------------------------------------------------------------------
46
47 class FormWidgets {
48 public:
49
50   // Extract widgets from array of annotations.
51   FormWidgets(Object *annots);
52
53   ~FormWidgets();
54
55   // Iterate through list of widgets.
56   int getNumWidgets() { return nWidgets; }
57   FormWidget *getWidget(int i) { return widgets[i]; }
58
59 private:
60
61   FormWidget **widgets;
62   int nWidgets;
63 };
64
65 #endif