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 "SkPdfFileSpecificationDictionary_autogen.h"
9 #include "SkPdfNativeDoc.h"
10
Type(SkPdfNativeDoc * doc)11 SkString SkPdfFileSpecificationDictionary::Type(SkPdfNativeDoc* doc) {
12 SkPdfNativeObject* ret = get("Type", "");
13 if (doc) {ret = doc->resolveReference(ret);}
14 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
15 // TODO(edisonn): warn about missing default value for optional fields
16 return SkString();
17 }
18
has_Type() const19 bool SkPdfFileSpecificationDictionary::has_Type() const {
20 return get("Type", "") != NULL;
21 }
22
FS(SkPdfNativeDoc * doc)23 SkString SkPdfFileSpecificationDictionary::FS(SkPdfNativeDoc* doc) {
24 SkPdfNativeObject* ret = get("FS", "");
25 if (doc) {ret = doc->resolveReference(ret);}
26 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->nameValue2();
27 // TODO(edisonn): warn about missing default value for optional fields
28 return SkString();
29 }
30
has_FS() const31 bool SkPdfFileSpecificationDictionary::has_FS() const {
32 return get("FS", "") != NULL;
33 }
34
F(SkPdfNativeDoc * doc)35 SkString SkPdfFileSpecificationDictionary::F(SkPdfNativeDoc* doc) {
36 SkPdfNativeObject* ret = get("F", "");
37 if (doc) {ret = doc->resolveReference(ret);}
38 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
39 // TODO(edisonn): warn about missing default value for optional fields
40 return SkString();
41 }
42
has_F() const43 bool SkPdfFileSpecificationDictionary::has_F() const {
44 return get("F", "") != NULL;
45 }
46
DOS(SkPdfNativeDoc * doc)47 SkString SkPdfFileSpecificationDictionary::DOS(SkPdfNativeDoc* doc) {
48 SkPdfNativeObject* ret = get("DOS", "");
49 if (doc) {ret = doc->resolveReference(ret);}
50 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
51 // TODO(edisonn): warn about missing default value for optional fields
52 return SkString();
53 }
54
has_DOS() const55 bool SkPdfFileSpecificationDictionary::has_DOS() const {
56 return get("DOS", "") != NULL;
57 }
58
Mac(SkPdfNativeDoc * doc)59 SkString SkPdfFileSpecificationDictionary::Mac(SkPdfNativeDoc* doc) {
60 SkPdfNativeObject* ret = get("Mac", "");
61 if (doc) {ret = doc->resolveReference(ret);}
62 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
63 // TODO(edisonn): warn about missing default value for optional fields
64 return SkString();
65 }
66
has_Mac() const67 bool SkPdfFileSpecificationDictionary::has_Mac() const {
68 return get("Mac", "") != NULL;
69 }
70
Unix(SkPdfNativeDoc * doc)71 SkString SkPdfFileSpecificationDictionary::Unix(SkPdfNativeDoc* doc) {
72 SkPdfNativeObject* ret = get("Unix", "");
73 if (doc) {ret = doc->resolveReference(ret);}
74 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->stringValue2();
75 // TODO(edisonn): warn about missing default value for optional fields
76 return SkString();
77 }
78
has_Unix() const79 bool SkPdfFileSpecificationDictionary::has_Unix() const {
80 return get("Unix", "") != NULL;
81 }
82
ID(SkPdfNativeDoc * doc)83 SkPdfArray* SkPdfFileSpecificationDictionary::ID(SkPdfNativeDoc* doc) {
84 SkPdfNativeObject* ret = get("ID", "");
85 if (doc) {ret = doc->resolveReference(ret);}
86 if ((ret != NULL && ret->isArray()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfArray*)ret;
87 // TODO(edisonn): warn about missing default value for optional fields
88 return NULL;
89 }
90
has_ID() const91 bool SkPdfFileSpecificationDictionary::has_ID() const {
92 return get("ID", "") != NULL;
93 }
94
V(SkPdfNativeDoc * doc)95 bool SkPdfFileSpecificationDictionary::V(SkPdfNativeDoc* doc) {
96 SkPdfNativeObject* ret = get("V", "");
97 if (doc) {ret = doc->resolveReference(ret);}
98 if ((ret != NULL && ret->isBoolean()) || (doc == NULL && ret != NULL && ret->isReference())) return ret->boolValue();
99 // TODO(edisonn): warn about missing default value for optional fields
100 return false;
101 }
102
has_V() const103 bool SkPdfFileSpecificationDictionary::has_V() const {
104 return get("V", "") != NULL;
105 }
106
EF(SkPdfNativeDoc * doc)107 SkPdfDictionary* SkPdfFileSpecificationDictionary::EF(SkPdfNativeDoc* doc) {
108 SkPdfNativeObject* ret = get("EF", "");
109 if (doc) {ret = doc->resolveReference(ret);}
110 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret->isReference())) return (SkPdfDictionary*)ret;
111 // TODO(edisonn): warn about missing default value for optional fields
112 return NULL;
113 }
114
has_EF() const115 bool SkPdfFileSpecificationDictionary::has_EF() const {
116 return get("EF", "") != NULL;
117 }
118
RF(SkPdfNativeDoc * doc)119 SkPdfDictionary* SkPdfFileSpecificationDictionary::RF(SkPdfNativeDoc* doc) {
120 SkPdfNativeObject* ret = get("RF", "");
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_RF() const127 bool SkPdfFileSpecificationDictionary::has_RF() const {
128 return get("RF", "") != NULL;
129 }
130