OLD | NEW |
1 #ifndef __DEFINED__SkPdfPageObjectDictionary | 1 #ifndef __DEFINED__SkPdfPageObjectDictionary |
2 #define __DEFINED__SkPdfPageObjectDictionary | 2 #define __DEFINED__SkPdfPageObjectDictionary |
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 a page object |
8 class SkPdfPageObjectDictionary : public SkPdfDictionary { | 9 class SkPdfPageObjectDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kPageObjectDictionary_SkPdfOb
jectType;} | 11 virtual SkPdfObjectType getType() const { return kPageObjectDictionary_SkPdfOb
jectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kPageObj
ectDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kPageObj
ectDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfPageObjectDictionary* asPageObjectDictionary() {return this;} | 14 virtual SkPdfPageObjectDictionary* asPageObjectDictionary() {return this;} |
14 virtual const SkPdfPageObjectDictionary* asPageObjectDictionary() const {retur
n this;} | 15 virtual const SkPdfPageObjectDictionary* asPageObjectDictionary() const {retur
n 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 SkPdfPageObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObj
ect* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfPageObjectDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObj
ect* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfPageObjectDictionary& operator=(const SkPdfPageObjectDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} | 523 SkPdfPageObjectDictionary& operator=(const SkPdfPageObjectDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} |
523 | 524 |
| 525 /** (Required) The type of PDF object that this dictionary describes; must be |
| 526 * Page for a page object. |
| 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 /** (Required; must be an indirect reference) The page tree node that is the im- |
| 540 * mediate parent of this page object. |
| 541 **/ |
| 542 bool has_Parent() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", NULL)); |
| 544 } |
| 545 |
531 SkPdfDictionary* Parent() const { | 546 SkPdfDictionary* Parent() const { |
532 SkPdfDictionary* ret; | 547 SkPdfDictionary* ret; |
533 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", &ret)) return ret; | 548 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
t", "", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 549 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return NULL; | 550 return NULL; |
536 } | 551 } |
537 | 552 |
| 553 /** (Required if PieceInfo is present; optional otherwise; PDF 1.3) The date and |
| 554 * time (see Section 3.8.2, "Dates") when the page's contents were most re- |
| 555 * cently modified. If a page-piece dictionary (PieceInfo) is present, the |
| 556 * modification date is used to ascertain which of the application data dic- |
| 557 * tionaries that it contains correspond to the current content of the page |
| 558 * (see Section 9.4, "Page-Piece Dictionaries"). |
| 559 **/ |
| 560 bool has_LastModified() const { |
| 561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastM
odified", "", NULL)); |
| 562 } |
| 563 |
538 SkPdfDate LastModified() const { | 564 SkPdfDate LastModified() const { |
539 SkPdfDate ret; | 565 SkPdfDate ret; |
540 if (DateFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastModifie
d", "", &ret)) return ret; | 566 if (DateFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "LastModifie
d", "", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 567 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return SkPdfDate(); | 568 return SkPdfDate(); |
543 } | 569 } |
544 | 570 |
| 571 /** (Required; inheritable) A dictionary containing any resources required by |
| 572 * the page (see Section 3.7.2, "Resource Dictionaries"). If the page requires |
| 573 * no resources, the value of this entry should be an empty dictionary; omit- |
| 574 * ting the entry entirely indicates that the resources are to be inherited fro
m |
| 575 * an ancestor node in the page tree. |
| 576 **/ |
| 577 bool has_Resources() const { |
| 578 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", NULL)); |
| 579 } |
| 580 |
545 SkPdfDictionary* Resources() const { | 581 SkPdfDictionary* Resources() const { |
546 SkPdfDictionary* ret; | 582 SkPdfDictionary* ret; |
547 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", &ret)) return ret; | 583 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Resou
rces", "", &ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 584 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return NULL; | 585 return NULL; |
550 } | 586 } |
551 | 587 |
| 588 /** (Required; inheritable) A rectangle (see Section 3.8.3, "Rectangles"), ex- |
| 589 * pressed in default user space units, defining the boundaries of the physical |
| 590 * medium on which the page is intended to be displayed or printed (see |
| 591 * Section 9.10.1, "Page Boundaries"). |
| 592 **/ |
| 593 bool has_MediaBox() const { |
| 594 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Media
Box", "", NULL)); |
| 595 } |
| 596 |
552 SkRect MediaBox() const { | 597 SkRect MediaBox() const { |
553 SkRect ret; | 598 SkRect ret; |
554 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MediaBox"
, "", &ret)) return ret; | 599 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "MediaBox"
, "", &ret)) return ret; |
555 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 600 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
556 return SkRect(); | 601 return SkRect(); |
557 } | 602 } |
558 | 603 |
| 604 /** (Optional; inheritable) A rectangle, expressed in default user space units, |
| 605 * defining the visible region of default user space. When the page is dis- |
| 606 * played or printed, its contents are to be clipped (cropped) to this rectangl
e |
| 607 * and then imposed on the output medium in some implementation- |
| 608 * defined manner (see Section 9.10.1, "Page Boundaries"). Default value: |
| 609 * the value of MediaBox. |
| 610 **/ |
| 611 bool has_CropBox() const { |
| 612 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropB
ox", "", NULL)); |
| 613 } |
| 614 |
559 SkRect CropBox() const { | 615 SkRect CropBox() const { |
560 SkRect ret; | 616 SkRect ret; |
561 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropBox",
"", &ret)) return ret; | 617 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CropBox",
"", &ret)) return ret; |
562 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 618 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
563 return SkRect(); | 619 return SkRect(); |
564 } | 620 } |
565 | 621 |
| 622 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 623 * fining the region to which the contents of the page should be clipped |
| 624 * when output in a production environment (see Section 9.10.1, "Page |
| 625 * Boundaries"). Default value: the value of CropBox. |
| 626 **/ |
| 627 bool has_BleedBox() const { |
| 628 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Bleed
Box", "", NULL)); |
| 629 } |
| 630 |
566 SkRect BleedBox() const { | 631 SkRect BleedBox() const { |
567 SkRect ret; | 632 SkRect ret; |
568 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BleedBox"
, "", &ret)) return ret; | 633 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BleedBox"
, "", &ret)) return ret; |
569 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 634 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
570 return SkRect(); | 635 return SkRect(); |
571 } | 636 } |
572 | 637 |
| 638 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 639 * fining the intended dimensions of the finished page after trimming (see |
| 640 * Section 9.10.1, "Page Boundaries"). Default value: the value of CropBox. |
| 641 **/ |
| 642 bool has_TrimBox() const { |
| 643 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimB
ox", "", NULL)); |
| 644 } |
| 645 |
573 SkRect TrimBox() const { | 646 SkRect TrimBox() const { |
574 SkRect ret; | 647 SkRect ret; |
575 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimBox",
"", &ret)) return ret; | 648 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "TrimBox",
"", &ret)) return ret; |
576 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 649 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
577 return SkRect(); | 650 return SkRect(); |
578 } | 651 } |
579 | 652 |
| 653 /** (Optional; PDF 1.3) A rectangle, expressed in default user space units, de- |
| 654 * fining the extent of the page's meaningful content (including potential |
| 655 * white space) as intended by the page's creator (see Section 9.10.1, "Page |
| 656 * Boundaries"). Default value: the value of CropBox. |
| 657 **/ |
| 658 bool has_ArtBox() const { |
| 659 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBo
x", "", NULL)); |
| 660 } |
| 661 |
580 SkRect ArtBox() const { | 662 SkRect ArtBox() const { |
581 SkRect ret; | 663 SkRect ret; |
582 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBox",
"", &ret)) return ret; | 664 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ArtBox",
"", &ret)) return ret; |
583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 665 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
584 return SkRect(); | 666 return SkRect(); |
585 } | 667 } |
586 | 668 |
| 669 /** (Optional) A box color information dictionary specifying the colors and |
| 670 * other visual characteristics to be used in displaying guidelines on the |
| 671 * screen for the various page boundaries (see "Display of Page Boundaries" |
| 672 * on page 679). If this entry is absent, the viewer application should use its |
| 673 * own current default settings. |
| 674 **/ |
| 675 bool has_BoxColorInfo() const { |
| 676 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", NULL)); |
| 677 } |
| 678 |
587 SkPdfDictionary* BoxColorInfo() const { | 679 SkPdfDictionary* BoxColorInfo() const { |
588 SkPdfDictionary* ret; | 680 SkPdfDictionary* ret; |
589 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", &ret)) return ret; | 681 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BoxCo
lorInfo", "", &ret)) return ret; |
590 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 682 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
591 return NULL; | 683 return NULL; |
592 } | 684 } |
593 | 685 |
| 686 /** (Optional) A content stream (see Section 3.7.1, "Content Streams") de- |
| 687 * scribing the contents of this page. If this entry is absent, the page is emp
ty. |
| 688 * The value may be either a single stream or an array of streams. If it is an |
| 689 * array, the effect is as if all of the streams in the array were concatenated
, in |
| 690 * order, to form a single stream. This allows a program generating a PDF |
| 691 * file to create image objects and other resources as they occur, even though |
| 692 * they interrupt the content stream. The division between streams may |
| 693 * occur only at the boundaries between lexical tokens (see Section 3.1, "Lex- |
| 694 * ical Conventions"), but is unrelated to the page's logical content or orga- |
| 695 * nization. Applications that consume or produce PDF files are not required |
| 696 * to preserve the existing structure of the Contents array. (See implementa- |
| 697 * tion note 22 in Appendix H.) |
| 698 **/ |
| 699 bool has_Contents() const { |
| 700 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 701 } |
| 702 |
594 bool isContentsAStream() const { | 703 bool isContentsAStream() const { |
595 SkPdfObject* ret = NULL; | 704 SkPdfObject* ret = NULL; |
596 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; | 705 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; |
597 return ret->podofo()->HasStream(); | 706 return ret->podofo()->HasStream(); |
598 } | 707 } |
599 | 708 |
600 SkPdfStream getContentsAsStream() const { | 709 SkPdfStream getContentsAsStream() const { |
601 SkPdfStream ret = SkPdfStream(); | 710 SkPdfStream ret = SkPdfStream(); |
602 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | 711 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; |
603 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 712 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
604 return SkPdfStream(); | 713 return SkPdfStream(); |
605 } | 714 } |
606 | 715 |
607 bool isContentsAArray() const { | 716 bool isContentsAArray() const { |
608 SkPdfObject* ret = NULL; | 717 SkPdfObject* ret = NULL; |
609 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; | 718 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents
", "", &ret)) return false; |
610 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 719 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
611 } | 720 } |
612 | 721 |
613 SkPdfArray getContentsAsArray() const { | 722 SkPdfArray getContentsAsArray() const { |
614 SkPdfArray ret = SkPdfArray(); | 723 SkPdfArray ret = SkPdfArray(); |
615 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents",
"", &ret)) return ret; | 724 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents",
"", &ret)) return ret; |
616 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 725 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
617 return SkPdfArray(); | 726 return SkPdfArray(); |
618 } | 727 } |
619 | 728 |
| 729 /** (Optional; inheritable) The number of degrees by which the page should |
| 730 * be rotated clockwise when displayed or printed. The value must be a mul- |
| 731 * tiple of 90. Default value: 0. |
| 732 **/ |
| 733 bool has_Rotate() const { |
| 734 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotat
e", "", NULL)); |
| 735 } |
| 736 |
620 long Rotate() const { | 737 long Rotate() const { |
621 long ret; | 738 long ret; |
622 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotate", ""
, &ret)) return ret; | 739 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotate", ""
, &ret)) return ret; |
623 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 740 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
624 return 0; | 741 return 0; |
625 } | 742 } |
626 | 743 |
| 744 /** (Optional; PDF 1.4) A group attributes dictionary specifying the attributes |
| 745 * of the page's page group for use in the transparent imaging model (see |
| 746 * Sections 7.3.6, "Page Group," and 7.5.5, "Transparency Group XObjects"). |
| 747 **/ |
| 748 bool has_Group() const { |
| 749 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", NULL)); |
| 750 } |
| 751 |
627 SkPdfDictionary* Group() const { | 752 SkPdfDictionary* Group() const { |
628 SkPdfDictionary* ret; | 753 SkPdfDictionary* ret; |
629 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", &ret)) return ret; | 754 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Group
", "", &ret)) return ret; |
630 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 755 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
631 return NULL; | 756 return NULL; |
632 } | 757 } |
633 | 758 |
| 759 /** (Optional) A stream object defining the page's thumbnail image (see Sec- |
| 760 * tion 8.2.3, "Thumbnail Images"). |
| 761 **/ |
| 762 bool has_Thumb() const { |
| 763 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb
", "", NULL)); |
| 764 } |
| 765 |
634 SkPdfStream Thumb() const { | 766 SkPdfStream Thumb() const { |
635 SkPdfStream ret; | 767 SkPdfStream ret; |
636 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb", "
", &ret)) return ret; | 768 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Thumb", "
", &ret)) return ret; |
637 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 769 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
638 return SkPdfStream(); | 770 return SkPdfStream(); |
639 } | 771 } |
640 | 772 |
| 773 /** (Optional; PDF 1.1; recommended if the page contains article beads) An ar- |
| 774 * ray of indirect references to article beads appearing on the page (see Sec- |
| 775 * tion 8.3.2, "Articles"; see also implementation note 23 in Appendix H). |
| 776 * The beads are listed in the array in natural reading order. |
| 777 **/ |
| 778 bool has_B() const { |
| 779 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", NULL)); |
| 780 } |
| 781 |
641 SkPdfArray B() const { | 782 SkPdfArray B() const { |
642 SkPdfArray ret; | 783 SkPdfArray ret; |
643 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &r
et)) return ret; | 784 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &r
et)) return ret; |
644 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 785 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
645 return SkPdfArray(); | 786 return SkPdfArray(); |
646 } | 787 } |
647 | 788 |
| 789 /** (Optional; PDF 1.1) The page's display duration (also called its advance |
| 790 * timing): the maximum length of time, in seconds, that the page will be |
| 791 * displayed during presentations before the viewer application automati- |
| 792 * cally advances to the next page (see Section 8.3.3, "Presentations"). By |
| 793 * default, the viewer does not advance automatically. |
| 794 **/ |
| 795 bool has_Dur() const { |
| 796 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur",
"", NULL)); |
| 797 } |
| 798 |
648 double Dur() const { | 799 double Dur() const { |
649 double ret; | 800 double ret; |
650 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur", "",
&ret)) return ret; | 801 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dur", "",
&ret)) return ret; |
651 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 802 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
652 return 0; | 803 return 0; |
653 } | 804 } |
654 | 805 |
| 806 /** (Optional; PDF 1.1) A transition dictionary describing the transition effect |
| 807 * to be used when displaying the page during presentations (see Section |
| 808 * 8.3.3, "Presentations"). |
| 809 **/ |
| 810 bool has_Trans() const { |
| 811 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", NULL)); |
| 812 } |
| 813 |
655 SkPdfDictionary* Trans() const { | 814 SkPdfDictionary* Trans() const { |
656 SkPdfDictionary* ret; | 815 SkPdfDictionary* ret; |
657 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", &ret)) return ret; | 816 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Trans
", "", &ret)) return ret; |
658 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 817 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
659 return NULL; | 818 return NULL; |
660 } | 819 } |
661 | 820 |
| 821 /** (Optional) An array of annotation dictionaries representing annotations |
| 822 * associated with the page (see Section 8.4, "Annotations"). |
| 823 **/ |
| 824 bool has_Annots() const { |
| 825 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annot
s", "", NULL)); |
| 826 } |
| 827 |
662 SkPdfArray Annots() const { | 828 SkPdfArray Annots() const { |
663 SkPdfArray ret; | 829 SkPdfArray ret; |
664 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "
", &ret)) return ret; | 830 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "
", &ret)) return ret; |
665 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 831 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
666 return SkPdfArray(); | 832 return SkPdfArray(); |
667 } | 833 } |
668 | 834 |
| 835 /** (Optional; PDF 1.2) An additional-actions dictionary defining actions to |
| 836 * be performed when the page is opened or closed (see Section 8.5.2, "Trig- |
| 837 * ger Events"; see also implementation note 24 in Appendix H). |
| 838 **/ |
| 839 bool has_AA() const { |
| 840 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", NULL)); |
| 841 } |
| 842 |
669 SkPdfDictionary* AA() const { | 843 SkPdfDictionary* AA() const { |
670 SkPdfDictionary* ret; | 844 SkPdfDictionary* ret; |
671 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", &ret)) return ret; | 845 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", &ret)) return ret; |
672 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 846 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
673 return NULL; | 847 return NULL; |
674 } | 848 } |
675 | 849 |
| 850 /** (Optional; PDF 1.4) A metadata stream containing metadata for the page |
| 851 * (see Section 9.2.2, "Metadata Streams"). |
| 852 **/ |
| 853 bool has_Metadata() const { |
| 854 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metad
ata", "", NULL)); |
| 855 } |
| 856 |
676 SkPdfStream Metadata() const { | 857 SkPdfStream Metadata() const { |
677 SkPdfStream ret; | 858 SkPdfStream ret; |
678 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; | 859 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Metadata"
, "", &ret)) return ret; |
679 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 860 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
680 return SkPdfStream(); | 861 return SkPdfStream(); |
681 } | 862 } |
682 | 863 |
| 864 /** (Optional; PDF 1.3) A page-piece dictionary associated with the page (see |
| 865 * Section 9.4, "Page-Piece Dictionaries"). |
| 866 **/ |
| 867 bool has_PieceInfo() const { |
| 868 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", NULL)); |
| 869 } |
| 870 |
683 SkPdfDictionary* PieceInfo() const { | 871 SkPdfDictionary* PieceInfo() const { |
684 SkPdfDictionary* ret; | 872 SkPdfDictionary* ret; |
685 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", &ret)) return ret; | 873 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Piece
Info", "", &ret)) return ret; |
686 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 874 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
687 return NULL; | 875 return NULL; |
688 } | 876 } |
689 | 877 |
| 878 /** (Required if the page contains structural content items; PDF 1.3) The inte- |
| 879 * ger key of the page's entry in the structural parent tree (see "Finding Stru
c- |
| 880 * ture Elements from Content Items" on page 600). |
| 881 **/ |
| 882 bool has_StructParents() const { |
| 883 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParents", "", NULL)); |
| 884 } |
| 885 |
690 long StructParents() const { | 886 long StructParents() const { |
691 long ret; | 887 long ret; |
692 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen
ts", "", &ret)) return ret; | 888 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen
ts", "", &ret)) return ret; |
693 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 889 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
694 return 0; | 890 return 0; |
695 } | 891 } |
696 | 892 |
| 893 /** (Optional; PDF 1.3; indirect reference preferred) The digital identifier of
the |
| 894 * page's parent Web Capture content set (see Section 9.9.5, "Object At- |
| 895 * tributes Related to Web Capture"). |
| 896 **/ |
| 897 bool has_ID() const { |
| 898 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); |
| 899 } |
| 900 |
697 std::string ID() const { | 901 std::string ID() const { |
698 std::string ret; | 902 std::string ret; |
699 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "",
&ret)) return ret; | 903 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "",
&ret)) return ret; |
700 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 904 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
701 return ""; | 905 return ""; |
702 } | 906 } |
703 | 907 |
| 908 /** (Optional; PDF 1.3) The page's preferred zoom (magnification) factor: the |
| 909 * factor by which it should be scaled to achieve the "natural" display magni- |
| 910 * fication (see Section 9.9.5, "Object Attributes Related to Web Capture"). |
| 911 **/ |
| 912 bool has_PZ() const { |
| 913 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ",
"", NULL)); |
| 914 } |
| 915 |
704 double PZ() const { | 916 double PZ() const { |
705 double ret; | 917 double ret; |
706 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ", "",
&ret)) return ret; | 918 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PZ", "",
&ret)) return ret; |
707 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 919 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
708 return 0; | 920 return 0; |
709 } | 921 } |
710 | 922 |
| 923 /** (Optional; PDF 1.3) A separation dictionary containing information need- |
| 924 * ed to generate color separations for the page (see Section 9.10.3, "Separa- |
| 925 * tion Dictionaries"). |
| 926 **/ |
| 927 bool has_SeparationInfo() const { |
| 928 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", NULL)); |
| 929 } |
| 930 |
711 SkPdfDictionary* SeparationInfo() const { | 931 SkPdfDictionary* SeparationInfo() const { |
712 SkPdfDictionary* ret; | 932 SkPdfDictionary* ret; |
713 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", &ret)) return ret; | 933 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Separ
ationInfo", "", &ret)) return ret; |
714 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 934 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
715 return NULL; | 935 return NULL; |
716 } | 936 } |
717 | 937 |
718 }; | 938 }; |
719 | 939 |
720 #endif // __DEFINED__SkPdfPageObjectDictionary | 940 #endif // __DEFINED__SkPdfPageObjectDictionary |
OLD | NEW |