| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfTextAnnotationDictionary | 1 #ifndef __DEFINED__SkPdfTextAnnotationDictionary |
| 2 #define __DEFINED__SkPdfTextAnnotationDictionary | 2 #define __DEFINED__SkPdfTextAnnotationDictionary |
| 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 // Additional entries specific to a text annotation | 9 // Additional entries specific to a text annotation |
| 10 class SkPdfTextAnnotationDictionary : public SkPdfDictionary { | 10 class SkPdfTextAnnotationDictionary : public SkPdfDictionary { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 SkPdfTextAnnotationDictionary& operator=(const SkPdfTextAnnotationDictionary&
from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r
eturn *this;} | 526 SkPdfTextAnnotationDictionary& operator=(const SkPdfTextAnnotationDictionary&
from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r
eturn *this;} |
| 527 | 527 |
| 528 /** (Required) The type of annotation that this dictionary describes; must be Te
xt | 528 /** (Required) The type of annotation that this dictionary describes; must be Te
xt |
| 529 * for a text annotation. | 529 * for a text annotation. |
| 530 **/ | 530 **/ |
| 531 bool has_Subtype() const { | 531 bool has_Subtype() const { |
| 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 std::string Subtype() const { | 535 std::string Subtype() const; |
| 536 std::string ret; | |
| 537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | |
| 538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 539 return ""; | |
| 540 } | |
| 541 | |
| 542 /** (Required) The text to be displayed in the pop-up window when the annotation | 536 /** (Required) The text to be displayed in the pop-up window when the annotation |
| 543 * is opened. Carriage returns may be used to separate the text into paragraphs
. | 537 * is opened. Carriage returns may be used to separate the text into paragraphs
. |
| 544 **/ | 538 **/ |
| 545 bool has_Contents() const { | 539 bool has_Contents() const { |
| 546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); | 540 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 547 } | 541 } |
| 548 | 542 |
| 549 std::string Contents() const { | 543 std::string Contents() const; |
| 550 std::string ret; | |
| 551 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | |
| 552 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 553 return ""; | |
| 554 } | |
| 555 | |
| 556 /** (Optional) A flag specifying whether the annotation should initially be disp
layed | 544 /** (Optional) A flag specifying whether the annotation should initially be disp
layed |
| 557 * open. Default value: false (closed). | 545 * open. Default value: false (closed). |
| 558 **/ | 546 **/ |
| 559 bool has_Open() const { | 547 bool has_Open() const { |
| 560 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Open"
, "", NULL)); | 548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Open"
, "", NULL)); |
| 561 } | 549 } |
| 562 | 550 |
| 563 bool Open() const { | 551 bool Open() const; |
| 564 bool ret; | |
| 565 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Open", "",
&ret)) return ret; | |
| 566 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 567 return false; | |
| 568 } | |
| 569 | |
| 570 /** (Optional) The name of an icon to be used in displaying the annotation. View
er | 552 /** (Optional) The name of an icon to be used in displaying the annotation. View
er |
| 571 * applications should provide predefined icon appearances for at least the fol
low- | 553 * applications should provide predefined icon appearances for at least the fol
low- |
| 572 * ing standard names: | 554 * ing standard names: |
| 573 * Comment Key Note | 555 * Comment Key Note |
| 574 * Help NewParagraph Paragraph | 556 * Help NewParagraph Paragraph |
| 575 * Insert | 557 * Insert |
| 576 * Additional names may be supported as well. Default value: Note. | 558 * Additional names may be supported as well. Default value: Note. |
| 577 * Note: The annotation dictionary's AP entry, if present, takes precedence ove
r the | 559 * Note: The annotation dictionary's AP entry, if present, takes precedence ove
r the |
| 578 * Name entry; see Table 8.10 on page 490 and Section 8.4.4, "Appearance Stream
s." | 560 * Name entry; see Table 8.10 on page 490 and Section 8.4.4, "Appearance Stream
s." |
| 579 **/ | 561 **/ |
| 580 bool has_Name() const { | 562 bool has_Name() const { |
| 581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name"
, "", NULL)); | 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name"
, "", NULL)); |
| 582 } | 564 } |
| 583 | 565 |
| 584 std::string Name() const { | 566 std::string Name() const; |
| 585 std::string ret; | |
| 586 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "",
&ret)) return ret; | |
| 587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 588 return ""; | |
| 589 } | |
| 590 | |
| 591 }; | 567 }; |
| 592 | 568 |
| 593 #endif // __DEFINED__SkPdfTextAnnotationDictionary | 569 #endif // __DEFINED__SkPdfTextAnnotationDictionary |
| OLD | NEW |