OLD | NEW |
1 #ifndef __DEFINED__SkPdfNameDictionary | 1 #ifndef __DEFINED__SkPdfNameDictionary |
2 #define __DEFINED__SkPdfNameDictionary | 2 #define __DEFINED__SkPdfNameDictionary |
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 // Entries in the name dictionary | 9 // Entries in the name dictionary |
10 class SkPdfNameDictionary : public SkPdfDictionary { | 10 class SkPdfNameDictionary : public SkPdfDictionary { |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 bool has_Dests() const { | 531 bool has_Dests() const { |
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests
", "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests
", "", NULL)); |
533 } | 533 } |
534 | 534 |
535 bool isDestsAName() const { | 535 bool isDestsAName() const { |
536 SkPdfObject* ret = NULL; | 536 SkPdfObject* ret = NULL; |
537 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; | 537 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; |
538 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 538 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
539 } | 539 } |
540 | 540 |
541 std::string getDestsAsName() const { | 541 std::string getDestsAsName() const; |
542 std::string ret = ""; | |
543 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; | |
544 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
545 return ""; | |
546 } | |
547 | |
548 bool isDestsATree() const { | 542 bool isDestsATree() const { |
549 SkPdfObject* ret = NULL; | 543 SkPdfObject* ret = NULL; |
550 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; | 544 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; |
551 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 545 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
552 } | 546 } |
553 | 547 |
554 SkPdfTree* getDestsAsTree() const { | 548 SkPdfTree* getDestsAsTree() const; |
555 SkPdfTree* ret = NULL; | |
556 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; | |
557 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
558 return NULL; | |
559 } | |
560 | |
561 /** (Optional; PDF 1.3) A name tree mapping name strings to annotation | 549 /** (Optional; PDF 1.3) A name tree mapping name strings to annotation |
562 * appearance streams (see Section 8.4.4, "Appearance Streams"). | 550 * appearance streams (see Section 8.4.4, "Appearance Streams"). |
563 **/ | 551 **/ |
564 bool has_AP() const { | 552 bool has_AP() const { |
565 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", NULL)); | 553 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", NULL)); |
566 } | 554 } |
567 | 555 |
568 bool isAPAName() const { | 556 bool isAPAName() const { |
569 SkPdfObject* ret = NULL; | 557 SkPdfObject* ret = NULL; |
570 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; | 558 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; |
571 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 559 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
572 } | 560 } |
573 | 561 |
574 std::string getAPAsName() const { | 562 std::string getAPAsName() const; |
575 std::string ret = ""; | |
576 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; | |
577 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
578 return ""; | |
579 } | |
580 | |
581 bool isAPATree() const { | 563 bool isAPATree() const { |
582 SkPdfObject* ret = NULL; | 564 SkPdfObject* ret = NULL; |
583 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; | 565 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; |
584 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 566 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
585 } | 567 } |
586 | 568 |
587 SkPdfTree* getAPAsTree() const { | 569 SkPdfTree* getAPAsTree() const; |
588 SkPdfTree* ret = NULL; | |
589 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; | |
590 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
591 return NULL; | |
592 } | |
593 | |
594 /** (Optional; PDF 1.3) A name tree mapping name strings to document-level | 570 /** (Optional; PDF 1.3) A name tree mapping name strings to document-level |
595 * JavaScript(R) actions (see "JavaScript Actions" on page 556). | 571 * JavaScript(R) actions (see "JavaScript Actions" on page 556). |
596 **/ | 572 **/ |
597 bool has_JavaScript() const { | 573 bool has_JavaScript() const { |
598 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", NULL)); | 574 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", NULL)); |
599 } | 575 } |
600 | 576 |
601 bool isJavaScriptAName() const { | 577 bool isJavaScriptAName() const { |
602 SkPdfObject* ret = NULL; | 578 SkPdfObject* ret = NULL; |
603 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; | 579 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; |
604 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 580 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
605 } | 581 } |
606 | 582 |
607 std::string getJavaScriptAsName() const { | 583 std::string getJavaScriptAsName() const; |
608 std::string ret = ""; | |
609 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; | |
610 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
611 return ""; | |
612 } | |
613 | |
614 bool isJavaScriptATree() const { | 584 bool isJavaScriptATree() const { |
615 SkPdfObject* ret = NULL; | 585 SkPdfObject* ret = NULL; |
616 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; | 586 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; |
617 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 587 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
618 } | 588 } |
619 | 589 |
620 SkPdfTree* getJavaScriptAsTree() const { | 590 SkPdfTree* getJavaScriptAsTree() const; |
621 SkPdfTree* ret = NULL; | |
622 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; | |
623 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
624 return NULL; | |
625 } | |
626 | |
627 /** (Optional; PDF 1.3) A name tree mapping name strings to visible pages for | 591 /** (Optional; PDF 1.3) A name tree mapping name strings to visible pages for |
628 * use in interactive forms (see Section 8.6.5, "Named Pages"). | 592 * use in interactive forms (see Section 8.6.5, "Named Pages"). |
629 **/ | 593 **/ |
630 bool has_Pages() const { | 594 bool has_Pages() const { |
631 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); | 595 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); |
632 } | 596 } |
633 | 597 |
634 bool isPagesAName() const { | 598 bool isPagesAName() const { |
635 SkPdfObject* ret = NULL; | 599 SkPdfObject* ret = NULL; |
636 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; | 600 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; |
637 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 601 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
638 } | 602 } |
639 | 603 |
640 std::string getPagesAsName() const { | 604 std::string getPagesAsName() const; |
641 std::string ret = ""; | |
642 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; | |
643 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
644 return ""; | |
645 } | |
646 | |
647 bool isPagesATree() const { | 605 bool isPagesATree() const { |
648 SkPdfObject* ret = NULL; | 606 SkPdfObject* ret = NULL; |
649 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; | 607 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; |
650 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 608 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
651 } | 609 } |
652 | 610 |
653 SkPdfTree* getPagesAsTree() const { | 611 SkPdfTree* getPagesAsTree() const; |
654 SkPdfTree* ret = NULL; | |
655 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; | |
656 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
657 return NULL; | |
658 } | |
659 | |
660 /** (Optional; PDF 1.3) A name tree mapping name strings to invisible (tem- | 612 /** (Optional; PDF 1.3) A name tree mapping name strings to invisible (tem- |
661 * plate) pages for use in interactive forms (see Section 8.6.5, "Named Pages")
. | 613 * plate) pages for use in interactive forms (see Section 8.6.5, "Named Pages")
. |
662 **/ | 614 **/ |
663 bool has_Templates() const { | 615 bool has_Templates() const { |
664 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templ
ates", "", NULL)); | 616 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templ
ates", "", NULL)); |
665 } | 617 } |
666 | 618 |
667 bool isTemplatesAName() const { | 619 bool isTemplatesAName() const { |
668 SkPdfObject* ret = NULL; | 620 SkPdfObject* ret = NULL; |
669 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; | 621 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; |
670 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 622 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
671 } | 623 } |
672 | 624 |
673 std::string getTemplatesAsName() const { | 625 std::string getTemplatesAsName() const; |
674 std::string ret = ""; | |
675 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; | |
676 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
677 return ""; | |
678 } | |
679 | |
680 bool isTemplatesATree() const { | 626 bool isTemplatesATree() const { |
681 SkPdfObject* ret = NULL; | 627 SkPdfObject* ret = NULL; |
682 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; | 628 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; |
683 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 629 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
684 } | 630 } |
685 | 631 |
686 SkPdfTree* getTemplatesAsTree() const { | 632 SkPdfTree* getTemplatesAsTree() const; |
687 SkPdfTree* ret = NULL; | |
688 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; | |
689 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
690 return NULL; | |
691 } | |
692 | |
693 /** (Optional; PDF 1.3) A name tree mapping digital identifiers to Web Capture | 633 /** (Optional; PDF 1.3) A name tree mapping digital identifiers to Web Capture |
694 * content sets (see Section 9.9.3, "Content Sets"). | 634 * content sets (see Section 9.9.3, "Content Sets"). |
695 **/ | 635 **/ |
696 bool has_IDS() const { | 636 bool has_IDS() const { |
697 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS",
"", NULL)); | 637 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS",
"", NULL)); |
698 } | 638 } |
699 | 639 |
700 bool isIDSAName() const { | 640 bool isIDSAName() const { |
701 SkPdfObject* ret = NULL; | 641 SkPdfObject* ret = NULL; |
702 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; | 642 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; |
703 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 643 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
704 } | 644 } |
705 | 645 |
706 std::string getIDSAsName() const { | 646 std::string getIDSAsName() const; |
707 std::string ret = ""; | |
708 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; | |
709 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
710 return ""; | |
711 } | |
712 | |
713 bool isIDSATree() const { | 647 bool isIDSATree() const { |
714 SkPdfObject* ret = NULL; | 648 SkPdfObject* ret = NULL; |
715 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; | 649 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; |
716 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 650 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
717 } | 651 } |
718 | 652 |
719 SkPdfTree* getIDSAsTree() const { | 653 SkPdfTree* getIDSAsTree() const; |
720 SkPdfTree* ret = NULL; | |
721 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; | |
722 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
723 return NULL; | |
724 } | |
725 | |
726 /** (Optional; PDF 1.3) A name tree mapping uniform resource locators (URLs) | 654 /** (Optional; PDF 1.3) A name tree mapping uniform resource locators (URLs) |
727 * to Web Capture content sets (see Section 9.9.3, "Content Sets"). | 655 * to Web Capture content sets (see Section 9.9.3, "Content Sets"). |
728 **/ | 656 **/ |
729 bool has_URLS() const { | 657 bool has_URLS() const { |
730 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS"
, "", NULL)); | 658 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS"
, "", NULL)); |
731 } | 659 } |
732 | 660 |
733 bool isURLSAName() const { | 661 bool isURLSAName() const { |
734 SkPdfObject* ret = NULL; | 662 SkPdfObject* ret = NULL; |
735 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; | 663 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; |
736 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 664 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
737 } | 665 } |
738 | 666 |
739 std::string getURLSAsName() const { | 667 std::string getURLSAsName() const; |
740 std::string ret = ""; | |
741 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; | |
742 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
743 return ""; | |
744 } | |
745 | |
746 bool isURLSATree() const { | 668 bool isURLSATree() const { |
747 SkPdfObject* ret = NULL; | 669 SkPdfObject* ret = NULL; |
748 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; | 670 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; |
749 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 671 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
750 } | 672 } |
751 | 673 |
752 SkPdfTree* getURLSAsTree() const { | 674 SkPdfTree* getURLSAsTree() const; |
753 SkPdfTree* ret = NULL; | |
754 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; | |
755 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
756 return NULL; | |
757 } | |
758 | |
759 /** (Optional; PDF 1.4) A name tree mapping name strings to embedded file | 675 /** (Optional; PDF 1.4) A name tree mapping name strings to embedded file |
760 * streams (see Section 3.10.3, "Embedded File Streams"). | 676 * streams (see Section 3.10.3, "Embedded File Streams"). |
761 **/ | 677 **/ |
762 bool has_EmbeddedFiles() const { | 678 bool has_EmbeddedFiles() const { |
763 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embed
dedFiles", "", NULL)); | 679 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embed
dedFiles", "", NULL)); |
764 } | 680 } |
765 | 681 |
766 bool isEmbeddedFilesAName() const { | 682 bool isEmbeddedFilesAName() const { |
767 SkPdfObject* ret = NULL; | 683 SkPdfObject* ret = NULL; |
768 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; | 684 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; |
769 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 685 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
770 } | 686 } |
771 | 687 |
772 std::string getEmbeddedFilesAsName() const { | 688 std::string getEmbeddedFilesAsName() const; |
773 std::string ret = ""; | |
774 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; | |
775 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
776 return ""; | |
777 } | |
778 | |
779 bool isEmbeddedFilesATree() const { | 689 bool isEmbeddedFilesATree() const { |
780 SkPdfObject* ret = NULL; | 690 SkPdfObject* ret = NULL; |
781 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; | 691 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; |
782 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 692 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
783 } | 693 } |
784 | 694 |
785 SkPdfTree* getEmbeddedFilesAsTree() const { | 695 SkPdfTree* getEmbeddedFilesAsTree() const; |
786 SkPdfTree* ret = NULL; | |
787 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; | |
788 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
789 return NULL; | |
790 } | |
791 | |
792 }; | 696 }; |
793 | 697 |
794 #endif // __DEFINED__SkPdfNameDictionary | 698 #endif // __DEFINED__SkPdfNameDictionary |
OLD | NEW |