Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: experimental/PdfViewer/SkPdfCatalogDictionary_autogen.h

Issue 16975013: Deal with ca and CA transparency operators in pdf. add comments to generated classes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfCatalogDictionary 1 #ifndef __DEFINED__SkPdfCatalogDictionary
2 #define __DEFINED__SkPdfCatalogDictionary 2 #define __DEFINED__SkPdfCatalogDictionary
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 catalog dictionary
8 class SkPdfCatalogDictionary : public SkPdfDictionary { 9 class SkPdfCatalogDictionary : public SkPdfDictionary {
9 public: 10 public:
10 virtual SkPdfObjectType getType() const { return kCatalogDictionary_SkPdfObjec tType;} 11 virtual SkPdfObjectType getType() const { return kCatalogDictionary_SkPdfObjec tType;}
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kCatalog Dictionary_SkPdfObjectType + 1);} 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kCatalog Dictionary_SkPdfObjectType + 1);}
12 public: 13 public:
13 virtual SkPdfCatalogDictionary* asCatalogDictionary() {return this;} 14 virtual SkPdfCatalogDictionary* asCatalogDictionary() {return this;}
14 virtual const SkPdfCatalogDictionary* asCatalogDictionary() const {return this ;} 15 virtual const SkPdfCatalogDictionary* asCatalogDictionary() const {return 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
514 515
515 public: 516 public:
516 private: 517 private:
517 public: 518 public:
518 SkPdfCatalogDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject * podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} 519 SkPdfCatalogDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject * podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {}
519 520
520 virtual bool valid() const {return true;} 521 virtual bool valid() const {return true;}
521 522
522 SkPdfCatalogDictionary& operator=(const SkPdfCatalogDictionary& from) {this->f PodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} 523 SkPdfCatalogDictionary& operator=(const SkPdfCatalogDictionary& from) {this->f PodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
523 524
525 /** (Required) The type of PDF object that this dictionary describes; must
526 * be Catalog for the catalog dictionary.
527 **/
528 bool has_Type() const {
529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type" , "", NULL));
530 }
531
524 std::string Type() const { 532 std::string Type() const {
525 std::string ret; 533 std::string ret;
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret; 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "", &ret)) return ret;
527 // TODO(edisonn): warn about missing required field, assert for known good p dfs 535 // TODO(edisonn): warn about missing required field, assert for known good p dfs
528 return ""; 536 return "";
529 } 537 }
530 538
539 /** (Optional; PDF 1.4) The version of the PDF specification to which the
540 * document conforms (for example, 1.4), if later than the version specified
541 * in the file's header (see Section 3.4.1, "File Header"). If the header speci -
542 * fies a later version, or if this entry is absent, the document conforms to
543 * the version specified in the header. This entry enables a PDF producer
544 * application to update the version using an incremental update; see Sec-
545 * tion 3.4.5, "Incremental Updates." (See implementation note 18 in Ap-
546 * pendix H.)
547 * Note: The value of this entry is a name object, not a number, and so must
548 * be preceded by a slash character (/) when written in the PDF file (for ex-
549 * ample, /1.4).
550 **/
551 bool has_Version() const {
552 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Versi on", "", NULL));
553 }
554
531 std::string Version() const { 555 std::string Version() const {
532 std::string ret; 556 std::string ret;
533 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Version", " ", &ret)) return ret; 557 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Version", " ", &ret)) return ret;
534 // TODO(edisonn): warn about missing required field, assert for known good p dfs 558 // TODO(edisonn): warn about missing required field, assert for known good p dfs
535 return ""; 559 return "";
536 } 560 }
537 561
562 /** (Required; must be an indirect reference) The page tree node that is the
563 * root of the document's page tree (see Section 3.6.2, "Page Tree").
564 **/
565 bool has_Pages() const {
566 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages ", "", NULL));
567 }
568
538 SkPdfDictionary* Pages() const { 569 SkPdfDictionary* Pages() const {
539 SkPdfDictionary* ret; 570 SkPdfDictionary* ret;
540 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages ", "", &ret)) return ret; 571 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages ", "", &ret)) return ret;
541 // TODO(edisonn): warn about missing required field, assert for known good p dfs 572 // TODO(edisonn): warn about missing required field, assert for known good p dfs
542 return NULL; 573 return NULL;
543 } 574 }
544 575
576 /** (Optional; PDF 1.3) A number tree (see Section 3.8.5, "Number Trees")
577 * defining the page labeling for the document. The keys in this tree are
578 * page indices; the corresponding values are page label dictionaries (see
579 * Section 8.3.1, "Page Labels"). Each page index denotes the first page in a
580 * labeling range to which the specified page label dictionary applies. The
581 * tree must include a value for page index 0.
582 **/
583 bool has_PageLabels() const {
584 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageL abels", "", NULL));
585 }
586
545 bool isPageLabelsANumber() const { 587 bool isPageLabelsANumber() const {
546 SkPdfObject* ret = NULL; 588 SkPdfObject* ret = NULL;
547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabe ls", "", &ret)) return false; 589 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabe ls", "", &ret)) return false;
548 return ret->podofo()->GetDataType() == ePdfDataType_Real || ret->podofo()->G etDataType() == ePdfDataType_Number; 590 return ret->podofo()->GetDataType() == ePdfDataType_Real || ret->podofo()->G etDataType() == ePdfDataType_Number;
549 } 591 }
550 592
551 double getPageLabelsAsNumber() const { 593 double getPageLabelsAsNumber() const {
552 double ret = 0; 594 double ret = 0;
553 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabel s", "", &ret)) return ret; 595 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabel s", "", &ret)) return ret;
554 // TODO(edisonn): warn about missing required field, assert for known good p dfs 596 // TODO(edisonn): warn about missing required field, assert for known good p dfs
555 return 0; 597 return 0;
556 } 598 }
557 599
558 bool isPageLabelsATree() const { 600 bool isPageLabelsATree() const {
559 SkPdfObject* ret = NULL; 601 SkPdfObject* ret = NULL;
560 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabe ls", "", &ret)) return false; 602 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabe ls", "", &ret)) return false;
561 return ret->podofo()->GetDataType() == ePdfDataType_Reference; 603 return ret->podofo()->GetDataType() == ePdfDataType_Reference;
562 } 604 }
563 605
564 SkPdfTree* getPageLabelsAsTree() const { 606 SkPdfTree* getPageLabelsAsTree() const {
565 SkPdfTree* ret = NULL; 607 SkPdfTree* ret = NULL;
566 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabels" , "", &ret)) return ret; 608 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLabels" , "", &ret)) return ret;
567 // TODO(edisonn): warn about missing required field, assert for known good p dfs 609 // TODO(edisonn): warn about missing required field, assert for known good p dfs
568 return NULL; 610 return NULL;
569 } 611 }
570 612
613 /** (Optional; PDF 1.2) The document's name dictionary (see Section 3.6.3,
614 * "Name Dictionary").
615 **/
616 bool has_Names() const {
617 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Names ", "", NULL));
618 }
619
571 SkPdfDictionary* Names() const { 620 SkPdfDictionary* Names() const {
572 SkPdfDictionary* ret; 621 SkPdfDictionary* ret;
573 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Names ", "", &ret)) return ret; 622 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Names ", "", &ret)) return ret;
574 // TODO(edisonn): warn about missing required field, assert for known good p dfs 623 // TODO(edisonn): warn about missing required field, assert for known good p dfs
575 return NULL; 624 return NULL;
576 } 625 }
577 626
627 /** (Optional; PDF 1.1; must be an indirect reference) A dictionary of names
628 * and corresponding destinations (see "Named Destinations" on page
629 * 476).
630 **/
631 bool has_Dests() const {
632 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests ", "", NULL));
633 }
634
578 SkPdfDictionary* Dests() const { 635 SkPdfDictionary* Dests() const {
579 SkPdfDictionary* ret; 636 SkPdfDictionary* ret;
580 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests ", "", &ret)) return ret; 637 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests ", "", &ret)) return ret;
581 // TODO(edisonn): warn about missing required field, assert for known good p dfs 638 // TODO(edisonn): warn about missing required field, assert for known good p dfs
582 return NULL; 639 return NULL;
583 } 640 }
584 641
642 /** (Optional; PDF 1.2) A viewer preferences dictionary (see Section 8.1,
643 * "Viewer Preferences") specifying the way the document is to be dis-
644 * played on the screen. If this entry is absent, viewer applications should
645 * use their own current user preference settings.
646 **/
647 bool has_ViewerPreferences() const {
648 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Viewe rPreferences", "", NULL));
649 }
650
585 SkPdfDictionary* ViewerPreferences() const { 651 SkPdfDictionary* ViewerPreferences() const {
586 SkPdfDictionary* ret; 652 SkPdfDictionary* ret;
587 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Viewe rPreferences", "", &ret)) return ret; 653 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Viewe rPreferences", "", &ret)) return ret;
588 // TODO(edisonn): warn about missing required field, assert for known good p dfs 654 // TODO(edisonn): warn about missing required field, assert for known good p dfs
589 return NULL; 655 return NULL;
590 } 656 }
591 657
658 /** (Optional) A name object specifying the page layout to be used when the
659 * document is opened:
660 * SinglePage Display one page at a time.
661 * OneColumn Display the pages in one column.
662 * TwoColumnLeft Display the pages in two columns, with odd-
663 * numbered pages on the left.
664 * TwoColumnRight Display the pages in two columns, with odd-
665 * numbered pages on the right.
666 * (See implementation note 19 in Appendix H.) Default value: SinglePage.
667 **/
668 bool has_PageLayout() const {
669 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageL ayout", "", NULL));
670 }
671
592 std::string PageLayout() const { 672 std::string PageLayout() const {
593 std::string ret; 673 std::string ret;
594 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLayout" , "", &ret)) return ret; 674 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageLayout" , "", &ret)) return ret;
595 // TODO(edisonn): warn about missing required field, assert for known good p dfs 675 // TODO(edisonn): warn about missing required field, assert for known good p dfs
596 return ""; 676 return "";
597 } 677 }
598 678
679 /** (Optional) A name object specifying how the document should be dis-
680 * played when opened:
681 * UseNone Neither document outline nor thumbnail im-
682 * ages visible
683 * UseOutlines Document outline visible
684 * UseThumbs Thumbnail images visible
685 * FullScreen Full-screen mode, with no menu bar, window
686 * controls, or any other window visible
687 * Default value: UseNone.
688 **/
689 bool has_PageMode() const {
690 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageM ode", "", NULL));
691 }
692
599 std::string PageMode() const { 693 std::string PageMode() const {
600 std::string ret; 694 std::string ret;
601 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageMode", "", &ret)) return ret; 695 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PageMode", "", &ret)) return ret;
602 // TODO(edisonn): warn about missing required field, assert for known good p dfs 696 // TODO(edisonn): warn about missing required field, assert for known good p dfs
603 return ""; 697 return "";
604 } 698 }
605 699
700 /** (Optional; must be an indirect reference) The outline dictionary that is the
701 * root of the document's outline hierarchy (see Section 8.2.2, "Document
702 * Outline").
703 **/
704 bool has_Outlines() const {
705 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Outli nes", "", NULL));
706 }
707
606 SkPdfDictionary* Outlines() const { 708 SkPdfDictionary* Outlines() const {
607 SkPdfDictionary* ret; 709 SkPdfDictionary* ret;
608 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Outli nes", "", &ret)) return ret; 710 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Outli nes", "", &ret)) return ret;
609 // TODO(edisonn): warn about missing required field, assert for known good p dfs 711 // TODO(edisonn): warn about missing required field, assert for known good p dfs
610 return NULL; 712 return NULL;
611 } 713 }
612 714
715 /** (Optional; PDF 1.1; must be an indirect reference) An array of thread
716 * dictionaries representing the document's article threads (see Section
717 * 8.3.2, "Articles").
718 **/
719 bool has_Threads() const {
720 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Threa ds", "", NULL));
721 }
722
613 SkPdfArray Threads() const { 723 SkPdfArray Threads() const {
614 SkPdfArray ret; 724 SkPdfArray ret;
615 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Threads", "", &ret)) return ret; 725 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Threads", "", &ret)) return ret;
616 // TODO(edisonn): warn about missing required field, assert for known good p dfs 726 // TODO(edisonn): warn about missing required field, assert for known good p dfs
617 return SkPdfArray(); 727 return SkPdfArray();
618 } 728 }
619 729
730 /** (Optional; PDF 1.1) A value specifying a destination to be displayed or
731 * an action to be performed when the document is opened. The value is
732 * either an array defining a destination (see Section 8.2.1, "Destinations")
733 * or an action dictionary representing an action (Section 8.5, "Actions"). If
734 * this entry is absent, the document should be opened to the top of the
735 * first page at the default magnification factor.
736 **/
737 bool has_OpenAction() const {
738 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenA ction", "", NULL));
739 }
740
620 bool isOpenActionAArray() const { 741 bool isOpenActionAArray() const {
621 SkPdfObject* ret = NULL; 742 SkPdfObject* ret = NULL;
622 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenActi on", "", &ret)) return false; 743 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenActi on", "", &ret)) return false;
623 return ret->podofo()->GetDataType() == ePdfDataType_Array; 744 return ret->podofo()->GetDataType() == ePdfDataType_Array;
624 } 745 }
625 746
626 SkPdfArray getOpenActionAsArray() const { 747 SkPdfArray getOpenActionAsArray() const {
627 SkPdfArray ret = SkPdfArray(); 748 SkPdfArray ret = SkPdfArray();
628 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenAction ", "", &ret)) return ret; 749 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenAction ", "", &ret)) return ret;
629 // TODO(edisonn): warn about missing required field, assert for known good p dfs 750 // TODO(edisonn): warn about missing required field, assert for known good p dfs
630 return SkPdfArray(); 751 return SkPdfArray();
631 } 752 }
632 753
633 bool isOpenActionADictionary() const { 754 bool isOpenActionADictionary() const {
634 SkPdfObject* ret = NULL; 755 SkPdfObject* ret = NULL;
635 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenActi on", "", &ret)) return false; 756 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenActi on", "", &ret)) return false;
636 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; 757 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary;
637 } 758 }
638 759
639 SkPdfDictionary* getOpenActionAsDictionary() const { 760 SkPdfDictionary* getOpenActionAsDictionary() const {
640 SkPdfDictionary* ret = NULL; 761 SkPdfDictionary* ret = NULL;
641 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenA ction", "", &ret)) return ret; 762 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OpenA ction", "", &ret)) return ret;
642 // TODO(edisonn): warn about missing required field, assert for known good p dfs 763 // TODO(edisonn): warn about missing required field, assert for known good p dfs
643 return NULL; 764 return NULL;
644 } 765 }
645 766
767 /** (Optional; PDF 1.4) An additional-actions dictionary defining the actions
768 * to be taken in response to various trigger events affecting the document
769 * as a whole (see "Trigger Events" on page 514). (See also implementation
770 * note 20 in Appendix H.)
771 **/
772 bool has_AA() const {
773 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA", "", NULL));
774 }
775
646 SkPdfDictionary* AA() const { 776 SkPdfDictionary* AA() const {
647 SkPdfDictionary* ret; 777 SkPdfDictionary* ret;
648 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA", "", &ret)) return ret; 778 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA", "", &ret)) return ret;
649 // TODO(edisonn): warn about missing required field, assert for known good p dfs 779 // TODO(edisonn): warn about missing required field, assert for known good p dfs
650 return NULL; 780 return NULL;
651 } 781 }
652 782
783 /** (Optional) A URI dictionary containing document-level information for
784 * URI (uniform resource identifier) actions (see "URI Actions" on page
785 * 523).
786 **/
787 bool has_URI() const {
788 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URI", "", NULL));
789 }
790
653 SkPdfDictionary* URI() const { 791 SkPdfDictionary* URI() const {
654 SkPdfDictionary* ret; 792 SkPdfDictionary* ret;
655 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URI", "", &ret)) return ret; 793 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URI", "", &ret)) return ret;
656 // TODO(edisonn): warn about missing required field, assert for known good p dfs 794 // TODO(edisonn): warn about missing required field, assert for known good p dfs
657 return NULL; 795 return NULL;
658 } 796 }
659 797
798 /** (Optional; PDF 1.2) The document's interactive form (AcroForm) dic-
799 * tionary (see Section 8.6.1, "Interactive Form Dictionary").
800 **/
801 bool has_AcroForm() const {
802 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AcroF orm", "", NULL));
803 }
804
660 SkPdfDictionary* AcroForm() const { 805 SkPdfDictionary* AcroForm() const {
661 SkPdfDictionary* ret; 806 SkPdfDictionary* ret;
662 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AcroF orm", "", &ret)) return ret; 807 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AcroF orm", "", &ret)) return ret;
663 // TODO(edisonn): warn about missing required field, assert for known good p dfs 808 // TODO(edisonn): warn about missing required field, assert for known good p dfs
664 return NULL; 809 return NULL;
665 } 810 }
666 811
812 /** (Optional; PDF 1.4; must be an indirect reference) A metadata stream
813 * containing metadata for the document (see Section 9.2.2, "Metadata
814 * Streams").
815 **/
816 bool has_Metadata() const {
817 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad ata", "", NULL));
818 }
819
667 SkPdfStream Metadata() const { 820 SkPdfStream Metadata() const {
668 SkPdfStream ret; 821 SkPdfStream ret;
669 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata" , "", &ret)) return ret; 822 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata" , "", &ret)) return ret;
670 // TODO(edisonn): warn about missing required field, assert for known good p dfs 823 // TODO(edisonn): warn about missing required field, assert for known good p dfs
671 return SkPdfStream(); 824 return SkPdfStream();
672 } 825 }
673 826
827 /** (Optional; PDF 1.3) The document's structure tree root dictionary (see
828 * Section 9.6.1, "Structure Hierarchy").
829 **/
830 bool has_StructTreeRoot() const {
831 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc tTreeRoot", "", NULL));
832 }
833
674 SkPdfDictionary* StructTreeRoot() const { 834 SkPdfDictionary* StructTreeRoot() const {
675 SkPdfDictionary* ret; 835 SkPdfDictionary* ret;
676 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc tTreeRoot", "", &ret)) return ret; 836 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc tTreeRoot", "", &ret)) return ret;
677 // TODO(edisonn): warn about missing required field, assert for known good p dfs 837 // TODO(edisonn): warn about missing required field, assert for known good p dfs
678 return NULL; 838 return NULL;
679 } 839 }
680 840
841 /** (Optional; PDF 1.4) A mark information dictionary containing informa-
842 * tion about the document's usage of Tagged PDF conventions (see Sec-
843 * tion 9.7.1, "Mark Information Dictionary").
844 **/
845 bool has_MarkInfo() const {
846 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MarkI nfo", "", NULL));
847 }
848
681 SkPdfDictionary* MarkInfo() const { 849 SkPdfDictionary* MarkInfo() const {
682 SkPdfDictionary* ret; 850 SkPdfDictionary* ret;
683 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MarkI nfo", "", &ret)) return ret; 851 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MarkI nfo", "", &ret)) return ret;
684 // TODO(edisonn): warn about missing required field, assert for known good p dfs 852 // TODO(edisonn): warn about missing required field, assert for known good p dfs
685 return NULL; 853 return NULL;
686 } 854 }
687 855
856 /** (Optional; PDF 1.4) A language identifier specifying the natural language
857 * for all text in the document except where overridden by language speci-
858 * fications for structure elements or marked content (see Section 9.8.1,
859 * "Natural Language Specification"). If this entry is absent, the language is
860 * considered unknown.
861 **/
862 bool has_Lang() const {
863 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang" , "", NULL));
864 }
865
688 std::string Lang() const { 866 std::string Lang() const {
689 std::string ret; 867 std::string ret;
690 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang", "" , &ret)) return ret; 868 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lang", "" , &ret)) return ret;
691 // TODO(edisonn): warn about missing required field, assert for known good p dfs 869 // TODO(edisonn): warn about missing required field, assert for known good p dfs
692 return ""; 870 return "";
693 } 871 }
694 872
873 /** (Optional; PDF 1.3) A Web Capture information dictionary containing
874 * state information used by the Acrobat Web Capture (AcroSpider) plug-
875 * in extension (see Section 9.9.1, "Web Capture Information Dictionary").
876 **/
877 bool has_SpiderInfo() const {
878 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Spide rInfo", "", NULL));
879 }
880
695 SkPdfDictionary* SpiderInfo() const { 881 SkPdfDictionary* SpiderInfo() const {
696 SkPdfDictionary* ret; 882 SkPdfDictionary* ret;
697 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Spide rInfo", "", &ret)) return ret; 883 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Spide rInfo", "", &ret)) return ret;
698 // TODO(edisonn): warn about missing required field, assert for known good p dfs 884 // TODO(edisonn): warn about missing required field, assert for known good p dfs
699 return NULL; 885 return NULL;
700 } 886 }
701 887
888 /** (Optional; PDF 1.4) An array of output intent dictionaries describing the
889 * color characteristics of output devices on which the document might be
890 * rendered (see "Output Intents" on page 684).
891 **/
892 bool has_OutputIntents() const {
893 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Outpu tIntents", "", NULL));
894 }
895
702 SkPdfArray OutputIntents() const { 896 SkPdfArray OutputIntents() const {
703 SkPdfArray ret; 897 SkPdfArray ret;
704 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OutputInte nts", "", &ret)) return ret; 898 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "OutputInte nts", "", &ret)) return ret;
705 // TODO(edisonn): warn about missing required field, assert for known good p dfs 899 // TODO(edisonn): warn about missing required field, assert for known good p dfs
706 return SkPdfArray(); 900 return SkPdfArray();
707 } 901 }
708 902
709 }; 903 };
710 904
711 #endif // __DEFINED__SkPdfCatalogDictionary 905 #endif // __DEFINED__SkPdfCatalogDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698