OLD | NEW |
| (Empty) |
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 "SkPdfBlockLevelStructureElementsDictionary_autogen.h" | |
9 #include "SkPdfNativeDoc.h" | |
10 | |
11 double SkPdfBlockLevelStructureElementsDictionary::SpaceBefore(SkPdfNativeDoc* d
oc) { | |
12 SkPdfNativeObject* ret = get("SpaceBefore", ""); | |
13 if (doc) {ret = doc->resolveReference(ret);} | |
14 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
15 // TODO(edisonn): warn about missing default value for optional fields | |
16 return 0; | |
17 } | |
18 | |
19 bool SkPdfBlockLevelStructureElementsDictionary::has_SpaceBefore() const { | |
20 return get("SpaceBefore", "") != NULL; | |
21 } | |
22 | |
23 double SkPdfBlockLevelStructureElementsDictionary::SpaceAfter(SkPdfNativeDoc* do
c) { | |
24 SkPdfNativeObject* ret = get("SpaceAfter", ""); | |
25 if (doc) {ret = doc->resolveReference(ret);} | |
26 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
27 // TODO(edisonn): warn about missing default value for optional fields | |
28 return 0; | |
29 } | |
30 | |
31 bool SkPdfBlockLevelStructureElementsDictionary::has_SpaceAfter() const { | |
32 return get("SpaceAfter", "") != NULL; | |
33 } | |
34 | |
35 double SkPdfBlockLevelStructureElementsDictionary::StartIndent(SkPdfNativeDoc* d
oc) { | |
36 SkPdfNativeObject* ret = get("StartIndent", ""); | |
37 if (doc) {ret = doc->resolveReference(ret);} | |
38 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
39 // TODO(edisonn): warn about missing default value for optional fields | |
40 return 0; | |
41 } | |
42 | |
43 bool SkPdfBlockLevelStructureElementsDictionary::has_StartIndent() const { | |
44 return get("StartIndent", "") != NULL; | |
45 } | |
46 | |
47 double SkPdfBlockLevelStructureElementsDictionary::EndIndent(SkPdfNativeDoc* doc
) { | |
48 SkPdfNativeObject* ret = get("EndIndent", ""); | |
49 if (doc) {ret = doc->resolveReference(ret);} | |
50 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
51 // TODO(edisonn): warn about missing default value for optional fields | |
52 return 0; | |
53 } | |
54 | |
55 bool SkPdfBlockLevelStructureElementsDictionary::has_EndIndent() const { | |
56 return get("EndIndent", "") != NULL; | |
57 } | |
58 | |
59 double SkPdfBlockLevelStructureElementsDictionary::TextIndent(SkPdfNativeDoc* do
c) { | |
60 SkPdfNativeObject* ret = get("TextIndent", ""); | |
61 if (doc) {ret = doc->resolveReference(ret);} | |
62 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
63 // TODO(edisonn): warn about missing default value for optional fields | |
64 return 0; | |
65 } | |
66 | |
67 bool SkPdfBlockLevelStructureElementsDictionary::has_TextIndent() const { | |
68 return get("TextIndent", "") != NULL; | |
69 } | |
70 | |
71 SkString SkPdfBlockLevelStructureElementsDictionary::TextAlign(SkPdfNativeDoc* d
oc) { | |
72 SkPdfNativeObject* ret = get("TextAlign", ""); | |
73 if (doc) {ret = doc->resolveReference(ret);} | |
74 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
75 // TODO(edisonn): warn about missing default value for optional fields | |
76 return SkString(); | |
77 } | |
78 | |
79 bool SkPdfBlockLevelStructureElementsDictionary::has_TextAlign() const { | |
80 return get("TextAlign", "") != NULL; | |
81 } | |
82 | |
83 SkRect SkPdfBlockLevelStructureElementsDictionary::BBox(SkPdfNativeDoc* doc) { | |
84 SkPdfNativeObject* ret = get("BBox", ""); | |
85 if (doc) {ret = doc->resolveReference(ret);} | |
86 if ((ret != NULL && ret->isRectangle()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->rectangleValue(); | |
87 // TODO(edisonn): warn about missing default value for optional fields | |
88 return SkRect::MakeEmpty(); | |
89 } | |
90 | |
91 bool SkPdfBlockLevelStructureElementsDictionary::has_BBox() const { | |
92 return get("BBox", "") != NULL; | |
93 } | |
94 | |
95 bool SkPdfBlockLevelStructureElementsDictionary::isWidthANumber(SkPdfNativeDoc*
doc) { | |
96 SkPdfNativeObject* ret = get("Width", ""); | |
97 if (doc) {ret = doc->resolveReference(ret);} | |
98 return ret != NULL && ret->isNumber(); | |
99 } | |
100 | |
101 double SkPdfBlockLevelStructureElementsDictionary::getWidthAsNumber(SkPdfNativeD
oc* doc) { | |
102 SkPdfNativeObject* ret = get("Width", ""); | |
103 if (doc) {ret = doc->resolveReference(ret);} | |
104 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
105 // TODO(edisonn): warn about missing default value for optional fields | |
106 return 0; | |
107 } | |
108 | |
109 bool SkPdfBlockLevelStructureElementsDictionary::isWidthAName(SkPdfNativeDoc* do
c) { | |
110 SkPdfNativeObject* ret = get("Width", ""); | |
111 if (doc) {ret = doc->resolveReference(ret);} | |
112 return ret != NULL && ret->isName(); | |
113 } | |
114 | |
115 SkString SkPdfBlockLevelStructureElementsDictionary::getWidthAsName(SkPdfNativeD
oc* doc) { | |
116 SkPdfNativeObject* ret = get("Width", ""); | |
117 if (doc) {ret = doc->resolveReference(ret);} | |
118 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
119 // TODO(edisonn): warn about missing default value for optional fields | |
120 return SkString(); | |
121 } | |
122 | |
123 bool SkPdfBlockLevelStructureElementsDictionary::has_Width() const { | |
124 return get("Width", "") != NULL; | |
125 } | |
126 | |
127 bool SkPdfBlockLevelStructureElementsDictionary::isHeightANumber(SkPdfNativeDoc*
doc) { | |
128 SkPdfNativeObject* ret = get("Height", ""); | |
129 if (doc) {ret = doc->resolveReference(ret);} | |
130 return ret != NULL && ret->isNumber(); | |
131 } | |
132 | |
133 double SkPdfBlockLevelStructureElementsDictionary::getHeightAsNumber(SkPdfNative
Doc* doc) { | |
134 SkPdfNativeObject* ret = get("Height", ""); | |
135 if (doc) {ret = doc->resolveReference(ret);} | |
136 if ((ret != NULL && ret->isNumber()) || (doc == NULL && ret != NULL && ret->is
Reference())) return ret->numberValue(); | |
137 // TODO(edisonn): warn about missing default value for optional fields | |
138 return 0; | |
139 } | |
140 | |
141 bool SkPdfBlockLevelStructureElementsDictionary::isHeightAName(SkPdfNativeDoc* d
oc) { | |
142 SkPdfNativeObject* ret = get("Height", ""); | |
143 if (doc) {ret = doc->resolveReference(ret);} | |
144 return ret != NULL && ret->isName(); | |
145 } | |
146 | |
147 SkString SkPdfBlockLevelStructureElementsDictionary::getHeightAsName(SkPdfNative
Doc* doc) { | |
148 SkPdfNativeObject* ret = get("Height", ""); | |
149 if (doc) {ret = doc->resolveReference(ret);} | |
150 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
151 // TODO(edisonn): warn about missing default value for optional fields | |
152 return SkString(); | |
153 } | |
154 | |
155 bool SkPdfBlockLevelStructureElementsDictionary::has_Height() const { | |
156 return get("Height", "") != NULL; | |
157 } | |
158 | |
159 SkString SkPdfBlockLevelStructureElementsDictionary::BlockAlign(SkPdfNativeDoc*
doc) { | |
160 SkPdfNativeObject* ret = get("BlockAlign", ""); | |
161 if (doc) {ret = doc->resolveReference(ret);} | |
162 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
163 // TODO(edisonn): warn about missing default value for optional fields | |
164 return SkString(); | |
165 } | |
166 | |
167 bool SkPdfBlockLevelStructureElementsDictionary::has_BlockAlign() const { | |
168 return get("BlockAlign", "") != NULL; | |
169 } | |
170 | |
171 SkString SkPdfBlockLevelStructureElementsDictionary::InlineAlign(SkPdfNativeDoc*
doc) { | |
172 SkPdfNativeObject* ret = get("InlineAlign", ""); | |
173 if (doc) {ret = doc->resolveReference(ret);} | |
174 if ((ret != NULL && ret->isName()) || (doc == NULL && ret != NULL && ret->isRe
ference())) return ret->nameValue2(); | |
175 // TODO(edisonn): warn about missing default value for optional fields | |
176 return SkString(); | |
177 } | |
178 | |
179 bool SkPdfBlockLevelStructureElementsDictionary::has_InlineAlign() const { | |
180 return get("InlineAlign", "") != NULL; | |
181 } | |
OLD | NEW |