OLD | NEW |
1 #ifndef __DEFINED__SkPdfStreamCommonDictionary | 1 #ifndef __DEFINED__SkPdfStreamCommonDictionary |
2 #define __DEFINED__SkPdfStreamCommonDictionary | 2 #define __DEFINED__SkPdfStreamCommonDictionary |
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 common to all stream dictionaries |
8 class SkPdfStreamCommonDictionary : public SkPdfDictionary { | 9 class SkPdfStreamCommonDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kStreamCommonDictionary_SkPdf
ObjectType;} | 11 virtual SkPdfObjectType getType() const { return kStreamCommonDictionary_SkPdf
ObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kStreamC
ommonDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kStreamC
ommonDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfStreamCommonDictionary* asStreamCommonDictionary() {return this;} | 14 virtual SkPdfStreamCommonDictionary* asStreamCommonDictionary() {return this;} |
14 virtual const SkPdfStreamCommonDictionary* asStreamCommonDictionary() const {r
eturn this;} | 15 virtual const SkPdfStreamCommonDictionary* asStreamCommonDictionary() const {r
eturn this;} |
15 | 16 |
16 private: | 17 private: |
17 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} | 18 virtual SkPdfALinkAnnotationDictionary* asALinkAnnotationDictionary() {return
NULL;} |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 | 515 |
515 public: | 516 public: |
516 private: | 517 private: |
517 public: | 518 public: |
518 SkPdfStreamCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfStreamCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfStreamCommonDictionary& operator=(const SkPdfStreamCommonDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | 523 SkPdfStreamCommonDictionary& operator=(const SkPdfStreamCommonDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} |
523 | 524 |
| 525 /** (Required) The number of bytes from the beginning of the line fol- |
| 526 * lowing the keyword stream to the last byte just before the keyword |
| 527 * endstream. (There may be an additional EOL marker, preceding |
| 528 * endstream, that is not included in the count and is not logically part |
| 529 * of the stream data.) See "Stream Extent," above, for further discus- |
| 530 * sion. |
| 531 **/ |
| 532 bool has_Length() const { |
| 533 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h", "", NULL)); |
| 534 } |
| 535 |
524 long Length() const { | 536 long Length() const { |
525 long ret; | 537 long ret; |
526 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length", ""
, &ret)) return ret; | 538 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length", ""
, &ret)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 539 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return 0; | 540 return 0; |
529 } | 541 } |
530 | 542 |
| 543 /** (Optional) The name of a filter to be applied in processing the stream |
| 544 * data found between the keywords stream and endstream, or an array |
| 545 * of such names. Multiple filters should be specified in the order in |
| 546 * which they are to be applied. |
| 547 **/ |
| 548 bool has_Filter() const { |
| 549 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filte
r", "", NULL)); |
| 550 } |
| 551 |
531 bool isFilterAName() const { | 552 bool isFilterAName() const { |
532 SkPdfObject* ret = NULL; | 553 SkPdfObject* ret = NULL; |
533 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter",
"", &ret)) return false; | 554 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter",
"", &ret)) return false; |
534 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 555 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
535 } | 556 } |
536 | 557 |
537 std::string getFilterAsName() const { | 558 std::string getFilterAsName() const { |
538 std::string ret = ""; | 559 std::string ret = ""; |
539 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", ""
, &ret)) return ret; | 560 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", ""
, &ret)) return ret; |
540 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 561 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
541 return ""; | 562 return ""; |
542 } | 563 } |
543 | 564 |
544 bool isFilterAArray() const { | 565 bool isFilterAArray() const { |
545 SkPdfObject* ret = NULL; | 566 SkPdfObject* ret = NULL; |
546 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter",
"", &ret)) return false; | 567 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter",
"", &ret)) return false; |
547 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 568 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
548 } | 569 } |
549 | 570 |
550 SkPdfArray getFilterAsArray() const { | 571 SkPdfArray getFilterAsArray() const { |
551 SkPdfArray ret = SkPdfArray(); | 572 SkPdfArray ret = SkPdfArray(); |
552 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", "
", &ret)) return ret; | 573 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", "
", &ret)) return ret; |
553 // 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 |
554 return SkPdfArray(); | 575 return SkPdfArray(); |
555 } | 576 } |
556 | 577 |
| 578 /** (Optional) A parameter dictionary, or an array of such dictionaries, |
| 579 * used by the filters specified by Filter. If there is only one filter and tha
t |
| 580 * filter has parameters, DecodeParms must be set to the filter's parame- |
| 581 * ter dictionary unless all the filter's parameters have their default |
| 582 * values, in which case the DecodeParms entry may be omitted. If there |
| 583 * are multiple filters and any of the filters has parameters set to non- |
| 584 * default values, DecodeParms must be an array with one entry for |
| 585 * each filter: either the parameter dictionary for that filter, or the null |
| 586 * object if that filter has no parameters (or if all of its parameters have |
| 587 * their default values). If none of the filters have parameters, or if all |
| 588 * their parameters have default values, the DecodeParms entry may be |
| 589 * omitted. (See implementation note 7 in Appendix H.) |
| 590 **/ |
| 591 bool has_DecodeParms() const { |
| 592 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod
eParms", "", NULL)); |
| 593 } |
| 594 |
557 bool isDecodeParmsADictionary() const { | 595 bool isDecodeParmsADictionary() const { |
558 SkPdfObject* ret = NULL; | 596 SkPdfObject* ret = NULL; |
559 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodePa
rms", "", &ret)) return false; | 597 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodePa
rms", "", &ret)) return false; |
560 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 598 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
561 } | 599 } |
562 | 600 |
563 SkPdfDictionary* getDecodeParmsAsDictionary() const { | 601 SkPdfDictionary* getDecodeParmsAsDictionary() const { |
564 SkPdfDictionary* ret = NULL; | 602 SkPdfDictionary* ret = NULL; |
565 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod
eParms", "", &ret)) return ret; | 603 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Decod
eParms", "", &ret)) return ret; |
566 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 604 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
567 return NULL; | 605 return NULL; |
568 } | 606 } |
569 | 607 |
570 bool isDecodeParmsAArray() const { | 608 bool isDecodeParmsAArray() const { |
571 SkPdfObject* ret = NULL; | 609 SkPdfObject* ret = NULL; |
572 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodePa
rms", "", &ret)) return false; | 610 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodePa
rms", "", &ret)) return false; |
573 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 611 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
574 } | 612 } |
575 | 613 |
576 SkPdfArray getDecodeParmsAsArray() const { | 614 SkPdfArray getDecodeParmsAsArray() const { |
577 SkPdfArray ret = SkPdfArray(); | 615 SkPdfArray ret = SkPdfArray(); |
578 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodeParm
s", "", &ret)) return ret; | 616 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DecodeParm
s", "", &ret)) return ret; |
579 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 617 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
580 return SkPdfArray(); | 618 return SkPdfArray(); |
581 } | 619 } |
582 | 620 |
| 621 /** (Optional; PDF 1.2) The file containing the stream data. If this entry |
| 622 * is present, the bytes between stream and endstream are ignored, the |
| 623 * filters are specified by FFilter rather than Filter, and the filter parame- |
| 624 * ters are specified by FDecodeParms rather than DecodeParms. How- |
| 625 * ever, the Length entry should still specify the number of those bytes. |
| 626 * (Usually there are no bytes and Length is 0.) |
| 627 **/ |
| 628 bool has_F() const { |
| 629 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
| 630 } |
| 631 |
583 SkPdfFileSpec F() const { | 632 SkPdfFileSpec F() const { |
584 SkPdfFileSpec ret; | 633 SkPdfFileSpec ret; |
585 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; | 634 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; |
586 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 635 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
587 return SkPdfFileSpec(); | 636 return SkPdfFileSpec(); |
588 } | 637 } |
589 | 638 |
| 639 /** (Optional; PDF 1.2) The name of a filter to be applied in processing |
| 640 * the data found in the stream's external file, or an array of such names. |
| 641 * The same rules apply as for Filter. |
| 642 **/ |
| 643 bool has_FFilter() const { |
| 644 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilt
er", "", NULL)); |
| 645 } |
| 646 |
590 bool isFFilterAName() const { | 647 bool isFFilterAName() const { |
591 SkPdfObject* ret = NULL; | 648 SkPdfObject* ret = NULL; |
592 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter"
, "", &ret)) return false; | 649 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter"
, "", &ret)) return false; |
593 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 650 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
594 } | 651 } |
595 | 652 |
596 std::string getFFilterAsName() const { | 653 std::string getFFilterAsName() const { |
597 std::string ret = ""; | 654 std::string ret = ""; |
598 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter", "
", &ret)) return ret; | 655 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter", "
", &ret)) return ret; |
599 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 656 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
600 return ""; | 657 return ""; |
601 } | 658 } |
602 | 659 |
603 bool isFFilterAArray() const { | 660 bool isFFilterAArray() const { |
604 SkPdfObject* ret = NULL; | 661 SkPdfObject* ret = NULL; |
605 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter"
, "", &ret)) return false; | 662 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter"
, "", &ret)) return false; |
606 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 663 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
607 } | 664 } |
608 | 665 |
609 SkPdfArray getFFilterAsArray() const { | 666 SkPdfArray getFFilterAsArray() const { |
610 SkPdfArray ret = SkPdfArray(); | 667 SkPdfArray ret = SkPdfArray(); |
611 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter",
"", &ret)) return ret; | 668 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FFilter",
"", &ret)) return ret; |
612 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 669 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
613 return SkPdfArray(); | 670 return SkPdfArray(); |
614 } | 671 } |
615 | 672 |
| 673 /** (Optional; PDF 1.2) A parameter dictionary, or an array of such dic- |
| 674 * tionaries, used by the filters specified by FFilter. The same rules apply |
| 675 * as for DecodeParms. |
| 676 **/ |
| 677 bool has_FDecodeParms() const { |
| 678 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDeco
deParms", "", NULL)); |
| 679 } |
| 680 |
616 bool isFDecodeParmsADictionary() const { | 681 bool isFDecodeParmsADictionary() const { |
617 SkPdfObject* ret = NULL; | 682 SkPdfObject* ret = NULL; |
618 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodeP
arms", "", &ret)) return false; | 683 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodeP
arms", "", &ret)) return false; |
619 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 684 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
620 } | 685 } |
621 | 686 |
622 SkPdfDictionary* getFDecodeParmsAsDictionary() const { | 687 SkPdfDictionary* getFDecodeParmsAsDictionary() const { |
623 SkPdfDictionary* ret = NULL; | 688 SkPdfDictionary* ret = NULL; |
624 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDeco
deParms", "", &ret)) return ret; | 689 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDeco
deParms", "", &ret)) return ret; |
625 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 690 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
626 return NULL; | 691 return NULL; |
627 } | 692 } |
628 | 693 |
629 bool isFDecodeParmsAArray() const { | 694 bool isFDecodeParmsAArray() const { |
630 SkPdfObject* ret = NULL; | 695 SkPdfObject* ret = NULL; |
631 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodeP
arms", "", &ret)) return false; | 696 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodeP
arms", "", &ret)) return false; |
632 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 697 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
633 } | 698 } |
634 | 699 |
635 SkPdfArray getFDecodeParmsAsArray() const { | 700 SkPdfArray getFDecodeParmsAsArray() const { |
636 SkPdfArray ret = SkPdfArray(); | 701 SkPdfArray ret = SkPdfArray(); |
637 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodePar
ms", "", &ret)) return ret; | 702 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FDecodePar
ms", "", &ret)) return ret; |
638 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 703 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
639 return SkPdfArray(); | 704 return SkPdfArray(); |
640 } | 705 } |
641 | 706 |
642 }; | 707 }; |
643 | 708 |
644 #endif // __DEFINED__SkPdfStreamCommonDictionary | 709 #endif // __DEFINED__SkPdfStreamCommonDictionary |
OLD | NEW |