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