OLD | NEW |
(Empty) | |
| 1 #include "SkPdfThreadActionDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 SkString SkPdfThreadActionDictionary::S(SkPdfNativeDoc* doc) { |
| 6 SkPdfNativeObject* ret = get("S", ""); |
| 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 SkPdfThreadActionDictionary::has_S() const { |
| 14 return get("S", "") != NULL; |
| 15 } |
| 16 |
| 17 SkPdfFileSpec SkPdfThreadActionDictionary::F(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("F", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 if ((ret != NULL && false) || (doc == NULL && ret != NULL && ret->isReference(
))) return ret->fileSpecValue(); |
| 21 // TODO(edisonn): warn about missing default value for optional fields |
| 22 return SkPdfFileSpec(); |
| 23 } |
| 24 |
| 25 bool SkPdfThreadActionDictionary::has_F() const { |
| 26 return get("F", "") != NULL; |
| 27 } |
| 28 |
| 29 bool SkPdfThreadActionDictionary::isDADictionary(SkPdfNativeDoc* doc) { |
| 30 SkPdfNativeObject* ret = get("D", ""); |
| 31 if (doc) {ret = doc->resolveReference(ret);} |
| 32 return ret != NULL && ret->isDictionary(); |
| 33 } |
| 34 |
| 35 SkPdfDictionary* SkPdfThreadActionDictionary::getDAsDictionary(SkPdfNativeDoc* d
oc) { |
| 36 SkPdfNativeObject* ret = get("D", ""); |
| 37 if (doc) {ret = doc->resolveReference(ret);} |
| 38 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; |
| 39 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 40 return NULL; |
| 41 } |
| 42 |
| 43 bool SkPdfThreadActionDictionary::isDAInteger(SkPdfNativeDoc* doc) { |
| 44 SkPdfNativeObject* ret = get("D", ""); |
| 45 if (doc) {ret = doc->resolveReference(ret);} |
| 46 return ret != NULL && ret->isInteger(); |
| 47 } |
| 48 |
| 49 int64_t SkPdfThreadActionDictionary::getDAsInteger(SkPdfNativeDoc* doc) { |
| 50 SkPdfNativeObject* ret = get("D", ""); |
| 51 if (doc) {ret = doc->resolveReference(ret);} |
| 52 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 53 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 54 return 0; |
| 55 } |
| 56 |
| 57 bool SkPdfThreadActionDictionary::isDAString(SkPdfNativeDoc* doc) { |
| 58 SkPdfNativeObject* ret = get("D", ""); |
| 59 if (doc) {ret = doc->resolveReference(ret);} |
| 60 return ret != NULL && ret->isAnyString(); |
| 61 } |
| 62 |
| 63 SkString SkPdfThreadActionDictionary::getDAsString(SkPdfNativeDoc* doc) { |
| 64 SkPdfNativeObject* ret = get("D", ""); |
| 65 if (doc) {ret = doc->resolveReference(ret);} |
| 66 if ((ret != NULL && ret->isAnyString()) || (doc == NULL && ret != NULL && ret-
>isReference())) return ret->stringValue2(); |
| 67 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 68 return SkString(); |
| 69 } |
| 70 |
| 71 bool SkPdfThreadActionDictionary::has_D() const { |
| 72 return get("D", "") != NULL; |
| 73 } |
| 74 |
| 75 bool SkPdfThreadActionDictionary::isBADictionary(SkPdfNativeDoc* doc) { |
| 76 SkPdfNativeObject* ret = get("B", ""); |
| 77 if (doc) {ret = doc->resolveReference(ret);} |
| 78 return ret != NULL && ret->isDictionary(); |
| 79 } |
| 80 |
| 81 SkPdfDictionary* SkPdfThreadActionDictionary::getBAsDictionary(SkPdfNativeDoc* d
oc) { |
| 82 SkPdfNativeObject* ret = get("B", ""); |
| 83 if (doc) {ret = doc->resolveReference(ret);} |
| 84 if ((ret != NULL && ret->isDictionary()) || (doc == NULL && ret != NULL && ret
->isReference())) return (SkPdfDictionary*)ret; |
| 85 // TODO(edisonn): warn about missing default value for optional fields |
| 86 return NULL; |
| 87 } |
| 88 |
| 89 bool SkPdfThreadActionDictionary::isBAInteger(SkPdfNativeDoc* doc) { |
| 90 SkPdfNativeObject* ret = get("B", ""); |
| 91 if (doc) {ret = doc->resolveReference(ret);} |
| 92 return ret != NULL && ret->isInteger(); |
| 93 } |
| 94 |
| 95 int64_t SkPdfThreadActionDictionary::getBAsInteger(SkPdfNativeDoc* doc) { |
| 96 SkPdfNativeObject* ret = get("B", ""); |
| 97 if (doc) {ret = doc->resolveReference(ret);} |
| 98 if ((ret != NULL && ret->isInteger()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->intValue(); |
| 99 // TODO(edisonn): warn about missing default value for optional fields |
| 100 return 0; |
| 101 } |
| 102 |
| 103 bool SkPdfThreadActionDictionary::has_B() const { |
| 104 return get("B", "") != NULL; |
| 105 } |
| 106 |
OLD | NEW |