OLD | NEW |
1 #ifndef __DEFINED__SkPdfSoundAnnotationDictionary | 1 #ifndef __DEFINED__SkPdfSoundAnnotationDictionary |
2 #define __DEFINED__SkPdfSoundAnnotationDictionary | 2 #define __DEFINED__SkPdfSoundAnnotationDictionary |
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 sound annotation |
8 class SkPdfSoundAnnotationDictionary : public SkPdfDictionary { | 9 class SkPdfSoundAnnotationDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kSoundAnnotationDictionary_Sk
PdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kSoundAnnotationDictionary_Sk
PdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSoundAn
notationDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kSoundAn
notationDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfSoundAnnotationDictionary* asSoundAnnotationDictionary() {return
this;} | 14 virtual SkPdfSoundAnnotationDictionary* asSoundAnnotationDictionary() {return
this;} |
14 virtual const SkPdfSoundAnnotationDictionary* asSoundAnnotationDictionary() co
nst {return this;} | 15 virtual const SkPdfSoundAnnotationDictionary* asSoundAnnotationDictionary() co
nst {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 SkPdfSoundAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const P
dfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfSoundAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const P
dfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfSoundAnnotationDictionary& operator=(const SkPdfSoundAnnotationDictionary
& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj;
return *this;} | 523 SkPdfSoundAnnotationDictionary& operator=(const SkPdfSoundAnnotationDictionary
& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj;
return *this;} |
523 | 524 |
| 525 /** (Required) The type of annotation that this dictionary describes; must be So
und |
| 526 * for a sound 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) A sound object defining the sound to be played when the annotatio
n |
| 540 * is activated (see Section 8.7, "Sounds"). |
| 541 **/ |
| 542 bool has_Sound() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Sound
", "", NULL)); |
| 544 } |
| 545 |
531 SkPdfStream Sound() const { | 546 SkPdfStream Sound() const { |
532 SkPdfStream ret; | 547 SkPdfStream ret; |
533 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Sound", "
", &ret)) return ret; | 548 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Sound", "
", &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 SkPdfStream(); | 550 return SkPdfStream(); |
536 } | 551 } |
537 | 552 |
| 553 /** (Optional) Text to be displayed in a pop-up window for the annotation in pla
ce |
| 554 * of the sound, useful when extracting the document's contents in support of |
| 555 * accessibility to disabled users or for other purposes (see Section 9.8.2, "A
lternate |
| 556 * Descriptions"). |
| 557 **/ |
| 558 bool has_Contents() const { |
| 559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte
nts", "", NULL)); |
| 560 } |
| 561 |
538 std::string Contents() const { | 562 std::string Contents() const { |
539 std::string ret; | 563 std::string ret; |
540 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; | 564 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents"
, "", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 565 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return ""; | 566 return ""; |
543 } | 567 } |
544 | 568 |
| 569 /** (Optional) The name of an icon to be used in displaying the annotation. View
er |
| 570 * applications should provide predefined icon appearances for at least the sta
n- |
| 571 * dard names Speaker and Microphone; additional names may be supported as |
| 572 * well. Default value: Speaker. |
| 573 * Note: The annotation dictionary's AP entry, if present, takes precedence ove
r the |
| 574 * Name entry; see Table 8.10 on page 490 and Section 8.4.4, "Appearance Stream
s." |
| 575 **/ |
| 576 bool has_Name() const { |
| 577 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name"
, "", NULL)); |
| 578 } |
| 579 |
545 std::string Name() const { | 580 std::string Name() const { |
546 std::string ret; | 581 std::string ret; |
547 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "",
&ret)) return ret; | 582 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Name", "",
&ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return ""; | 584 return ""; |
550 } | 585 } |
551 | 586 |
552 }; | 587 }; |
553 | 588 |
554 #endif // __DEFINED__SkPdfSoundAnnotationDictionary | 589 #endif // __DEFINED__SkPdfSoundAnnotationDictionary |
OLD | NEW |