OLD | NEW |
1 #ifndef __DEFINED__SkPdfThreadActionDictionary | 1 #ifndef __DEFINED__SkPdfThreadActionDictionary |
2 #define __DEFINED__SkPdfThreadActionDictionary | 2 #define __DEFINED__SkPdfThreadActionDictionary |
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 thread action |
8 class SkPdfThreadActionDictionary : public SkPdfDictionary { | 9 class SkPdfThreadActionDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kThreadActionDictionary_SkPdf
ObjectType;} | 11 virtual SkPdfObjectType getType() const { return kThreadActionDictionary_SkPdf
ObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kThreadA
ctionDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kThreadA
ctionDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfThreadActionDictionary* asThreadActionDictionary() {return this;} | 14 virtual SkPdfThreadActionDictionary* asThreadActionDictionary() {return this;} |
14 virtual const SkPdfThreadActionDictionary* asThreadActionDictionary() const {r
eturn this;} | 15 virtual const SkPdfThreadActionDictionary* asThreadActionDictionary() const {r
eturn 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 SkPdfThreadActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfThreadActionDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfO
bject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
519 | 520 |
520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
521 | 522 |
522 SkPdfThreadActionDictionary& operator=(const SkPdfThreadActionDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} | 523 SkPdfThreadActionDictionary& operator=(const SkPdfThreadActionDictionary& from
) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; retur
n *this;} |
523 | 524 |
| 525 /** (Required) The type of action that this dictionary describes; must be Thread |
| 526 * for a thread action. |
| 527 **/ |
| 528 bool has_S() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "
", NULL)); |
| 530 } |
| 531 |
524 std::string S() const { | 532 std::string S() const { |
525 std::string ret; | 533 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "S", "", &re
t)) 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 /** (Optional) The file containing the desired thread. If this entry is absent,
the |
| 540 * thread is in the current file. |
| 541 **/ |
| 542 bool has_F() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
| 544 } |
| 545 |
531 SkPdfFileSpec F() const { | 546 SkPdfFileSpec F() const { |
532 SkPdfFileSpec ret; | 547 SkPdfFileSpec ret; |
533 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; | 548 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&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 SkPdfFileSpec(); | 550 return SkPdfFileSpec(); |
536 } | 551 } |
537 | 552 |
| 553 /** (Required) The desired destination thread, specified in one of the following |
| 554 * forms: |
| 555 * * An indirect reference to a thread dictionary (see Section 8.3.2, "Article
s"). |
| 556 * In this case, the thread must be in the current file. |
| 557 * * The index of the thread within the Threads array of its document's catalo
g |
| 558 * (see Section 3.6.1, "Document Catalog"). The first thread in the array ha
s |
| 559 * index 0. |
| 560 * * The title of the thread, as specified in its thread information dictionar
y (see |
| 561 * Table 8.7 on page 484). If two or more threads have the same title, the o
ne |
| 562 * appearing first in the document catalog's Threads array will be used. |
| 563 **/ |
| 564 bool has_D() const { |
| 565 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "
", NULL)); |
| 566 } |
| 567 |
538 bool isDADictionary() const { | 568 bool isDADictionary() const { |
539 SkPdfObject* ret = NULL; | 569 SkPdfObject* ret = NULL; |
540 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; | 570 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; |
541 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 571 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
542 } | 572 } |
543 | 573 |
544 SkPdfDictionary* getDAsDictionary() const { | 574 SkPdfDictionary* getDAsDictionary() const { |
545 SkPdfDictionary* ret = NULL; | 575 SkPdfDictionary* ret = NULL; |
546 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "
", &ret)) return ret; | 576 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "
", &ret)) return ret; |
547 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 577 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
(...skipping 19 matching lines...) Expand all Loading... |
567 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 597 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
568 } | 598 } |
569 | 599 |
570 std::string getDAsString() const { | 600 std::string getDAsString() const { |
571 std::string ret = ""; | 601 std::string ret = ""; |
572 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &
ret)) return ret; | 602 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &
ret)) return ret; |
573 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 603 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
574 return ""; | 604 return ""; |
575 } | 605 } |
576 | 606 |
| 607 /** (Optional) The desired bead in the destination thread, specified in one of t
he |
| 608 * following forms: |
| 609 * * An indirect reference to a bead dictionary (see Section 8.3.2, "Articles"
). In |
| 610 * this case, the thread must be in the current file. |
| 611 * * The index of the bead within its thread. The first bead in a thread has |
| 612 * index 0. |
| 613 **/ |
| 614 bool has_B() const { |
| 615 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", NULL)); |
| 616 } |
| 617 |
577 bool isBADictionary() const { | 618 bool isBADictionary() const { |
578 SkPdfObject* ret = NULL; | 619 SkPdfObject* ret = NULL; |
579 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "",
&ret)) return false; | 620 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "",
&ret)) return false; |
580 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 621 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
581 } | 622 } |
582 | 623 |
583 SkPdfDictionary* getBAsDictionary() const { | 624 SkPdfDictionary* getBAsDictionary() const { |
584 SkPdfDictionary* ret = NULL; | 625 SkPdfDictionary* ret = NULL; |
585 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", &ret)) return ret; | 626 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "
", &ret)) return ret; |
586 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 627 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
587 return NULL; | 628 return NULL; |
588 } | 629 } |
589 | 630 |
590 bool isBAInteger() const { | 631 bool isBAInteger() const { |
591 SkPdfObject* ret = NULL; | 632 SkPdfObject* ret = NULL; |
592 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "",
&ret)) return false; | 633 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "",
&ret)) return false; |
593 return ret->podofo()->GetDataType() == ePdfDataType_Number; | 634 return ret->podofo()->GetDataType() == ePdfDataType_Number; |
594 } | 635 } |
595 | 636 |
596 long getBAsInteger() const { | 637 long getBAsInteger() const { |
597 long ret = 0; | 638 long ret = 0; |
598 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &re
t)) return ret; | 639 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "B", "", &re
t)) return ret; |
599 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 640 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
600 return 0; | 641 return 0; |
601 } | 642 } |
602 | 643 |
603 }; | 644 }; |
604 | 645 |
605 #endif // __DEFINED__SkPdfThreadActionDictionary | 646 #endif // __DEFINED__SkPdfThreadActionDictionary |
OLD | NEW |