OLD | NEW |
1 #ifndef __DEFINED__SkPdfMovieAnnotationDictionary | 1 #ifndef __DEFINED__SkPdfMovieAnnotationDictionary |
2 #define __DEFINED__SkPdfMovieAnnotationDictionary | 2 #define __DEFINED__SkPdfMovieAnnotationDictionary |
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 movie annotation |
8 class SkPdfMovieAnnotationDictionary : public SkPdfDictionary { | 9 class SkPdfMovieAnnotationDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kMovieAnnotationDictionary_Sk
PdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kMovieAnnotationDictionary_Sk
PdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kMovieAn
notationDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kMovieAn
notationDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfMovieAnnotationDictionary* asMovieAnnotationDictionary() {return
this;} | 14 virtual SkPdfMovieAnnotationDictionary* asMovieAnnotationDictionary() {return
this;} |
14 virtual const SkPdfMovieAnnotationDictionary* asMovieAnnotationDictionary() co
nst {return this;} | 15 virtual const SkPdfMovieAnnotationDictionary* asMovieAnnotationDictionary() 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 SkPdfMovieAnnotationDictionary(const PdfMemDocument* podofoDoc = NULL, const P
dfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfMovieAnnotationDictionary(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 SkPdfMovieAnnotationDictionary& operator=(const SkPdfMovieAnnotationDictionary
& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj;
return *this;} | 523 SkPdfMovieAnnotationDictionary& operator=(const SkPdfMovieAnnotationDictionary
& 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 Mo
vie |
| 526 * for a movie 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 movie dictionary describing the movie's static characteristics
(see |
| 540 * Section 8.8, "Movies"). |
| 541 **/ |
| 542 bool has_Movie() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Movie
", "", NULL)); |
| 544 } |
| 545 |
531 SkPdfDictionary* Movie() const { | 546 SkPdfDictionary* Movie() const { |
532 SkPdfDictionary* ret; | 547 SkPdfDictionary* ret; |
533 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Movie
", "", &ret)) return ret; | 548 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Movie
", "", &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 NULL; | 550 return NULL; |
536 } | 551 } |
537 | 552 |
| 553 /** (Optional; PDF 1.4) An alternate representation of the annotation's contents
in |
| 554 * human-readable form, useful when extracting the document's contents in sup- |
| 555 * port of accessibility to disabled users or for other purposes (see Section 9
.8.2, |
| 556 * "Alternate 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) A flag or dictionary specifying whether and how to play the movie |
| 570 * when the annotation is activated. If this value is a dictionary, it is a mov
ie activa- |
| 571 * tion dictionary (see Section 8.8, "Movies") specifying how to play the movie
; if it |
| 572 * is the boolean value true, the movie should be played using default activati
on |
| 573 * parameters; if it is false, the movie should not be played at all. Default v
alue: |
| 574 * true. |
| 575 **/ |
| 576 bool has_A() const { |
| 577 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", NULL)); |
| 578 } |
| 579 |
545 bool isAABoolean() const { | 580 bool isAABoolean() const { |
546 SkPdfObject* ret = NULL; | 581 SkPdfObject* ret = NULL; |
547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "",
&ret)) return false; | 582 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "",
&ret)) return false; |
548 return ret->podofo()->GetDataType() == ePdfDataType_Bool; | 583 return ret->podofo()->GetDataType() == ePdfDataType_Bool; |
549 } | 584 } |
550 | 585 |
551 bool getAAsBoolean() const { | 586 bool getAAsBoolean() const { |
552 bool ret = false; | 587 bool ret = false; |
553 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "", &re
t)) return ret; | 588 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "", &re
t)) return ret; |
554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 589 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
555 return false; | 590 return false; |
556 } | 591 } |
557 | 592 |
558 bool isAADictionary() const { | 593 bool isAADictionary() const { |
559 SkPdfObject* ret = NULL; | 594 SkPdfObject* ret = NULL; |
560 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "",
&ret)) return false; | 595 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "",
&ret)) return false; |
561 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 596 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
562 } | 597 } |
563 | 598 |
564 SkPdfDictionary* getAAsDictionary() const { | 599 SkPdfDictionary* getAAsDictionary() const { |
565 SkPdfDictionary* ret = NULL; | 600 SkPdfDictionary* ret = NULL; |
566 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", &ret)) return ret; | 601 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", "
", &ret)) return ret; |
567 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 602 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
568 return NULL; | 603 return NULL; |
569 } | 604 } |
570 | 605 |
571 }; | 606 }; |
572 | 607 |
573 #endif // __DEFINED__SkPdfMovieAnnotationDictionary | 608 #endif // __DEFINED__SkPdfMovieAnnotationDictionary |
OLD | NEW |