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