OLD | NEW |
(Empty) | |
| 1 #include "SkPdfJavascriptActionDictionary_autogen.h" |
| 2 |
| 3 |
| 4 #include "SkPdfNativeDoc.h" |
| 5 SkString SkPdfJavascriptActionDictionary::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 SkPdfJavascriptActionDictionary::has_S() const { |
| 14 return get("S", "") != NULL; |
| 15 } |
| 16 |
| 17 bool SkPdfJavascriptActionDictionary::isJSAString(SkPdfNativeDoc* doc) { |
| 18 SkPdfNativeObject* ret = get("JS", ""); |
| 19 if (doc) {ret = doc->resolveReference(ret);} |
| 20 return ret != NULL && ret->isAnyString(); |
| 21 } |
| 22 |
| 23 SkString SkPdfJavascriptActionDictionary::getJSAsString(SkPdfNativeDoc* doc) { |
| 24 SkPdfNativeObject* ret = get("JS", ""); |
| 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 pdf
s |
| 28 return SkString(); |
| 29 } |
| 30 |
| 31 bool SkPdfJavascriptActionDictionary::isJSAStream(SkPdfNativeDoc* doc) { |
| 32 SkPdfNativeObject* ret = get("JS", ""); |
| 33 if (doc) {ret = doc->resolveReference(ret);} |
| 34 return ret != NULL && ret->hasStream(); |
| 35 } |
| 36 |
| 37 SkPdfStream* SkPdfJavascriptActionDictionary::getJSAsStream(SkPdfNativeDoc* doc)
{ |
| 38 SkPdfNativeObject* ret = get("JS", ""); |
| 39 if (doc) {ret = doc->resolveReference(ret);} |
| 40 if ((ret != NULL && ret->hasStream()) || (doc == NULL && ret != NULL && ret->i
sReference())) return ret->getStream(); |
| 41 // TODO(edisonn): warn about missing required field, assert for known good pdf
s |
| 42 return NULL; |
| 43 } |
| 44 |
| 45 bool SkPdfJavascriptActionDictionary::has_JS() const { |
| 46 return get("JS", "") != NULL; |
| 47 } |
| 48 |
OLD | NEW |