summaryrefslogtreecommitdiff
path: root/noncore/unsupported/qpdf/xpdf/FormWidget.h
blob: 7f07889b50220f51c6b47a211b0a687d4c6fdf52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//========================================================================
//
// FormWidget.h
//
// Copyright 2000 Derek B. Noonburg
//
//========================================================================

#ifndef FORMWIDGET_H
#define FORMWIDGET_H

#ifdef __GNUC__
#pragma interface
#endif

class XRef;
class Gfx;

//------------------------------------------------------------------------
// FormWidget
//------------------------------------------------------------------------

class FormWidget {
public:

  FormWidget(XRef *xrefA, Dict *dict);
  ~FormWidget();
  GBool isOk() { return ok; }

  void draw(Gfx *gfx);

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

private:

  XRef *xref;			// the xref table for this PDF file
  Object appearance;		// a reference to the Form XObject stream
				//   for the normal appearance
  fouble xMin, yMin,		// widget rectangle
         xMax, yMax;
  GBool ok;
};

//------------------------------------------------------------------------
// FormWidgets
//------------------------------------------------------------------------

class FormWidgets {
public:

  // Extract widgets from array of annotations.
  FormWidgets(XRef *xref, Object *annots);

  ~FormWidgets();

  // Iterate through list of widgets.
  int getNumWidgets() { return nWidgets; }
  FormWidget *getWidget(int i) { return widgets[i]; }

private:

  FormWidget **widgets;
  int nWidgets;
};

#endif