aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/PdfViewer/pdfparser/native/pdfapi/SkPdfVariableTextFieldDictionary_autogen.cpp
blob: b2631527a55d57f6d5f1bfd38885592fd5b55202 (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
#include "SkPdfVariableTextFieldDictionary_autogen.h"


#include "SkPdfNativeDoc.h"
SkPdfDictionary* SkPdfVariableTextFieldDictionary::DR(SkPdfNativeDoc* doc) {
  SkPdfNativeObject* ret = get("DR", "");
  if (doc) {ret = doc->resolveReference(ret);}
  if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
  // TODO(edisonn): warn about missing required field, assert for known good pdfs
  return NULL;
}

bool SkPdfVariableTextFieldDictionary::has_DR() const {
  return get("DR", "") != NULL;
}

SkString SkPdfVariableTextFieldDictionary::DA(SkPdfNativeDoc* doc) {
  SkPdfNativeObject* ret = get("DA", "");
  if (doc) {ret = doc->resolveReference(ret);}
  if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
  // TODO(edisonn): warn about missing required field, assert for known good pdfs
  return SkString();
}

bool SkPdfVariableTextFieldDictionary::has_DA() const {
  return get("DA", "") != NULL;
}

int64_t SkPdfVariableTextFieldDictionary::Q(SkPdfNativeDoc* doc) {
  SkPdfNativeObject* ret = get("Q", "");
  if (doc) {ret = doc->resolveReference(ret);}
  if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
  // TODO(edisonn): warn about missing default value for optional fields
  return 0;
}

bool SkPdfVariableTextFieldDictionary::has_Q() const {
  return get("Q", "") != NULL;
}