• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2013 Google Inc.
3 
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #include "SkPdfFDFFieldDictionary_autogen.h"
9 #include "SkPdfNativeDoc.h"
10 
Kids(SkPdfNativeDoc * doc)11 SkPdfArray* SkPdfFDFFieldDictionary::Kids(SkPdfNativeDoc* doc) {
12   SkPdfNativeObject* ret = get("Kids", "");
13   if (doc) {ret = doc->resolveReference(ret);}
14   if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
15   // TODO(edisonn): warn about missing default value for optional fields
16   return NULL;
17 }
18 
has_Kids() const19 bool SkPdfFDFFieldDictionary::has_Kids() const {
20   return get("Kids", "") != NULL;
21 }
22 
T(SkPdfNativeDoc * doc)23 SkString SkPdfFDFFieldDictionary::T(SkPdfNativeDoc* doc) {
24   SkPdfNativeObject* ret = get("T", "");
25   if (doc) {ret = doc->resolveReference(ret);}
26   if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
27   // TODO(edisonn): warn about missing required field, assert for known good pdfs
28   return SkString();
29 }
30 
has_T() const31 bool SkPdfFDFFieldDictionary::has_T() const {
32   return get("T", "") != NULL;
33 }
34 
V(SkPdfNativeDoc * doc)35 SkPdfNativeObject* SkPdfFDFFieldDictionary::V(SkPdfNativeDoc* doc) {
36   SkPdfNativeObject* ret = get("V", "");
37   if (doc) {ret = doc->resolveReference(ret);}
38   if ((ret != NULL && true) || (doc == NULL && ret != NULL && ret->isReference())) return ret;
39   // TODO(edisonn): warn about missing default value for optional fields
40   return NULL;
41 }
42 
has_V() const43 bool SkPdfFDFFieldDictionary::has_V() const {
44   return get("V", "") != NULL;
45 }
46 
Ff(SkPdfNativeDoc * doc)47 int64_t SkPdfFDFFieldDictionary::Ff(SkPdfNativeDoc* doc) {
48   SkPdfNativeObject* ret = get("Ff", "");
49   if (doc) {ret = doc->resolveReference(ret);}
50   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
51   // TODO(edisonn): warn about missing default value for optional fields
52   return 0;
53 }
54 
has_Ff() const55 bool SkPdfFDFFieldDictionary::has_Ff() const {
56   return get("Ff", "") != NULL;
57 }
58 
SetFf(SkPdfNativeDoc * doc)59 int64_t SkPdfFDFFieldDictionary::SetFf(SkPdfNativeDoc* doc) {
60   SkPdfNativeObject* ret = get("SetFf", "");
61   if (doc) {ret = doc->resolveReference(ret);}
62   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
63   // TODO(edisonn): warn about missing default value for optional fields
64   return 0;
65 }
66 
has_SetFf() const67 bool SkPdfFDFFieldDictionary::has_SetFf() const {
68   return get("SetFf", "") != NULL;
69 }
70 
ClrFf(SkPdfNativeDoc * doc)71 int64_t SkPdfFDFFieldDictionary::ClrFf(SkPdfNativeDoc* doc) {
72   SkPdfNativeObject* ret = get("ClrFf", "");
73   if (doc) {ret = doc->resolveReference(ret);}
74   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
75   // TODO(edisonn): warn about missing default value for optional fields
76   return 0;
77 }
78 
has_ClrFf() const79 bool SkPdfFDFFieldDictionary::has_ClrFf() const {
80   return get("ClrFf", "") != NULL;
81 }
82 
F(SkPdfNativeDoc * doc)83 int64_t SkPdfFDFFieldDictionary::F(SkPdfNativeDoc* doc) {
84   SkPdfNativeObject* ret = get("F", "");
85   if (doc) {ret = doc->resolveReference(ret);}
86   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
87   // TODO(edisonn): warn about missing default value for optional fields
88   return 0;
89 }
90 
has_F() const91 bool SkPdfFDFFieldDictionary::has_F() const {
92   return get("F", "") != NULL;
93 }
94 
SetF(SkPdfNativeDoc * doc)95 int64_t SkPdfFDFFieldDictionary::SetF(SkPdfNativeDoc* doc) {
96   SkPdfNativeObject* ret = get("SetF", "");
97   if (doc) {ret = doc->resolveReference(ret);}
98   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
99   // TODO(edisonn): warn about missing default value for optional fields
100   return 0;
101 }
102 
has_SetF() const103 bool SkPdfFDFFieldDictionary::has_SetF() const {
104   return get("SetF", "") != NULL;
105 }
106 
ClrF(SkPdfNativeDoc * doc)107 int64_t SkPdfFDFFieldDictionary::ClrF(SkPdfNativeDoc* doc) {
108   SkPdfNativeObject* ret = get("ClrF", "");
109   if (doc) {ret = doc->resolveReference(ret);}
110   if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->intValue();
111   // TODO(edisonn): warn about missing default value for optional fields
112   return 0;
113 }
114 
has_ClrF() const115 bool SkPdfFDFFieldDictionary::has_ClrF() const {
116   return get("ClrF", "") != NULL;
117 }
118 
AP(SkPdfNativeDoc * doc)119 SkPdfDictionary* SkPdfFDFFieldDictionary::AP(SkPdfNativeDoc* doc) {
120   SkPdfNativeObject* ret = get("AP", "");
121   if (doc) {ret = doc->resolveReference(ret);}
122   if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
123   // TODO(edisonn): warn about missing default value for optional fields
124   return NULL;
125 }
126 
has_AP() const127 bool SkPdfFDFFieldDictionary::has_AP() const {
128   return get("AP", "") != NULL;
129 }
130 
APRef(SkPdfNativeDoc * doc)131 SkPdfDictionary* SkPdfFDFFieldDictionary::APRef(SkPdfNativeDoc* doc) {
132   SkPdfNativeObject* ret = get("APRef", "");
133   if (doc) {ret = doc->resolveReference(ret);}
134   if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
135   // TODO(edisonn): warn about missing default value for optional fields
136   return NULL;
137 }
138 
has_APRef() const139 bool SkPdfFDFFieldDictionary::has_APRef() const {
140   return get("APRef", "") != NULL;
141 }
142 
IF(SkPdfNativeDoc * doc)143 SkPdfDictionary* SkPdfFDFFieldDictionary::IF(SkPdfNativeDoc* doc) {
144   SkPdfNativeObject* ret = get("IF", "");
145   if (doc) {ret = doc->resolveReference(ret);}
146   if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
147   // TODO(edisonn): warn about missing default value for optional fields
148   return NULL;
149 }
150 
has_IF() const151 bool SkPdfFDFFieldDictionary::has_IF() const {
152   return get("IF", "") != NULL;
153 }
154 
Opt(SkPdfNativeDoc * doc)155 SkPdfArray* SkPdfFDFFieldDictionary::Opt(SkPdfNativeDoc* doc) {
156   SkPdfNativeObject* ret = get("Opt", "");
157   if (doc) {ret = doc->resolveReference(ret);}
158   if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
159   // TODO(edisonn): warn about missing default value for optional fields
160   return NULL;
161 }
162 
has_Opt() const163 bool SkPdfFDFFieldDictionary::has_Opt() const {
164   return get("Opt", "") != NULL;
165 }
166 
A(SkPdfNativeDoc * doc)167 SkPdfDictionary* SkPdfFDFFieldDictionary::A(SkPdfNativeDoc* doc) {
168   SkPdfNativeObject* ret = get("A", "");
169   if (doc) {ret = doc->resolveReference(ret);}
170   if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
171   // TODO(edisonn): warn about missing default value for optional fields
172   return NULL;
173 }
174 
has_A() const175 bool SkPdfFDFFieldDictionary::has_A() const {
176   return get("A", "") != NULL;
177 }
178 
AA(SkPdfNativeDoc * doc)179 SkPdfDictionary* SkPdfFDFFieldDictionary::AA(SkPdfNativeDoc* doc) {
180   SkPdfNativeObject* ret = get("AA", "");
181   if (doc) {ret = doc->resolveReference(ret);}
182   if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
183   // TODO(edisonn): warn about missing default value for optional fields
184   return NULL;
185 }
186 
has_AA() const187 bool SkPdfFDFFieldDictionary::has_AA() const {
188   return get("AA", "") != NULL;
189 }
190