OLD | NEW |
1 #ifndef __DEFINED__SkPdfMovieDictionary | 1 #ifndef __DEFINED__SkPdfMovieDictionary |
2 #define __DEFINED__SkPdfMovieDictionary | 2 #define __DEFINED__SkPdfMovieDictionary |
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 // Entries in a movie dictionary |
8 class SkPdfMovieDictionary : public SkPdfDictionary { | 9 class SkPdfMovieDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kMovieDictionary_SkPdfObjectT
ype;} | 11 virtual SkPdfObjectType getType() const { return kMovieDictionary_SkPdfObjectT
ype;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kMovieDi
ctionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kMovieDi
ctionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfMovieDictionary* asMovieDictionary() {return this;} | 14 virtual SkPdfMovieDictionary* asMovieDictionary() {return this;} |
14 virtual const SkPdfMovieDictionary* asMovieDictionary() const {return this;} | 15 virtual const SkPdfMovieDictionary* asMovieDictionary() 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 SkPdfMovieDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject*
podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfMovieDictionary(const PdfMemDocument* podofoDoc = NULL, const 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 SkPdfMovieDictionary& operator=(const SkPdfMovieDictionary& from) {this->fPodo
foDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} | 523 SkPdfMovieDictionary& operator=(const SkPdfMovieDictionary& from) {this->fPodo
foDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} |
523 | 524 |
| 525 /** (Required) A file specification identifying a self-describing movie file. |
| 526 * Note: The format of a "self-describing movie file" is left unspecified, and
there is |
| 527 * no guarantee of portability. |
| 528 **/ |
| 529 bool has_F() const { |
| 530 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
| 531 } |
| 532 |
524 SkPdfFileSpec F() const { | 533 SkPdfFileSpec F() const { |
525 SkPdfFileSpec ret; | 534 SkPdfFileSpec ret; |
526 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; | 535 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; |
527 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 536 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
528 return SkPdfFileSpec(); | 537 return SkPdfFileSpec(); |
529 } | 538 } |
530 | 539 |
| 540 /** (Optional) The width and height of the movie's bounding box, in pixels, |
| 541 * specified as [width height]. This entry should be omitted for a movie consis
t- |
| 542 * ing entirely of sound with no visible images. |
| 543 **/ |
| 544 bool has_Aspect() const { |
| 545 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Aspec
t", "", NULL)); |
| 546 } |
| 547 |
531 SkPdfArray Aspect() const { | 548 SkPdfArray Aspect() const { |
532 SkPdfArray ret; | 549 SkPdfArray ret; |
533 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Aspect", "
", &ret)) return ret; | 550 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Aspect", "
", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 551 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return SkPdfArray(); | 552 return SkPdfArray(); |
536 } | 553 } |
537 | 554 |
| 555 /** (Optional) The number of degrees by which the movie is rotated clockwise |
| 556 * relative to the page. The value must be a multiple of 90. Default value: 0. |
| 557 **/ |
| 558 bool has_Rotate() const { |
| 559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotat
e", "", NULL)); |
| 560 } |
| 561 |
538 long Rotate() const { | 562 long Rotate() const { |
539 long ret; | 563 long ret; |
540 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotate", ""
, &ret)) return ret; | 564 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Rotate", ""
, &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 0; | 566 return 0; |
543 } | 567 } |
544 | 568 |
| 569 /** (Optional) A flag or stream specifying whether and how to display a poster |
| 570 * image representing the movie. If this value is a stream, it contains an imag
e |
| 571 * XObject (see Section 4.8, "Images") to be displayed as the poster; if it is
the |
| 572 * boolean value true, the poster image should be retrieved from the movie file |
| 573 * itself; if it is false, no poster should be displayed. Default value: false. |
| 574 **/ |
| 575 bool has_Poster() const { |
| 576 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poste
r", "", NULL)); |
| 577 } |
| 578 |
545 bool isPosterABoolean() const { | 579 bool isPosterABoolean() const { |
546 SkPdfObject* ret = NULL; | 580 SkPdfObject* ret = NULL; |
547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return false; | 581 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return false; |
548 return ret->podofo()->GetDataType() == ePdfDataType_Bool; | 582 return ret->podofo()->GetDataType() == ePdfDataType_Bool; |
549 } | 583 } |
550 | 584 |
551 bool getPosterAsBoolean() const { | 585 bool getPosterAsBoolean() const { |
552 bool ret = false; | 586 bool ret = false; |
553 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster", ""
, &ret)) return ret; | 587 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster", ""
, &ret)) return ret; |
554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 588 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
555 return false; | 589 return false; |
556 } | 590 } |
557 | 591 |
558 bool isPosterAStream() const { | 592 bool isPosterAStream() const { |
559 SkPdfObject* ret = NULL; | 593 SkPdfObject* ret = NULL; |
560 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return false; | 594 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return false; |
561 return ret->podofo()->HasStream(); | 595 return ret->podofo()->HasStream(); |
562 } | 596 } |
563 | 597 |
564 SkPdfStream getPosterAsStream() const { | 598 SkPdfStream getPosterAsStream() const { |
565 SkPdfStream ret = SkPdfStream(); | 599 SkPdfStream ret = SkPdfStream(); |
566 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return ret; | 600 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Poster",
"", &ret)) return ret; |
567 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 601 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
568 return SkPdfStream(); | 602 return SkPdfStream(); |
569 } | 603 } |
570 | 604 |
571 }; | 605 }; |
572 | 606 |
573 #endif // __DEFINED__SkPdfMovieDictionary | 607 #endif // __DEFINED__SkPdfMovieDictionary |
OLD | NEW |