OLD | NEW |
1 #ifndef __DEFINED__SkPdfFreeTextAnnotationDictionary | 1 #ifndef __DEFINED__SkPdfFreeTextAnnotationDictionary |
2 #define __DEFINED__SkPdfFreeTextAnnotationDictionary | 2 #define __DEFINED__SkPdfFreeTextAnnotationDictionary |
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 // Additional entries specific to a free text annotation |
8 class SkPdfFreeTextAnnotationDictionary : public SkPdfDictionary { | 9 class SkPdfFreeTextAnnotationDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kFreeTextAnnotationDictionary
_SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kFreeTextAnnotationDictionary
_SkPdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kFreeTex
tAnnotationDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kFreeTex
tAnnotationDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() {r
eturn this;} | 14 virtual SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionary() {r
eturn this;} |
14 virtual const SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionar
y() const {return this;} | 15 virtual const SkPdfFreeTextAnnotationDictionary* asFreeTextAnnotationDictionar
y() const {return 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 SkPdfFreeTextAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, cons
t PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfFreeTextAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, cons
t PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfFreeTextAnnotationDictionary& operator=(const SkPdfFreeTextAnnotationDict
ionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodo
foObj; return *this;} | 523 SkPdfFreeTextAnnotationDictionary& operator=(const SkPdfFreeTextAnnotationDict
ionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodo
foObj; return *this;} |
523 | 524 |
| 525 /** (Required) The type of annotation that this dictionary describes; must be |
| 526 * FreeText for a free text annotation. |
| 527 **/ |
| 528 bool has_Subtype() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty
pe", "", NULL)); |
| 530 } |
| 531 |
524 std::string Subtype() const { | 532 std::string Subtype() const { |
525 std::string ret; | 533 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &ret)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", "
", &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 text to be displayed. |
| 540 **/ |
| 541 bool has_Contents() const { |
| 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 543 } |
| 544 |
531 std::string Contents() const { | 545 std::string Contents() const { |
532 std::string ret; | 546 std::string ret; |
533 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | 547 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return ""; | 549 return ""; |
536 } | 550 } |
537 | 551 |
| 552 /** (Required) The default appearance string to be used in formatting the text (
see |
| 553 * "Variable Text" on page 533). |
| 554 * Note: The annotation dictionary's AP entry, if present, takes precedence ove
r the DA |
| 555 * entry; see Table 8.10 on page 490 and Section 8.4.4, "Appearance Streams." |
| 556 **/ |
| 557 bool has_DA() const { |
| 558 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DA",
"", NULL)); |
| 559 } |
| 560 |
538 std::string DA() const { | 561 std::string DA() const { |
539 std::string ret; | 562 std::string ret; |
540 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DA", "",
&ret)) return ret; | 563 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DA", "",
&ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 564 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return ""; | 565 return ""; |
543 } | 566 } |
544 | 567 |
| 568 /** (Optional; PDF 1.4) A code specifying the form of quadding (justification) t
o be |
| 569 * used in displaying the annotation's text: |
| 570 * 0 Left-justified |
| 571 * 1 Centered |
| 572 * 2 Right-justified |
| 573 * Default value: 0 (left-justified). |
| 574 **/ |
| 575 bool has_Q() const { |
| 576 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Q", "
", NULL)); |
| 577 } |
| 578 |
545 long Q() const { | 579 long Q() const { |
546 long ret; | 580 long ret; |
547 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Q", "", &re
t)) return ret; | 581 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Q", "", &re
t)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 582 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return 0; | 583 return 0; |
550 } | 584 } |
551 | 585 |
552 }; | 586 }; |
553 | 587 |
554 #endif // __DEFINED__SkPdfFreeTextAnnotationDictionary | 588 #endif // __DEFINED__SkPdfFreeTextAnnotationDictionary |
OLD | NEW |