OLD | NEW |
1 #ifndef __DEFINED__SkPdfAnnotationDictionary | 1 #ifndef __DEFINED__SkPdfAnnotationDictionary |
2 #define __DEFINED__SkPdfAnnotationDictionary | 2 #define __DEFINED__SkPdfAnnotationDictionary |
3 | 3 |
4 #include "SkPdfEnums_autogen.h" | 4 #include "SkPdfEnums_autogen.h" |
5 #include "SkPdfArray_autogen.h" | 5 #include "SkPdfArray_autogen.h" |
6 #include "SkPdfDictionary_autogen.h" | 6 #include "SkPdfDictionary_autogen.h" |
7 | 7 |
| 8 // Entries common to all annotation dictionaries |
8 class SkPdfAnnotationDictionary : public SkPdfDictionary { | 9 class SkPdfAnnotationDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kAnnotationDictionary_SkPdfOb
jectType;} | 11 virtual SkPdfObjectType getType() const { return kAnnotationDictionary_SkPdfOb
jectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kAnnotat
ionDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kAnnotat
ionDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfAnnotationDictionary* asAnnotationDictionary() {return this;} | 14 virtual SkPdfAnnotationDictionary* asAnnotationDictionary() {return this;} |
14 virtual const SkPdfAnnotationDictionary* asAnnotationDictionary() const {retur
n this;} | 15 virtual const SkPdfAnnotationDictionary* asAnnotationDictionary() 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 SkPdfAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObj
ect* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfAnnotationDictionary(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 SkPdfAnnotationDictionary& operator=(const SkPdfAnnotationDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} | 523 SkPdfAnnotationDictionary& operator=(const SkPdfAnnotationDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} |
523 | 524 |
| 525 /** (Optional) The type of PDF object that this dictionary describes; if present
, |
| 526 * must be Annot for an annotation 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 /** (Required) The type of annotation that this dictionary describes; see Table |
| 540 * 8.14 on page 499 for specific values. |
| 541 **/ |
| 542 bool has_Subtype() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 544 } |
| 545 |
531 std::string Subtype() const { | 546 std::string Subtype() const { |
532 std::string ret; | 547 std::string ret; |
533 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | 548 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &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 ""; | 550 return ""; |
536 } | 551 } |
537 | 552 |
| 553 /** (Required or optional, depending on the annotation type) Text to be displaye
d |
| 554 * for the annotation or, if this type of annotation does not display text, an
al- |
| 555 * ternate description of the annotation's contents in human-readable form. In |
| 556 * either case, this text is useful when extracting the document's contents in |
| 557 * support of accessibility to disabled users or for other purposes (see Sectio
n |
| 558 * 9.8.2, "Alternate Descriptions"). |
| 559 **/ |
| 560 bool has_Contents() const { |
| 561 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 562 } |
| 563 |
538 std::string Contents() const { | 564 std::string Contents() const { |
539 std::string ret; | 565 std::string ret; |
540 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | 566 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &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 ""; | 568 return ""; |
543 } | 569 } |
544 | 570 |
| 571 /** (Optional; PDF 1.3; not used in FDF files) An indirect reference to the page |
| 572 * object with which this annotation is associated. |
| 573 **/ |
| 574 bool has_P() const { |
| 575 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", "
", NULL)); |
| 576 } |
| 577 |
545 SkPdfDictionary* P() const { | 578 SkPdfDictionary* P() const { |
546 SkPdfDictionary* ret; | 579 SkPdfDictionary* ret; |
547 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", "
", &ret)) return ret; | 580 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", "
", &ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 581 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return NULL; | 582 return NULL; |
550 } | 583 } |
551 | 584 |
| 585 /** (Required) The annotation rectangle, defining the location of the annotation |
| 586 * on the page in default user space units. |
| 587 **/ |
| 588 bool has_Rect() const { |
| 589 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rect"
, "", NULL)); |
| 590 } |
| 591 |
552 SkRect Rect() const { | 592 SkRect Rect() const { |
553 SkRect ret; | 593 SkRect ret; |
554 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rect", ""
, &ret)) return ret; | 594 if (SkRectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rect", ""
, &ret)) return ret; |
555 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 595 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
556 return SkRect(); | 596 return SkRect(); |
557 } | 597 } |
558 | 598 |
| 599 /** (Optional; PDF 1.4) The annotation name, a text string uniquely identifying |
| 600 * it among all the annotations on its page. |
| 601 **/ |
| 602 bool has_NM() const { |
| 603 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "NM",
"", NULL)); |
| 604 } |
| 605 |
| 606 /** (Optional; PDF 1.1) The date and time when the annotation was most |
| 607 * recently modified. The preferred format is a date string as described in Sec
- |
| 608 * tion 3.8.2, "Dates," but viewer applications should be prepared to accept an
d |
| 609 * display a string in any format. (See implementation note 59 in Appendix H.) |
| 610 **/ |
| 611 bool has_M() const { |
| 612 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "
", NULL)); |
| 613 } |
| 614 |
559 bool isMADate() const { | 615 bool isMADate() const { |
560 SkPdfObject* ret = NULL; | 616 SkPdfObject* ret = NULL; |
561 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "",
&ret)) return false; | 617 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "",
&ret)) return false; |
562 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 618 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
563 } | 619 } |
564 | 620 |
565 SkPdfDate getMAsDate() const { | 621 SkPdfDate getMAsDate() const { |
566 SkPdfDate ret = SkPdfDate(); | 622 SkPdfDate ret = SkPdfDate(); |
567 if (DateFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "", &re
t)) return ret; | 623 if (DateFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "", &re
t)) return ret; |
568 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 624 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
569 return SkPdfDate(); | 625 return SkPdfDate(); |
570 } | 626 } |
571 | 627 |
572 bool isMAString() const { | 628 bool isMAString() const { |
573 SkPdfObject* ret = NULL; | 629 SkPdfObject* ret = NULL; |
574 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "",
&ret)) return false; | 630 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "",
&ret)) return false; |
575 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 631 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
576 } | 632 } |
577 | 633 |
578 std::string getMAsString() const { | 634 std::string getMAsString() const { |
579 std::string ret = ""; | 635 std::string ret = ""; |
580 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "", &
ret)) return ret; | 636 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "M", "", &
ret)) return ret; |
581 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 637 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
582 return ""; | 638 return ""; |
583 } | 639 } |
584 | 640 |
| 641 /** (Optional; PDF 1.1) A set of flags specifying various characteristics of the
an- |
| 642 * notation (see Section 8.4.2, "Annotation Flags"). Default value: 0. |
| 643 **/ |
| 644 bool has_F() const { |
| 645 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
| 646 } |
| 647 |
585 long F() const { | 648 long F() const { |
586 long ret; | 649 long ret; |
587 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "", &re
t)) return ret; | 650 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "", &re
t)) return ret; |
588 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 651 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
589 return 0; | 652 return 0; |
590 } | 653 } |
591 | 654 |
| 655 /** (Optional; PDF 1.2) A border style dictionary specifying the characteristics
of |
| 656 * the annotation's border (see Section 8.4.3, "Border Styles"; see also imple- |
| 657 * mentation note 60 in Appendix H). |
| 658 * Note: This entry also specifies the width and dash pattern for the lines dra
wn by |
| 659 * line, square, circle, and ink annotations. See the note under Border (below)
for |
| 660 * additional information. |
| 661 **/ |
| 662 bool has_BS() const { |
| 663 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", NULL)); |
| 664 } |
| 665 |
592 SkPdfDictionary* BS() const { | 666 SkPdfDictionary* BS() const { |
593 SkPdfDictionary* ret; | 667 SkPdfDictionary* ret; |
594 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", &ret)) return ret; | 668 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", &ret)) return ret; |
595 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 669 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
596 return NULL; | 670 return NULL; |
597 } | 671 } |
598 | 672 |
| 673 /** (Optional) An array specifying the characteristics of the annotation's borde
r. |
| 674 * The border is specified as a "rounded rectangle." |
| 675 * In PDF 1.0, the array consists of three numbers defining the horizontal cor- |
| 676 * ner radius, vertical corner radius, and border width, all in default user sp
ace |
| 677 * units. If the corner radii are 0, the border has square (not rounded) corner
s; |
| 678 * if the border width is 0, no border is drawn. (See implementation note 61 in |
| 679 * Appendix H.) |
| 680 * In PDF 1.1, the array may have a fourth element, an optional dash array |
| 681 * defining a pattern of dashes and gaps to be used in drawing the border. Th
e |
| 682 * dash array is specified in the same format as in the line dash pattern par
ame- |
| 683 * ter of the graphics state (see "Line Dash Pattern" on page 155). For examp
le, |
| 684 * a Border value of [0 0 1 [3 2]] specifies a border 1 unit wide, with squar
e |
| 685 * corners, drawn with 3-unit dashes alternating with 2-unit gaps. Note that
no |
| 686 * dash phase is specified; the phase is assumed to be 0. (See implementation |
| 687 * note 62 in Appendix H.) |
| 688 * Note: In PDF 1.2 or later, annotations may ignore this entry and use the B
S |
| 689 * entry (see above) to specify their border styles instead. In PDF 1.2 and 1
.3, only |
| 690 * widget annotations do so; in PDF 1.4, all of the standard annotation types
ex- |
| 691 * cept Link (see Table 8.14 on page 499) use BS rather than Border if both a
re |
| 692 * present. For backward compatibility, however, Border is still supported fo
r all |
| 693 * annotation types. |
| 694 * Default value: [0 0 1]. |
| 695 **/ |
| 696 bool has_Border() const { |
| 697 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Borde
r", "", NULL)); |
| 698 } |
| 699 |
599 SkPdfArray Border() const { | 700 SkPdfArray Border() const { |
600 SkPdfArray ret; | 701 SkPdfArray ret; |
601 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Border", "
", &ret)) return ret; | 702 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Border", "
", &ret)) return ret; |
602 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 703 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
603 return SkPdfArray(); | 704 return SkPdfArray(); |
604 } | 705 } |
605 | 706 |
| 707 /** (Optional; PDF 1.2) An appearance dictionary specifying how the annotation |
| 708 * is presented visually on the page (see Section 8.4.4, "Appearance Streams"; |
| 709 * see also implementation note 60 in Appendix H). |
| 710 **/ |
| 711 bool has_AP() const { |
| 712 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", NULL)); |
| 713 } |
| 714 |
606 SkPdfDictionary* AP() const { | 715 SkPdfDictionary* AP() const { |
607 SkPdfDictionary* ret; | 716 SkPdfDictionary* ret; |
608 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", &ret)) return ret; | 717 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", &ret)) return ret; |
609 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 718 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
610 return NULL; | 719 return NULL; |
611 } | 720 } |
612 | 721 |
| 722 /** (Required if the appearance dictionary AP contains one or more subdictionari
es; |
| 723 * PDF 1.2) The annotation's appearance state, which selects the applicable |
| 724 * appearance stream from an appearance subdictionary (see Section 8.4.4, |
| 725 * "Appearance Streams"; see also implementation note 60 in Appendix H). |
| 726 **/ |
| 727 bool has_AS() const { |
| 728 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AS",
"", NULL)); |
| 729 } |
| 730 |
613 std::string AS() const { | 731 std::string AS() const { |
614 std::string ret; | 732 std::string ret; |
615 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AS", "", &r
et)) return ret; | 733 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AS", "", &r
et)) return ret; |
616 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 734 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
617 return ""; | 735 return ""; |
618 } | 736 } |
619 | 737 |
| 738 /** (Optional; PDF 1.1) An array of three numbers in the range 0.0 to 1.0, repre
- |
| 739 * senting the components of a color in the DeviceRGB color space. This color |
| 740 * will be used for the following purposes: |
| 741 * * The background of the annotation's icon when closed |
| 742 * * The title bar of the annotation's pop-up window |
| 743 * * The border of a link annotation |
| 744 **/ |
| 745 bool has_C() const { |
| 746 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "
", NULL)); |
| 747 } |
| 748 |
620 SkPdfArray C() const { | 749 SkPdfArray C() const { |
621 SkPdfArray ret; | 750 SkPdfArray ret; |
622 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &r
et)) return ret; | 751 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &r
et)) return ret; |
623 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 752 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
624 return SkPdfArray(); | 753 return SkPdfArray(); |
625 } | 754 } |
626 | 755 |
| 756 /** (Optional; PDF 1.4) The constant opacity value to be used in painting the |
| 757 * annotation (see Sections 7.1, "Overview of Transparency," and 7.2.6, "Shape |
| 758 * and Opacity Computations"). This value applies to all visible elements of |
| 759 * the annotation in its closed state (including its background and border), bu
t |
| 760 * not to the pop-up window that appears when the annotation is opened. The |
| 761 * specified value is used as the initial alpha constant (both stroking and non
- |
| 762 * stroking) for interpreting the annotation's appearance stream, if any (see |
| 763 * Section 8.4.4, "Appearance Streams," and "Constant Shape and Opacity" on |
| 764 * page 444). The implicit blend mode (see Section 7.2.4, "Blend Mode") is |
| 765 * Normal. Default value: 1.0. |
| 766 * Note: If no explicit appearance stream is defined for the
annotation, it will be |
| 767 * painted by implementation-dependent means that do not nece
ssarily conform to |
| 768 * the Adobe imaging model; in this case, the effect of this
entry is implementation- |
| 769 * dependent as well. |
| 770 * Note: This entry is recognized by all of the standard anno
tation types listed in |
| 771 * Table 8.14 on page 499 except Link, Movie, Widget, Printer
Mark, and TrapNet. |
| 772 **/ |
| 773 bool has_CA() const { |
| 774 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA",
"", NULL)); |
| 775 } |
| 776 |
627 double CA() const { | 777 double CA() const { |
628 double ret; | 778 double ret; |
629 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA", "",
&ret)) return ret; | 779 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CA", "",
&ret)) return ret; |
630 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 780 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
631 return 0; | 781 return 0; |
632 } | 782 } |
633 | 783 |
| 784 /** (Optional; PDF 1.1) The text label to be displayed in the title bar of the a
nno- |
| 785 * tation's pop-up window when open and active. |
| 786 **/ |
| 787 bool has_T() const { |
| 788 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "T", "
", NULL)); |
| 789 } |
| 790 |
634 std::string T() const { | 791 std::string T() const { |
635 std::string ret; | 792 std::string ret; |
636 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "T", "", &
ret)) return ret; | 793 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "T", "", &
ret)) return ret; |
637 // 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 |
638 return ""; | 795 return ""; |
639 } | 796 } |
640 | 797 |
| 798 /** (Optional; PDF 1.3) An indirect reference to a pop-up annotation for enter- |
| 799 * ing or editing the text associated with this annotation. |
| 800 **/ |
| 801 bool has_Popup() const { |
| 802 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Popup
", "", NULL)); |
| 803 } |
| 804 |
641 SkPdfDictionary* Popup() const { | 805 SkPdfDictionary* Popup() const { |
642 SkPdfDictionary* ret; | 806 SkPdfDictionary* ret; |
643 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Popup
", "", &ret)) return ret; | 807 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Popup
", "", &ret)) return ret; |
644 // 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 |
645 return NULL; | 809 return NULL; |
646 } | 810 } |
647 | 811 |
| 812 /** (Optional; PDF 1.1) An action to be performed when the annotation is acti- |
| 813 * vated (see Section 8.5, "Actions"). |
| 814 * Note: This entry is not permitted in link annotations if a Dest entry is pre
sent |
| 815 * (see "Link Annotations" on page 501). Also note that the A entry in movie an
no- |
| 816 * tations has a different meaning (see "Movie Annotations" on page 510). |
| 817 **/ |
| 818 bool has_A() const { |
| 819 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", NULL)); |
| 820 } |
| 821 |
648 SkPdfDictionary* A() const { | 822 SkPdfDictionary* A() const { |
649 SkPdfDictionary* ret; | 823 SkPdfDictionary* ret; |
650 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", &ret)) return ret; | 824 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", &ret)) return ret; |
651 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 825 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
652 return NULL; | 826 return NULL; |
653 } | 827 } |
654 | 828 |
| 829 /** (Optional; PDF 1.2) An additional-actions dictionary defining the anno- |
| 830 * tation's behavior in response to various trigger events (see Section 8.5.2, |
| 831 * "Trigger Events"). At the time of publication, this entry is used only by wi
d- |
| 832 * get annotations. |
| 833 **/ |
| 834 bool has_AA() const { |
| 835 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", NULL)); |
| 836 } |
| 837 |
655 SkPdfDictionary* AA() const { | 838 SkPdfDictionary* AA() const { |
656 SkPdfDictionary* ret; | 839 SkPdfDictionary* ret; |
657 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", &ret)) return ret; | 840 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AA",
"", &ret)) return ret; |
658 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 841 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
659 return NULL; | 842 return NULL; |
660 } | 843 } |
661 | 844 |
| 845 /** (Required if the annotation is a structural content item; PDF 1.3) The integ
er |
| 846 * key of the annotation's entry in the structural parent tree (see "Finding St
ruc- |
| 847 * ture Elements from Content Items" on page 600). |
| 848 **/ |
| 849 bool has_StructParent() const { |
| 850 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Struc
tParent", "", NULL)); |
| 851 } |
| 852 |
662 long StructParent() const { | 853 long StructParent() const { |
663 long ret; | 854 long ret; |
664 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen
t", "", &ret)) return ret; | 855 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "StructParen
t", "", &ret)) return ret; |
665 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 856 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
666 return 0; | 857 return 0; |
667 } | 858 } |
668 | 859 |
669 }; | 860 }; |
670 | 861 |
671 #endif // __DEFINED__SkPdfAnnotationDictionary | 862 #endif // __DEFINED__SkPdfAnnotationDictionary |
OLD | NEW |