OLD | NEW |
1 #ifndef __DEFINED__SkPdfJavascriptActionDictionary | 1 #ifndef __DEFINED__SkPdfJavascriptActionDictionary |
2 #define __DEFINED__SkPdfJavascriptActionDictionary | 2 #define __DEFINED__SkPdfJavascriptActionDictionary |
3 | 3 |
4 #include "SkPdfUtils.h" | 4 #include "SkPdfUtils.h" |
5 #include "SkPdfEnums_autogen.h" | 5 #include "SkPdfEnums_autogen.h" |
6 #include "SkPdfArray_autogen.h" | 6 #include "SkPdfArray_autogen.h" |
7 #include "SkPdfDictionary_autogen.h" | 7 #include "SkPdfDictionary_autogen.h" |
8 | 8 |
9 // Additional entries specific to a JavaScript action | 9 // Additional entries specific to a JavaScript action |
10 class SkPdfJavascriptActionDictionary : public SkPdfDictionary { | 10 class SkPdfJavascriptActionDictionary : public SkPdfDictionary { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 SkPdfJavascriptActionDictionary& operator=(const SkPdfJavascriptActionDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} | 526 SkPdfJavascriptActionDictionary& operator=(const SkPdfJavascriptActionDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} |
527 | 527 |
528 /** (Required) The type of action that this dictionary describes; must be JavaSc
ript | 528 /** (Required) The type of action that this dictionary describes; must be JavaSc
ript |
529 * for a JavaScript action. | 529 * for a JavaScript action. |
530 **/ | 530 **/ |
531 bool has_S() const { | 531 bool has_S() const { |
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); |
533 } | 533 } |
534 | 534 |
535 std::string S() const { | 535 std::string S() const; |
536 std::string ret; | |
537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) return ret; | |
538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
539 return ""; | |
540 } | |
541 | |
542 /** (Required) A string or stream containing the JavaScript script to be execute
d. | 536 /** (Required) A string or stream containing the JavaScript script to be execute
d. |
543 * Note: PDFDocEncoding or Unicode encoding (the latter identified by the Unico
de | 537 * Note: PDFDocEncoding or Unicode encoding (the latter identified by the Unico
de |
544 * prefix U+ FEFF) is used to encode the contents of the string or stream. (See
imple- | 538 * prefix U+ FEFF) is used to encode the contents of the string or stream. (See
imple- |
545 * mentation note 89 in Appendix H.) | 539 * mentation note 89 in Appendix H.) |
546 **/ | 540 **/ |
547 bool has_JS() const { | 541 bool has_JS() const { |
548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS",
"", NULL)); | 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS",
"", NULL)); |
549 } | 543 } |
550 | 544 |
551 bool isJSAString() const { | 545 bool isJSAString() const { |
552 SkPdfObject* ret = NULL; | 546 SkPdfObject* ret = NULL; |
553 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return false; | 547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return false; |
554 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 548 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
555 } | 549 } |
556 | 550 |
557 std::string getJSAsString() const { | 551 std::string getJSAsString() const; |
558 std::string ret = ""; | |
559 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return ret; | |
560 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
561 return ""; | |
562 } | |
563 | |
564 bool isJSAStream() const { | 552 bool isJSAStream() const { |
565 SkPdfObject* ret = NULL; | 553 SkPdfObject* ret = NULL; |
566 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return false; | 554 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return false; |
567 return ret->podofo()->HasStream(); | 555 return ret->podofo()->HasStream(); |
568 } | 556 } |
569 | 557 |
570 SkPdfStream* getJSAsStream() const { | 558 SkPdfStream* getJSAsStream() const; |
571 SkPdfStream* ret = NULL; | |
572 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JS", "",
&ret)) return ret; | |
573 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
574 return NULL; | |
575 } | |
576 | |
577 }; | 559 }; |
578 | 560 |
579 #endif // __DEFINED__SkPdfJavascriptActionDictionary | 561 #endif // __DEFINED__SkPdfJavascriptActionDictionary |
OLD | NEW |