summaryrefslogtreecommitdiff
path: root/xpdf/Form.h
blob: 50c0f478a51bbd1ca0cb4ce1f2dca743d6726e00 (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
//========================================================================
//
// Form.h
//
// Copyright 2012 Glyph & Cog, LLC
//
//========================================================================

#ifndef FORM_H
#define FORM_H

#include <aconf.h>

#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif

#include "gtypes.h"

class Gfx;
class FormField;

//------------------------------------------------------------------------

class Form {
public:

  static Form *load(PDFDoc *docA, Catalog *catalog, Object *acroFormObj);

  virtual ~Form();

  virtual const char *getType() = 0;

  virtual void draw(int pageNum, Gfx *gfx, GBool printing) = 0;

  virtual int getNumFields() = 0;
  virtual FormField *getField(int idx) = 0;

protected:

  Form(PDFDoc *docA);

  PDFDoc *doc;
};

//------------------------------------------------------------------------

class FormField {
public:

  FormField();
  virtual ~FormField();

  virtual const char *getType() = 0;
  virtual Unicode *getName(int *length) = 0;
  virtual Unicode *getValue(int *length) = 0;

  // Return the resource dictionaries used to draw this field.  The
  // returned object must be either a dictionary or an array of
  // dictonaries.
  virtual Object *getResources(Object *res) = 0;
};

#endif