| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfNameDictionary | 1 #ifndef __DEFINED__SkPdfNameDictionary |
| 2 #define __DEFINED__SkPdfNameDictionary | 2 #define __DEFINED__SkPdfNameDictionary |
| 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 the name dictionary |
| 8 class SkPdfNameDictionary : public SkPdfDictionary { | 9 class SkPdfNameDictionary : public SkPdfDictionary { |
| 9 public: | 10 public: |
| 10 virtual SkPdfObjectType getType() const { return kNameDictionary_SkPdfObjectTy
pe;} | 11 virtual SkPdfObjectType getType() const { return kNameDictionary_SkPdfObjectTy
pe;} |
| 11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kNameDic
tionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kNameDic
tionary_SkPdfObjectType + 1);} |
| 12 public: | 13 public: |
| 13 virtual SkPdfNameDictionary* asNameDictionary() {return this;} | 14 virtual SkPdfNameDictionary* asNameDictionary() {return this;} |
| 14 virtual const SkPdfNameDictionary* asNameDictionary() const {return this;} | 15 virtual const SkPdfNameDictionary* asNameDictionary() 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 SkPdfNameDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* p
odofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfNameDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* p
odofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} |
| 519 | 520 |
| 520 virtual bool valid() const {return true;} | 521 virtual bool valid() const {return true;} |
| 521 | 522 |
| 522 SkPdfNameDictionary& operator=(const SkPdfNameDictionary& from) {this->fPodofo
Doc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} | 523 SkPdfNameDictionary& operator=(const SkPdfNameDictionary& from) {this->fPodofo
Doc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} |
| 523 | 524 |
| 525 /** (Optional; PDF 1.2) A name tree mapping name strings to destinations (see |
| 526 * "Named Destinations" on page 476). |
| 527 **/ |
| 528 bool has_Dests() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests
", "", NULL)); |
| 530 } |
| 531 |
| 524 bool isDestsAName() const { | 532 bool isDestsAName() const { |
| 525 SkPdfObject* ret = NULL; | 533 SkPdfObject* ret = NULL; |
| 526 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; | 534 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; |
| 527 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 535 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 528 } | 536 } |
| 529 | 537 |
| 530 std::string getDestsAsName() const { | 538 std::string getDestsAsName() const { |
| 531 std::string ret = ""; | 539 std::string ret = ""; |
| 532 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; | 540 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; |
| 533 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 534 return ""; | 542 return ""; |
| 535 } | 543 } |
| 536 | 544 |
| 537 bool isDestsATree() const { | 545 bool isDestsATree() const { |
| 538 SkPdfObject* ret = NULL; | 546 SkPdfObject* ret = NULL; |
| 539 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; | 547 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests",
"", &ret)) return false; |
| 540 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 548 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 541 } | 549 } |
| 542 | 550 |
| 543 SkPdfTree* getDestsAsTree() const { | 551 SkPdfTree* getDestsAsTree() const { |
| 544 SkPdfTree* ret = NULL; | 552 SkPdfTree* ret = NULL; |
| 545 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; | 553 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dests", "",
&ret)) return ret; |
| 546 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 547 return NULL; | 555 return NULL; |
| 548 } | 556 } |
| 549 | 557 |
| 558 /** (Optional; PDF 1.3) A name tree mapping name strings to annotation |
| 559 * appearance streams (see Section 8.4.4, "Appearance Streams"). |
| 560 **/ |
| 561 bool has_AP() const { |
| 562 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP",
"", NULL)); |
| 563 } |
| 564 |
| 550 bool isAPAName() const { | 565 bool isAPAName() const { |
| 551 SkPdfObject* ret = NULL; | 566 SkPdfObject* ret = NULL; |
| 552 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; | 567 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; |
| 553 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 568 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 554 } | 569 } |
| 555 | 570 |
| 556 std::string getAPAsName() const { | 571 std::string getAPAsName() const { |
| 557 std::string ret = ""; | 572 std::string ret = ""; |
| 558 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; | 573 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; |
| 559 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 574 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 560 return ""; | 575 return ""; |
| 561 } | 576 } |
| 562 | 577 |
| 563 bool isAPATree() const { | 578 bool isAPATree() const { |
| 564 SkPdfObject* ret = NULL; | 579 SkPdfObject* ret = NULL; |
| 565 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; | 580 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "",
&ret)) return false; |
| 566 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 581 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 567 } | 582 } |
| 568 | 583 |
| 569 SkPdfTree* getAPAsTree() const { | 584 SkPdfTree* getAPAsTree() const { |
| 570 SkPdfTree* ret = NULL; | 585 SkPdfTree* ret = NULL; |
| 571 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; | 586 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "AP", "", &r
et)) return ret; |
| 572 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 573 return NULL; | 588 return NULL; |
| 574 } | 589 } |
| 575 | 590 |
| 591 /** (Optional; PDF 1.3) A name tree mapping name strings to document-level |
| 592 * JavaScript(R) actions (see "JavaScript Actions" on page 556). |
| 593 **/ |
| 594 bool has_JavaScript() const { |
| 595 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", NULL)); |
| 596 } |
| 597 |
| 576 bool isJavaScriptAName() const { | 598 bool isJavaScriptAName() const { |
| 577 SkPdfObject* ret = NULL; | 599 SkPdfObject* ret = NULL; |
| 578 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; | 600 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; |
| 579 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 601 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 580 } | 602 } |
| 581 | 603 |
| 582 std::string getJavaScriptAsName() const { | 604 std::string getJavaScriptAsName() const { |
| 583 std::string ret = ""; | 605 std::string ret = ""; |
| 584 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; | 606 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; |
| 585 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 607 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 586 return ""; | 608 return ""; |
| 587 } | 609 } |
| 588 | 610 |
| 589 bool isJavaScriptATree() const { | 611 bool isJavaScriptATree() const { |
| 590 SkPdfObject* ret = NULL; | 612 SkPdfObject* ret = NULL; |
| 591 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; | 613 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScri
pt", "", &ret)) return false; |
| 592 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 614 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 593 } | 615 } |
| 594 | 616 |
| 595 SkPdfTree* getJavaScriptAsTree() const { | 617 SkPdfTree* getJavaScriptAsTree() const { |
| 596 SkPdfTree* ret = NULL; | 618 SkPdfTree* ret = NULL; |
| 597 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; | 619 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaScript"
, "", &ret)) return ret; |
| 598 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 620 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 599 return NULL; | 621 return NULL; |
| 600 } | 622 } |
| 601 | 623 |
| 624 /** (Optional; PDF 1.3) A name tree mapping name strings to visible pages for |
| 625 * use in interactive forms (see Section 8.6.5, "Named Pages"). |
| 626 **/ |
| 627 bool has_Pages() const { |
| 628 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); |
| 629 } |
| 630 |
| 602 bool isPagesAName() const { | 631 bool isPagesAName() const { |
| 603 SkPdfObject* ret = NULL; | 632 SkPdfObject* ret = NULL; |
| 604 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; | 633 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; |
| 605 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 634 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 606 } | 635 } |
| 607 | 636 |
| 608 std::string getPagesAsName() const { | 637 std::string getPagesAsName() const { |
| 609 std::string ret = ""; | 638 std::string ret = ""; |
| 610 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; | 639 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; |
| 611 // 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 |
| 612 return ""; | 641 return ""; |
| 613 } | 642 } |
| 614 | 643 |
| 615 bool isPagesATree() const { | 644 bool isPagesATree() const { |
| 616 SkPdfObject* ret = NULL; | 645 SkPdfObject* ret = NULL; |
| 617 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; | 646 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages",
"", &ret)) return false; |
| 618 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 647 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 619 } | 648 } |
| 620 | 649 |
| 621 SkPdfTree* getPagesAsTree() const { | 650 SkPdfTree* getPagesAsTree() const { |
| 622 SkPdfTree* ret = NULL; | 651 SkPdfTree* ret = NULL; |
| 623 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; | 652 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", "",
&ret)) return ret; |
| 624 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 653 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 625 return NULL; | 654 return NULL; |
| 626 } | 655 } |
| 627 | 656 |
| 657 /** (Optional; PDF 1.3) A name tree mapping name strings to invisible (tem- |
| 658 * plate) pages for use in interactive forms (see Section 8.6.5, "Named Pages")
. |
| 659 **/ |
| 660 bool has_Templates() const { |
| 661 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templ
ates", "", NULL)); |
| 662 } |
| 663 |
| 628 bool isTemplatesAName() const { | 664 bool isTemplatesAName() const { |
| 629 SkPdfObject* ret = NULL; | 665 SkPdfObject* ret = NULL; |
| 630 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; | 666 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; |
| 631 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 667 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 632 } | 668 } |
| 633 | 669 |
| 634 std::string getTemplatesAsName() const { | 670 std::string getTemplatesAsName() const { |
| 635 std::string ret = ""; | 671 std::string ret = ""; |
| 636 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; | 672 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; |
| 637 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 673 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 638 return ""; | 674 return ""; |
| 639 } | 675 } |
| 640 | 676 |
| 641 bool isTemplatesATree() const { | 677 bool isTemplatesATree() const { |
| 642 SkPdfObject* ret = NULL; | 678 SkPdfObject* ret = NULL; |
| 643 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; | 679 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Template
s", "", &ret)) return false; |
| 644 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 680 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 645 } | 681 } |
| 646 | 682 |
| 647 SkPdfTree* getTemplatesAsTree() const { | 683 SkPdfTree* getTemplatesAsTree() const { |
| 648 SkPdfTree* ret = NULL; | 684 SkPdfTree* ret = NULL; |
| 649 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; | 685 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Templates",
"", &ret)) return ret; |
| 650 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 686 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 651 return NULL; | 687 return NULL; |
| 652 } | 688 } |
| 653 | 689 |
| 690 /** (Optional; PDF 1.3) A name tree mapping digital identifiers to Web Capture |
| 691 * content sets (see Section 9.9.3, "Content Sets"). |
| 692 **/ |
| 693 bool has_IDS() const { |
| 694 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS",
"", NULL)); |
| 695 } |
| 696 |
| 654 bool isIDSAName() const { | 697 bool isIDSAName() const { |
| 655 SkPdfObject* ret = NULL; | 698 SkPdfObject* ret = NULL; |
| 656 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; | 699 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; |
| 657 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 700 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 658 } | 701 } |
| 659 | 702 |
| 660 std::string getIDSAsName() const { | 703 std::string getIDSAsName() const { |
| 661 std::string ret = ""; | 704 std::string ret = ""; |
| 662 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; | 705 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; |
| 663 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 706 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 664 return ""; | 707 return ""; |
| 665 } | 708 } |
| 666 | 709 |
| 667 bool isIDSATree() const { | 710 bool isIDSATree() const { |
| 668 SkPdfObject* ret = NULL; | 711 SkPdfObject* ret = NULL; |
| 669 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; | 712 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", ""
, &ret)) return false; |
| 670 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 713 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 671 } | 714 } |
| 672 | 715 |
| 673 SkPdfTree* getIDSAsTree() const { | 716 SkPdfTree* getIDSAsTree() const { |
| 674 SkPdfTree* ret = NULL; | 717 SkPdfTree* ret = NULL; |
| 675 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; | 718 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDS", "", &
ret)) return ret; |
| 676 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 719 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 677 return NULL; | 720 return NULL; |
| 678 } | 721 } |
| 679 | 722 |
| 723 /** (Optional; PDF 1.3) A name tree mapping uniform resource locators (URLs) |
| 724 * to Web Capture content sets (see Section 9.9.3, "Content Sets"). |
| 725 **/ |
| 726 bool has_URLS() const { |
| 727 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS"
, "", NULL)); |
| 728 } |
| 729 |
| 680 bool isURLSAName() const { | 730 bool isURLSAName() const { |
| 681 SkPdfObject* ret = NULL; | 731 SkPdfObject* ret = NULL; |
| 682 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; | 732 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; |
| 683 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 733 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 684 } | 734 } |
| 685 | 735 |
| 686 std::string getURLSAsName() const { | 736 std::string getURLSAsName() const { |
| 687 std::string ret = ""; | 737 std::string ret = ""; |
| 688 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; | 738 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; |
| 689 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 739 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 690 return ""; | 740 return ""; |
| 691 } | 741 } |
| 692 | 742 |
| 693 bool isURLSATree() const { | 743 bool isURLSATree() const { |
| 694 SkPdfObject* ret = NULL; | 744 SkPdfObject* ret = NULL; |
| 695 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; | 745 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "
", &ret)) return false; |
| 696 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 746 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 697 } | 747 } |
| 698 | 748 |
| 699 SkPdfTree* getURLSAsTree() const { | 749 SkPdfTree* getURLSAsTree() const { |
| 700 SkPdfTree* ret = NULL; | 750 SkPdfTree* ret = NULL; |
| 701 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; | 751 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "URLS", "",
&ret)) return ret; |
| 702 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 752 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 703 return NULL; | 753 return NULL; |
| 704 } | 754 } |
| 705 | 755 |
| 756 /** (Optional; PDF 1.4) A name tree mapping name strings to embedded file |
| 757 * streams (see Section 3.10.3, "Embedded File Streams"). |
| 758 **/ |
| 759 bool has_EmbeddedFiles() const { |
| 760 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embed
dedFiles", "", NULL)); |
| 761 } |
| 762 |
| 706 bool isEmbeddedFilesAName() const { | 763 bool isEmbeddedFilesAName() const { |
| 707 SkPdfObject* ret = NULL; | 764 SkPdfObject* ret = NULL; |
| 708 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; | 765 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; |
| 709 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 766 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
| 710 } | 767 } |
| 711 | 768 |
| 712 std::string getEmbeddedFilesAsName() const { | 769 std::string getEmbeddedFilesAsName() const { |
| 713 std::string ret = ""; | 770 std::string ret = ""; |
| 714 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; | 771 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; |
| 715 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 772 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 716 return ""; | 773 return ""; |
| 717 } | 774 } |
| 718 | 775 |
| 719 bool isEmbeddedFilesATree() const { | 776 bool isEmbeddedFilesATree() const { |
| 720 SkPdfObject* ret = NULL; | 777 SkPdfObject* ret = NULL; |
| 721 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; | 778 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embedded
Files", "", &ret)) return false; |
| 722 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 779 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
| 723 } | 780 } |
| 724 | 781 |
| 725 SkPdfTree* getEmbeddedFilesAsTree() const { | 782 SkPdfTree* getEmbeddedFilesAsTree() const { |
| 726 SkPdfTree* ret = NULL; | 783 SkPdfTree* ret = NULL; |
| 727 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; | 784 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFil
es", "", &ret)) return ret; |
| 728 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 785 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
| 729 return NULL; | 786 return NULL; |
| 730 } | 787 } |
| 731 | 788 |
| 732 }; | 789 }; |
| 733 | 790 |
| 734 #endif // __DEFINED__SkPdfNameDictionary | 791 #endif // __DEFINED__SkPdfNameDictionary |
| OLD | NEW |