OLD | NEW |
1 #ifndef __DEFINED__SkPdfJavascriptDictionary | 1 #ifndef __DEFINED__SkPdfJavascriptDictionary |
2 #define __DEFINED__SkPdfJavascriptDictionary | 2 #define __DEFINED__SkPdfJavascriptDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
7 | 7 |
8 // Entries in the JavaScript dictionary | 8 // Entries in the JavaScript dictionary |
9 class SkPdfJavascriptDictionary : public SkPdfDictionary { | 9 class SkPdfJavascriptDictionary : public SkPdfDictionary { |
10 public: | 10 public: |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 virtual SkPdfFontDescriptorDictionary* asFontDescriptorDictionary() {return NU
LL;} | 159 virtual SkPdfFontDescriptorDictionary* asFontDescriptorDictionary() {return NU
LL;} |
160 virtual const SkPdfFontDescriptorDictionary* asFontDescriptorDictionary() cons
t {return NULL;} | 160 virtual const SkPdfFontDescriptorDictionary* asFontDescriptorDictionary() cons
t {return NULL;} |
161 | 161 |
162 virtual SkPdfFontDictionary* asFontDictionary() {return NULL;} | 162 virtual SkPdfFontDictionary* asFontDictionary() {return NULL;} |
163 virtual const SkPdfFontDictionary* asFontDictionary() const {return NULL;} | 163 virtual const SkPdfFontDictionary* asFontDictionary() const {return NULL;} |
164 | 164 |
165 virtual SkPdfCIDFontDictionary* asCIDFontDictionary() {return NULL;} | 165 virtual SkPdfCIDFontDictionary* asCIDFontDictionary() {return NULL;} |
166 virtual const SkPdfCIDFontDictionary* asCIDFontDictionary() const {return NULL
;} | 166 virtual const SkPdfCIDFontDictionary* asCIDFontDictionary() const {return NULL
;} |
167 | 167 |
168 virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;} | |
169 virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {r
eturn NULL;} | |
170 | |
171 virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;} | 168 virtual SkPdfType0FontDictionary* asType0FontDictionary() {return NULL;} |
172 virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return
NULL;} | 169 virtual const SkPdfType0FontDictionary* asType0FontDictionary() const {return
NULL;} |
173 | 170 |
| 171 virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;} |
| 172 virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return
NULL;} |
| 173 |
174 virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;} | 174 virtual SkPdfType1FontDictionary* asType1FontDictionary() {return NULL;} |
175 virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return
NULL;} | 175 virtual const SkPdfType1FontDictionary* asType1FontDictionary() const {return
NULL;} |
176 | 176 |
177 virtual SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() {return
NULL;} | 177 virtual SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() {return
NULL;} |
178 virtual const SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() co
nst {return NULL;} | 178 virtual const SkPdfMultiMasterFontDictionary* asMultiMasterFontDictionary() co
nst {return NULL;} |
179 | 179 |
180 virtual SkPdfType3FontDictionary* asType3FontDictionary() {return NULL;} | 180 virtual SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() {return NULL;} |
181 virtual const SkPdfType3FontDictionary* asType3FontDictionary() const {return
NULL;} | 181 virtual const SkPdfTrueTypeFontDictionary* asTrueTypeFontDictionary() const {r
eturn NULL;} |
182 | 182 |
183 virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {retur
n NULL;} | 183 virtual SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary() {retur
n NULL;} |
184 virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary()
const {return NULL;} | 184 virtual const SkPdfFormFieldActionsDictionary* asFormFieldActionsDictionary()
const {return NULL;} |
185 | 185 |
186 virtual SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() {r
eturn NULL;} | 186 virtual SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() {r
eturn NULL;} |
187 virtual const SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionar
y() const {return NULL;} | 187 virtual const SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionar
y() const {return NULL;} |
188 | 188 |
189 virtual SkPdfFunctionCommonDictionary* asFunctionCommonDictionary() {return NU
LL;} | 189 virtual SkPdfFunctionCommonDictionary* asFunctionCommonDictionary() {return NU
LL;} |
190 virtual const SkPdfFunctionCommonDictionary* asFunctionCommonDictionary() cons
t {return NULL;} | 190 virtual const SkPdfFunctionCommonDictionary* asFunctionCommonDictionary() cons
t {return NULL;} |
191 | 191 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return ""; | 542 return ""; |
543 } | 543 } |
544 | 544 |
545 bool isBeforeAStream() const { | 545 bool isBeforeAStream() const { |
546 SkPdfObject* ret = NULL; | 546 SkPdfObject* ret = NULL; |
547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Before",
"", &ret)) return false; | 547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Before",
"", &ret)) return false; |
548 return ret->podofo()->HasStream(); | 548 return ret->podofo()->HasStream(); |
549 } | 549 } |
550 | 550 |
551 SkPdfStream getBeforeAsStream() const { | 551 SkPdfStream* getBeforeAsStream() const { |
552 SkPdfStream ret = SkPdfStream(); | 552 SkPdfStream* ret = NULL; |
553 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Before",
"", &ret)) return ret; | 553 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Before",
"", &ret)) return ret; |
554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
555 return SkPdfStream(); | 555 return NULL; |
556 } | 556 } |
557 | 557 |
558 /** (Optional) A string or stream containing a JavaScript script to be executed | 558 /** (Optional) A string or stream containing a JavaScript script to be executed |
559 * just after the FDF file is imported. | 559 * just after the FDF file is imported. |
560 **/ | 560 **/ |
561 bool has_After() const { | 561 bool has_After() const { |
562 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After
", "", NULL)); | 562 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After
", "", NULL)); |
563 } | 563 } |
564 | 564 |
565 bool isAfterAString() const { | 565 bool isAfterAString() const { |
566 SkPdfObject* ret = NULL; | 566 SkPdfObject* ret = NULL; |
567 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After",
"", &ret)) return false; | 567 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After",
"", &ret)) return false; |
568 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 568 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
569 } | 569 } |
570 | 570 |
571 std::string getAfterAsString() const { | 571 std::string getAfterAsString() const { |
572 std::string ret = ""; | 572 std::string ret = ""; |
573 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After", "
", &ret)) return ret; | 573 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After", "
", &ret)) return ret; |
574 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 574 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
575 return ""; | 575 return ""; |
576 } | 576 } |
577 | 577 |
578 bool isAfterAStream() const { | 578 bool isAfterAStream() const { |
579 SkPdfObject* ret = NULL; | 579 SkPdfObject* ret = NULL; |
580 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After",
"", &ret)) return false; | 580 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After",
"", &ret)) return false; |
581 return ret->podofo()->HasStream(); | 581 return ret->podofo()->HasStream(); |
582 } | 582 } |
583 | 583 |
584 SkPdfStream getAfterAsStream() const { | 584 SkPdfStream* getAfterAsStream() const { |
585 SkPdfStream ret = SkPdfStream(); | 585 SkPdfStream* ret = NULL; |
586 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After", "
", &ret)) return ret; | 586 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "After", "
", &ret)) return ret; |
587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
588 return SkPdfStream(); | 588 return NULL; |
589 } | 589 } |
590 | 590 |
591 /** (Optional) An array defining additional JavaScript scripts to be added to | 591 /** (Optional) An array defining additional JavaScript scripts to be added to |
592 * those defined in the JavaScript entry of the document's name dictionary (see | 592 * those defined in the JavaScript entry of the document's name dictionary (see |
593 * Section 3.6.3, "Name Dictionary"). The array contains an even number of | 593 * Section 3.6.3, "Name Dictionary"). The array contains an even number of |
594 * elements, organized in pairs. The first element of each pair is a name and t
he | 594 * elements, organized in pairs. The first element of each pair is a name and t
he |
595 * second is a string or stream defining the script corresponding to that name. | 595 * second is a string or stream defining the script corresponding to that name. |
596 * Each of the defined scripts will be added to those already defined in the na
me | 596 * Each of the defined scripts will be added to those already defined in the na
me |
597 * dictionary and then executed before the script defined in the Before entry i
s | 597 * dictionary and then executed before the script defined in the Before entry i
s |
598 * executed. As described in "JavaScript Actions" on page 556, these scripts ar
e | 598 * executed. As described in "JavaScript Actions" on page 556, these scripts ar
e |
599 * used to define JavaScript functions for use by other scripts in the document
. | 599 * used to define JavaScript functions for use by other scripts in the document
. |
600 **/ | 600 **/ |
601 bool has_Doc() const { | 601 bool has_Doc() const { |
602 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc",
"", NULL)); | 602 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc",
"", NULL)); |
603 } | 603 } |
604 | 604 |
605 SkPdfArray Doc() const { | 605 SkPdfArray Doc() const { |
606 SkPdfArray ret; | 606 SkPdfArray ret; |
607 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc", "",
&ret)) return ret; | 607 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Doc", "",
&ret)) return ret; |
608 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 608 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
609 return SkPdfArray(); | 609 return SkPdfArray(); |
610 } | 610 } |
611 | 611 |
612 }; | 612 }; |
613 | 613 |
614 #endif // __DEFINED__SkPdfJavascriptDictionary | 614 #endif // __DEFINED__SkPdfJavascriptDictionary |
OLD | NEW |