| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfGoToActionDictionary | 1 #ifndef __DEFINED__SkPdfGoToActionDictionary |
| 2 #define __DEFINED__SkPdfGoToActionDictionary | 2 #define __DEFINED__SkPdfGoToActionDictionary |
| 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 go-to action | 9 // Additional entries specific to a go-to action |
| 10 class SkPdfGoToActionDictionary : public SkPdfDictionary { | 10 class SkPdfGoToActionDictionary : public SkPdfDictionary { |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 SkPdfGoToActionDictionary& operator=(const SkPdfGoToActionDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} | 526 SkPdfGoToActionDictionary& operator=(const SkPdfGoToActionDictionary& from) {t
his->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *t
his;} |
| 527 | 527 |
| 528 /** (Required) The type of action that this dictionary describes; must be GoTo f
or a | 528 /** (Required) The type of action that this dictionary describes; must be GoTo f
or a |
| 529 * go-to action. | 529 * go-to 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 /** (Required) The destination to jump to (see Section 8.2.1, "Destinations"). | 536 /** (Required) The destination to jump to (see Section 8.2.1, "Destinations"). |
| 543 **/ | 537 **/ |
| 544 bool has_D() const { | 538 bool has_D() const { |
| 545 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "
", NULL)); | 539 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "
", NULL)); |
| 546 } | 540 } |
| 547 | 541 |
| 548 bool isDAName() const { | 542 bool isDAName() const { |
| 549 SkPdfObject* ret = NULL; | 543 SkPdfObject* ret = NULL; |
| 550 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; | 544 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; |
| 551 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 545 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 552 } | 546 } |
| 553 | 547 |
| 554 std::string getDAsName() const { | 548 std::string getDAsName() const; |
| 555 std::string ret = ""; | |
| 556 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &re
t)) return ret; | |
| 557 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 558 return ""; | |
| 559 } | |
| 560 | |
| 561 bool isDAString() const { | 549 bool isDAString() const { |
| 562 SkPdfObject* ret = NULL; | 550 SkPdfObject* ret = NULL; |
| 563 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; | 551 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; |
| 564 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; | 552 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()-
>GetDataType() == ePdfDataType_HexString; |
| 565 } | 553 } |
| 566 | 554 |
| 567 std::string getDAsString() const { | 555 std::string getDAsString() const; |
| 568 std::string ret = ""; | |
| 569 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &
ret)) return ret; | |
| 570 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 571 return ""; | |
| 572 } | |
| 573 | |
| 574 bool isDAArray() const { | 556 bool isDAArray() const { |
| 575 SkPdfObject* ret = NULL; | 557 SkPdfObject* ret = NULL; |
| 576 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; | 558 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "",
&ret)) return false; |
| 577 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 559 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
| 578 } | 560 } |
| 579 | 561 |
| 580 SkPdfArray* getDAsArray() const { | 562 SkPdfArray* getDAsArray() const; |
| 581 SkPdfArray* ret = NULL; | |
| 582 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "D", "", &r
et)) return ret; | |
| 583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 584 return NULL; | |
| 585 } | |
| 586 | |
| 587 }; | 563 }; |
| 588 | 564 |
| 589 #endif // __DEFINED__SkPdfGoToActionDictionary | 565 #endif // __DEFINED__SkPdfGoToActionDictionary |
| OLD | NEW |