Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: experimental/PdfViewer/pdfparser/native/pdfapi/SkPdfPageObjectDictionary_autogen.cpp

Issue 22900010: pdfviewer: check in pdfapi classes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #include "SkPdfPageObjectDictionary_autogen.h"
2
3
4 #include "SkPdfNativeDoc.h"
5 SkString SkPdfPageObjectDictionary::Type(SkPdfNativeDoc* doc) {
6 SkPdfNativeObject* ret = get("Type", "");
7 if (doc) {ret = doc->resolveReference(ret);}
8 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->nameValue2();
9 // TODO(edisonn): warn about missing required field, assert for known good pdf s
10 return SkString();
11 }
12
13 bool SkPdfPageObjectDictionary::has_Type() const {
14 return get("Type", "") != NULL;
15 }
16
17 SkPdfDictionary* SkPdfPageObjectDictionary::Parent(SkPdfNativeDoc* doc) {
18 SkPdfNativeObject* ret = get("Parent", "");
19 if (doc) {ret = doc->resolveReference(ret);}
20 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
21 // TODO(edisonn): warn about missing default value for optional fields
22 return NULL;
23 }
24
25 bool SkPdfPageObjectDictionary::has_Parent() const {
26 return get("Parent", "") != NULL;
27 }
28
29 SkPdfDate SkPdfPageObjectDictionary::LastModified(SkPdfNativeDoc* doc) {
30 SkPdfNativeObject* ret = get("LastModified", "");
31 if (doc) {ret = doc->resolveReference(ret);}
32 if ((ret != NULL && ret->isDate()) || (doc == NULL && ret != NULL && ret->isRe ference())) return ret->dateValue();
33 // TODO(edisonn): warn about missing default value for optional fields
34 return SkPdfDate();
35 }
36
37 bool SkPdfPageObjectDictionary::has_LastModified() const {
38 return get("LastModified", "") != NULL;
39 }
40
41 SkPdfResourceDictionary* SkPdfPageObjectDictionary::Resources(SkPdfNativeDoc* do c) {
42 SkPdfNativeObject* ret = get("Resources", "");
43 if (doc) {ret = doc->resolveReference(ret);}
44 if ((ret != NULL && ret->isDictionary() && ((SkPdfResourceDictionary*)ret)->va lid()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfResou rceDictionary*)ret;
45 // TODO(edisonn): warn about missing required field, assert for known good pdf s
46 return NULL;
47 }
48
49 bool SkPdfPageObjectDictionary::has_Resources() const {
50 return get("Resources", "") != NULL;
51 }
52
53 SkRect SkPdfPageObjectDictionary::MediaBox(SkPdfNativeDoc* doc) {
54 SkPdfNativeObject* ret = get("MediaBox", "");
55 if (doc) {ret = doc->resolveReference(ret);}
56 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
57 // TODO(edisonn): warn about missing required field, assert for known good pdf s
58 return SkRect::MakeEmpty();
59 }
60
61 bool SkPdfPageObjectDictionary::has_MediaBox() const {
62 return get("MediaBox", "") != NULL;
63 }
64
65 SkRect SkPdfPageObjectDictionary::CropBox(SkPdfNativeDoc* doc) {
66 SkPdfNativeObject* ret = get("CropBox", "");
67 if (doc) {ret = doc->resolveReference(ret);}
68 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
69 // TODO(edisonn): warn about missing default value for optional fields
70 return SkRect::MakeEmpty();
71 }
72
73 bool SkPdfPageObjectDictionary::has_CropBox() const {
74 return get("CropBox", "") != NULL;
75 }
76
77 SkRect SkPdfPageObjectDictionary::BleedBox(SkPdfNativeDoc* doc) {
78 SkPdfNativeObject* ret = get("BleedBox", "");
79 if (doc) {ret = doc->resolveReference(ret);}
80 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
81 // TODO(edisonn): warn about missing default value for optional fields
82 return SkRect::MakeEmpty();
83 }
84
85 bool SkPdfPageObjectDictionary::has_BleedBox() const {
86 return get("BleedBox", "") != NULL;
87 }
88
89 SkRect SkPdfPageObjectDictionary::TrimBox(SkPdfNativeDoc* doc) {
90 SkPdfNativeObject* ret = get("TrimBox", "");
91 if (doc) {ret = doc->resolveReference(ret);}
92 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
93 // TODO(edisonn): warn about missing default value for optional fields
94 return SkRect::MakeEmpty();
95 }
96
97 bool SkPdfPageObjectDictionary::has_TrimBox() const {
98 return get("TrimBox", "") != NULL;
99 }
100
101 SkRect SkPdfPageObjectDictionary::ArtBox(SkPdfNativeDoc* doc) {
102 SkPdfNativeObject* ret = get("ArtBox", "");
103 if (doc) {ret = doc->resolveReference(ret);}
104 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->rectangleValue();
105 // TODO(edisonn): warn about missing default value for optional fields
106 return SkRect::MakeEmpty();
107 }
108
109 bool SkPdfPageObjectDictionary::has_ArtBox() const {
110 return get("ArtBox", "") != NULL;
111 }
112
113 SkPdfDictionary* SkPdfPageObjectDictionary::BoxColorInfo(SkPdfNativeDoc* doc) {
114 SkPdfNativeObject* ret = get("BoxColorInfo", "");
115 if (doc) {ret = doc->resolveReference(ret);}
116 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
117 // TODO(edisonn): warn about missing default value for optional fields
118 return NULL;
119 }
120
121 bool SkPdfPageObjectDictionary::has_BoxColorInfo() const {
122 return get("BoxColorInfo", "") != NULL;
123 }
124
125 bool SkPdfPageObjectDictionary::isContentsAStream(SkPdfNativeDoc* doc) {
126 SkPdfNativeObject* ret = get("Contents", "");
127 if (doc) {ret = doc->resolveReference(ret);}
128 return ret != NULL && ret->hasStream();
129 }
130
131 SkPdfStream* SkPdfPageObjectDictionary::getContentsAsStream(SkPdfNativeDoc* doc) {
132 SkPdfNativeObject* ret = get("Contents", "");
133 if (doc) {ret = doc->resolveReference(ret);}
134 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->getStream();
135 // TODO(edisonn): warn about missing default value for optional fields
136 return NULL;
137 }
138
139 bool SkPdfPageObjectDictionary::isContentsAArray(SkPdfNativeDoc* doc) {
140 SkPdfNativeObject* ret = get("Contents", "");
141 if (doc) {ret = doc->resolveReference(ret);}
142 return ret != NULL && ret->isArray();
143 }
144
145 SkPdfArray* SkPdfPageObjectDictionary::getContentsAsArray(SkPdfNativeDoc* doc) {
146 SkPdfNativeObject* ret = get("Contents", "");
147 if (doc) {ret = doc->resolveReference(ret);}
148 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR eference())) return (SkPdfArray*)ret;
149 // TODO(edisonn): warn about missing default value for optional fields
150 return NULL;
151 }
152
153 bool SkPdfPageObjectDictionary::has_Contents() const {
154 return get("Contents", "") != NULL;
155 }
156
157 int64_t SkPdfPageObjectDictionary::Rotate(SkPdfNativeDoc* doc) {
158 SkPdfNativeObject* ret = get("Rotate", "");
159 if (doc) {ret = doc->resolveReference(ret);}
160 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->intValue();
161 // TODO(edisonn): warn about missing default value for optional fields
162 return 0;
163 }
164
165 bool SkPdfPageObjectDictionary::has_Rotate() const {
166 return get("Rotate", "") != NULL;
167 }
168
169 SkPdfTransparencyGroupDictionary* SkPdfPageObjectDictionary::Group(SkPdfNativeDo c* doc) {
170 SkPdfNativeObject* ret = get("Group", "");
171 if (doc) {ret = doc->resolveReference(ret);}
172 if ((ret != NULL && ret->isDictionary() && ((SkPdfTransparencyGroupDictionary* )ret)->valid()) || (doc == NULL && ret != NULL && ret->isReference())) return (S kPdfTransparencyGroupDictionary*)ret;
173 // TODO(edisonn): warn about missing default value for optional fields
174 return NULL;
175 }
176
177 bool SkPdfPageObjectDictionary::has_Group() const {
178 return get("Group", "") != NULL;
179 }
180
181 SkPdfStream* SkPdfPageObjectDictionary::Thumb(SkPdfNativeDoc* doc) {
182 SkPdfNativeObject* ret = get("Thumb", "");
183 if (doc) {ret = doc->resolveReference(ret);}
184 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->getStream();
185 // TODO(edisonn): warn about missing default value for optional fields
186 return NULL;
187 }
188
189 bool SkPdfPageObjectDictionary::has_Thumb() const {
190 return get("Thumb", "") != NULL;
191 }
192
193 SkPdfArray* SkPdfPageObjectDictionary::B(SkPdfNativeDoc* doc) {
194 SkPdfNativeObject* ret = get("B", "");
195 if (doc) {ret = doc->resolveReference(ret);}
196 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR eference())) return (SkPdfArray*)ret;
197 // TODO(edisonn): warn about missing default value for optional fields
198 return NULL;
199 }
200
201 bool SkPdfPageObjectDictionary::has_B() const {
202 return get("B", "") != NULL;
203 }
204
205 double SkPdfPageObjectDictionary::Dur(SkPdfNativeDoc* doc) {
206 SkPdfNativeObject* ret = get("Dur", "");
207 if (doc) {ret = doc->resolveReference(ret);}
208 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is Reference())) return ret->numberValue();
209 // TODO(edisonn): warn about missing default value for optional fields
210 return 0;
211 }
212
213 bool SkPdfPageObjectDictionary::has_Dur() const {
214 return get("Dur", "") != NULL;
215 }
216
217 SkPdfDictionary* SkPdfPageObjectDictionary::Trans(SkPdfNativeDoc* doc) {
218 SkPdfNativeObject* ret = get("Trans", "");
219 if (doc) {ret = doc->resolveReference(ret);}
220 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
221 // TODO(edisonn): warn about missing default value for optional fields
222 return NULL;
223 }
224
225 bool SkPdfPageObjectDictionary::has_Trans() const {
226 return get("Trans", "") != NULL;
227 }
228
229 SkPdfArray* SkPdfPageObjectDictionary::Annots(SkPdfNativeDoc* doc) {
230 SkPdfNativeObject* ret = get("Annots", "");
231 if (doc) {ret = doc->resolveReference(ret);}
232 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isR eference())) return (SkPdfArray*)ret;
233 // TODO(edisonn): warn about missing default value for optional fields
234 return NULL;
235 }
236
237 bool SkPdfPageObjectDictionary::has_Annots() const {
238 return get("Annots", "") != NULL;
239 }
240
241 SkPdfDictionary* SkPdfPageObjectDictionary::AA(SkPdfNativeDoc* doc) {
242 SkPdfNativeObject* ret = get("AA", "");
243 if (doc) {ret = doc->resolveReference(ret);}
244 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
245 // TODO(edisonn): warn about missing default value for optional fields
246 return NULL;
247 }
248
249 bool SkPdfPageObjectDictionary::has_AA() const {
250 return get("AA", "") != NULL;
251 }
252
253 SkPdfStream* SkPdfPageObjectDictionary::Metadata(SkPdfNativeDoc* doc) {
254 SkPdfNativeObject* ret = get("Metadata", "");
255 if (doc) {ret = doc->resolveReference(ret);}
256 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->getStream();
257 // TODO(edisonn): warn about missing default value for optional fields
258 return NULL;
259 }
260
261 bool SkPdfPageObjectDictionary::has_Metadata() const {
262 return get("Metadata", "") != NULL;
263 }
264
265 SkPdfDictionary* SkPdfPageObjectDictionary::PieceInfo(SkPdfNativeDoc* doc) {
266 SkPdfNativeObject* ret = get("PieceInfo", "");
267 if (doc) {ret = doc->resolveReference(ret);}
268 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
269 // TODO(edisonn): warn about missing default value for optional fields
270 return NULL;
271 }
272
273 bool SkPdfPageObjectDictionary::has_PieceInfo() const {
274 return get("PieceInfo", "") != NULL;
275 }
276
277 int64_t SkPdfPageObjectDictionary::StructParents(SkPdfNativeDoc* doc) {
278 SkPdfNativeObject* ret = get("StructParents", "");
279 if (doc) {ret = doc->resolveReference(ret);}
280 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i sReference())) return ret->intValue();
281 // TODO(edisonn): warn about missing default value for optional fields
282 return 0;
283 }
284
285 bool SkPdfPageObjectDictionary::has_StructParents() const {
286 return get("StructParents", "") != NULL;
287 }
288
289 SkString SkPdfPageObjectDictionary::ID(SkPdfNativeDoc* doc) {
290 SkPdfNativeObject* ret = get("ID", "");
291 if (doc) {ret = doc->resolveReference(ret);}
292 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret- >isReference())) return ret->stringValue2();
293 // TODO(edisonn): warn about missing default value for optional fields
294 return SkString();
295 }
296
297 bool SkPdfPageObjectDictionary::has_ID() const {
298 return get("ID", "") != NULL;
299 }
300
301 double SkPdfPageObjectDictionary::PZ(SkPdfNativeDoc* doc) {
302 SkPdfNativeObject* ret = get("PZ", "");
303 if (doc) {ret = doc->resolveReference(ret);}
304 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is Reference())) return ret->numberValue();
305 // TODO(edisonn): warn about missing default value for optional fields
306 return 0;
307 }
308
309 bool SkPdfPageObjectDictionary::has_PZ() const {
310 return get("PZ", "") != NULL;
311 }
312
313 SkPdfDictionary* SkPdfPageObjectDictionary::SeparationInfo(SkPdfNativeDoc* doc) {
314 SkPdfNativeObject* ret = get("SeparationInfo", "");
315 if (doc) {ret = doc->resolveReference(ret);}
316 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret ->isReference())) return (SkPdfDictionary*)ret;
317 // TODO(edisonn): warn about missing default value for optional fields
318 return NULL;
319 }
320
321 bool SkPdfPageObjectDictionary::has_SeparationInfo() const {
322 return get("SeparationInfo", "") != NULL;
323 }
324
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698