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

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

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

Powered by Google App Engine
This is Rietveld 408576698