OLD | NEW |
1 #ifndef __DEFINED__SkPdfSquareOrCircleAnnotation | 1 #ifndef __DEFINED__SkPdfSquareOrCircleAnnotation |
2 #define __DEFINED__SkPdfSquareOrCircleAnnotation | 2 #define __DEFINED__SkPdfSquareOrCircleAnnotation |
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 square or circle annotation |
8 class SkPdfSquareOrCircleAnnotation : public SkPdfDictionary { | 9 class SkPdfSquareOrCircleAnnotation : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kSquareOrCircleAnnotation_SkP
dfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kSquareOrCircleAnnotation_SkP
dfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSquareO
rCircleAnnotation_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSquareO
rCircleAnnotation_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfSquareOrCircleAnnotation* asSquareOrCircleAnnotation() {return th
is;} | 14 virtual SkPdfSquareOrCircleAnnotation* asSquareOrCircleAnnotation() {return th
is;} |
14 virtual const SkPdfSquareOrCircleAnnotation* asSquareOrCircleAnnotation() cons
t {return this;} | 15 virtual const SkPdfSquareOrCircleAnnotation* asSquareOrCircleAnnotation() cons
t {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 SkPdfSquareOrCircleAnnotation(const PdfMemDocument* podofoDoc = NULL, const Pd
fObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfSquareOrCircleAnnotation(const PdfMemDocument* podofoDoc = NULL, const Pd
fObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfSquareOrCircleAnnotation& operator=(const SkPdfSquareOrCircleAnnotation&
from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r
eturn *this;} | 523 SkPdfSquareOrCircleAnnotation& operator=(const SkPdfSquareOrCircleAnnotation&
from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; r
eturn *this;} |
523 | 524 |
| 525 /** (Required) The type of annotation that this dictionary describes; must be Sq
uare |
| 526 * or Circle for a square or circle annotation, respectively. |
| 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 in the pop-up window when the annotation |
| 540 * is opened. Carriage returns may be used to separate the text into paragraphs
. |
| 541 **/ |
| 542 bool has_Contents() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 544 } |
| 545 |
531 std::string Contents() const { | 546 std::string Contents() const { |
532 std::string ret; | 547 std::string ret; |
533 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | 548 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &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 /** (Optional) A border style dictionary (see Table 8.12 on page 495) specifying
the |
| 554 * line width and dash pattern to be used in drawing the rectangle or ellipse. |
| 555 * Note: The annotation dictionary's AP entry, if present, takes precedence ove
r the |
| 556 * Rect and BS entries; see Table 8.10 on page 490 and Section 8.4.4, "Appearan
ce |
| 557 * Streams." |
| 558 **/ |
| 559 bool has_BS() const { |
| 560 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", NULL)); |
| 561 } |
| 562 |
538 SkPdfDictionary* BS() const { | 563 SkPdfDictionary* BS() const { |
539 SkPdfDictionary* ret; | 564 SkPdfDictionary* ret; |
540 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", &ret)) return ret; | 565 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "BS",
"", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 566 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return NULL; | 567 return NULL; |
543 } | 568 } |
544 | 569 |
| 570 /** (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0 specif
ying |
| 571 * the components, in the DeviceRGB color space, of the interior color with whi
ch to |
| 572 * fill the annotation's rectangle or ellipse (see Table 8.19). If this entry i
s absent, |
| 573 * the interior of the annotation is left transparent. |
| 574 **/ |
| 575 bool has_IC() const { |
| 576 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC",
"", NULL)); |
| 577 } |
| 578 |
545 SkPdfArray IC() const { | 579 SkPdfArray IC() const { |
546 SkPdfArray ret; | 580 SkPdfArray ret; |
547 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", &
ret)) return ret; | 581 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IC", "", &
ret)) 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 SkPdfArray(); | 583 return SkPdfArray(); |
550 } | 584 } |
551 | 585 |
552 }; | 586 }; |
553 | 587 |
554 #endif // __DEFINED__SkPdfSquareOrCircleAnnotation | 588 #endif // __DEFINED__SkPdfSquareOrCircleAnnotation |
OLD | NEW |