OLD | NEW |
1 #ifndef __DEFINED__SkPdfStructureTreeRootDictionary | 1 #ifndef __DEFINED__SkPdfStructureTreeRootDictionary |
2 #define __DEFINED__SkPdfStructureTreeRootDictionary | 2 #define __DEFINED__SkPdfStructureTreeRootDictionary |
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 structure tree root |
8 class SkPdfStructureTreeRootDictionary : public SkPdfDictionary { | 9 class SkPdfStructureTreeRootDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kStructureTreeRootDictionary_
SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kStructureTreeRootDictionary_
SkPdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kStructu
reTreeRootDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kStructu
reTreeRootDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfStructureTreeRootDictionary* asStructureTreeRootDictionary() {ret
urn this;} | 14 virtual SkPdfStructureTreeRootDictionary* asStructureTreeRootDictionary() {ret
urn this;} |
14 virtual const SkPdfStructureTreeRootDictionary* asStructureTreeRootDictionary(
) const {return this;} | 15 virtual const SkPdfStructureTreeRootDictionary* asStructureTreeRootDictionary(
) 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 SkPdfStructureTreeRootDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfStructureTreeRootDictionary(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 SkPdfStructureTreeRootDictionary& operator=(const SkPdfStructureTreeRootDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} | 523 SkPdfStructureTreeRootDictionary& operator=(const SkPdfStructureTreeRootDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} |
523 | 524 |
| 525 /** (Required) The type of PDF object that this dictionary describes; must |
| 526 * be StructTreeRoot for a structure tree root. |
| 527 **/ |
| 528 bool has_Type() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type"
, "", NULL)); |
| 530 } |
| 531 |
524 std::string Type() const { | 532 std::string Type() const { |
525 std::string ret; | 533 std::string ret; |
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) return ret; | 534 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Type", "",
&ret)) 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 immediate child or children of the structure tree root in |
| 540 * the structure hierarchy. The value may be either a dictionary represent- |
| 541 * ing a single structure element or an array of such dictionaries. |
| 542 **/ |
| 543 bool has_K() const { |
| 544 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "
", NULL)); |
| 545 } |
| 546 |
531 bool isKADictionary() const { | 547 bool isKADictionary() const { |
532 SkPdfObject* ret = NULL; | 548 SkPdfObject* ret = NULL; |
533 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "",
&ret)) return false; | 549 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "",
&ret)) return false; |
534 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; | 550 return ret->podofo()->GetDataType() == ePdfDataType_Dictionary; |
535 } | 551 } |
536 | 552 |
537 SkPdfDictionary* getKAsDictionary() const { | 553 SkPdfDictionary* getKAsDictionary() const { |
538 SkPdfDictionary* ret = NULL; | 554 SkPdfDictionary* ret = NULL; |
539 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "
", &ret)) return ret; | 555 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "
", &ret)) return ret; |
540 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 556 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
541 return NULL; | 557 return NULL; |
542 } | 558 } |
543 | 559 |
544 bool isKAArray() const { | 560 bool isKAArray() const { |
545 SkPdfObject* ret = NULL; | 561 SkPdfObject* ret = NULL; |
546 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "",
&ret)) return false; | 562 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "",
&ret)) return false; |
547 return ret->podofo()->GetDataType() == ePdfDataType_Array; | 563 return ret->podofo()->GetDataType() == ePdfDataType_Array; |
548 } | 564 } |
549 | 565 |
550 SkPdfArray getKAsArray() const { | 566 SkPdfArray getKAsArray() const { |
551 SkPdfArray ret = SkPdfArray(); | 567 SkPdfArray ret = SkPdfArray(); |
552 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "", &r
et)) return ret; | 568 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "K", "", &r
et)) return ret; |
553 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 569 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
554 return SkPdfArray(); | 570 return SkPdfArray(); |
555 } | 571 } |
556 | 572 |
| 573 /** (Required if any structure elements have element identifiers) A name tree |
| 574 * that maps element identifiers (see Table 9.10) to the structure elements |
| 575 * they denote. |
| 576 **/ |
| 577 bool has_IDTree() const { |
| 578 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTre
e", "", NULL)); |
| 579 } |
| 580 |
557 bool isIDTreeAName() const { | 581 bool isIDTreeAName() const { |
558 SkPdfObject* ret = NULL; | 582 SkPdfObject* ret = NULL; |
559 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree",
"", &ret)) return false; | 583 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree",
"", &ret)) return false; |
560 return ret->podofo()->GetDataType() == ePdfDataType_Name; | 584 return ret->podofo()->GetDataType() == ePdfDataType_Name; |
561 } | 585 } |
562 | 586 |
563 std::string getIDTreeAsName() const { | 587 std::string getIDTreeAsName() const { |
564 std::string ret = ""; | 588 std::string ret = ""; |
565 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree", ""
, &ret)) return ret; | 589 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree", ""
, &ret)) return ret; |
566 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 590 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
567 return ""; | 591 return ""; |
568 } | 592 } |
569 | 593 |
570 bool isIDTreeATree() const { | 594 bool isIDTreeATree() const { |
571 SkPdfObject* ret = NULL; | 595 SkPdfObject* ret = NULL; |
572 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree",
"", &ret)) return false; | 596 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree",
"", &ret)) return false; |
573 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 597 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
574 } | 598 } |
575 | 599 |
576 SkPdfTree* getIDTreeAsTree() const { | 600 SkPdfTree* getIDTreeAsTree() const { |
577 SkPdfTree* ret = NULL; | 601 SkPdfTree* ret = NULL; |
578 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree", ""
, &ret)) return ret; | 602 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "IDTree", ""
, &ret)) return ret; |
579 // 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 |
580 return NULL; | 604 return NULL; |
581 } | 605 } |
582 | 606 |
| 607 /** (Required if any structure element contains PDF objects or marked-content |
| 608 * sequences as content items) A number tree (see Section 3.8.5, "Number |
| 609 * Trees") used in finding the structure elements to which content items |
| 610 * belong. Each integer key in the number tree corresponds to a single page |
| 611 * of the document or to an individual object (such as an annotation or an |
| 612 * XObject) that is a content item in its own right. The integer key is given |
| 613 * as the value of the StructParent or StructParents entry in that object (see |
| 614 * "Finding Structure Elements from Content Items" on page 600). The |
| 615 * form of the associated value depends on the nature of the object: |
| 616 * * For an object that is a content item in its own right, the value is an in
- |
| 617 * direct reference to the object's parent element (the structure element |
| 618 * that contains it as a content item). |
| 619 * * For a page object or content stream containing marked-content |
| 620 * sequences that are content items, the value is an array of references to |
| 621 * the parent elements of those marked-content sequences. |
| 622 * See "Finding Structure Elements from Content Items" on page 600 for |
| 623 * further discussion. |
| 624 **/ |
| 625 bool has_ParentTree() const { |
| 626 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
tTree", "", NULL)); |
| 627 } |
| 628 |
583 bool isParentTreeANumber() const { | 629 bool isParentTreeANumber() const { |
584 SkPdfObject* ret = NULL; | 630 SkPdfObject* ret = NULL; |
585 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTr
ee", "", &ret)) return false; | 631 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTr
ee", "", &ret)) return false; |
586 return ret->podofo()->GetDataType() == ePdfDataType_Real || ret->podofo()->G
etDataType() == ePdfDataType_Number; | 632 return ret->podofo()->GetDataType() == ePdfDataType_Real || ret->podofo()->G
etDataType() == ePdfDataType_Number; |
587 } | 633 } |
588 | 634 |
589 double getParentTreeAsNumber() const { | 635 double getParentTreeAsNumber() const { |
590 double ret = 0; | 636 double ret = 0; |
591 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTre
e", "", &ret)) return ret; | 637 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTre
e", "", &ret)) return ret; |
592 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 638 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
593 return 0; | 639 return 0; |
594 } | 640 } |
595 | 641 |
596 bool isParentTreeATree() const { | 642 bool isParentTreeATree() const { |
597 SkPdfObject* ret = NULL; | 643 SkPdfObject* ret = NULL; |
598 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTr
ee", "", &ret)) return false; | 644 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTr
ee", "", &ret)) return false; |
599 return ret->podofo()->GetDataType() == ePdfDataType_Reference; | 645 return ret->podofo()->GetDataType() == ePdfDataType_Reference; |
600 } | 646 } |
601 | 647 |
602 SkPdfTree* getParentTreeAsTree() const { | 648 SkPdfTree* getParentTreeAsTree() const { |
603 SkPdfTree* ret = NULL; | 649 SkPdfTree* ret = NULL; |
604 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTree"
, "", &ret)) return ret; | 650 if (TreeFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTree"
, "", &ret)) return ret; |
605 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 651 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
606 return NULL; | 652 return NULL; |
607 } | 653 } |
608 | 654 |
| 655 /** (Optional) An integer greater than any key in the parent tree, to be used |
| 656 * as a key for the next entry added to the tree. |
| 657 **/ |
| 658 bool has_ParentTreeNextKey() const { |
| 659 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren
tTreeNextKey", "", NULL)); |
| 660 } |
| 661 |
609 long ParentTreeNextKey() const { | 662 long ParentTreeNextKey() const { |
610 long ret; | 663 long ret; |
611 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTreeN
extKey", "", &ret)) return ret; | 664 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ParentTreeN
extKey", "", &ret)) return ret; |
612 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 665 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
613 return 0; | 666 return 0; |
614 } | 667 } |
615 | 668 |
| 669 /** (Optional) A dictionary mapping the names of structure types used in |
| 670 * the document to their approximate equivalents in the set of standard |
| 671 * structure types (see Section 9.7.4, "Standard Structure Types"). |
| 672 **/ |
| 673 bool has_RoleMap() const { |
| 674 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RoleM
ap", "", NULL)); |
| 675 } |
| 676 |
616 SkPdfDictionary* RoleMap() const { | 677 SkPdfDictionary* RoleMap() const { |
617 SkPdfDictionary* ret; | 678 SkPdfDictionary* ret; |
618 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RoleM
ap", "", &ret)) return ret; | 679 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "RoleM
ap", "", &ret)) return ret; |
619 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 680 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
620 return NULL; | 681 return NULL; |
621 } | 682 } |
622 | 683 |
| 684 /** (Optional) A dictionary mapping name objects designating attribute |
| 685 * classes to the corresponding attribute objects or arrays of attribute ob- |
| 686 * jects (see "Attribute Classes" on page 605). |
| 687 **/ |
| 688 bool has_ClassMap() const { |
| 689 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Class
Map", "", NULL)); |
| 690 } |
| 691 |
623 SkPdfDictionary* ClassMap() const { | 692 SkPdfDictionary* ClassMap() const { |
624 SkPdfDictionary* ret; | 693 SkPdfDictionary* ret; |
625 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Class
Map", "", &ret)) return ret; | 694 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Class
Map", "", &ret)) return ret; |
626 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 695 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
627 return NULL; | 696 return NULL; |
628 } | 697 } |
629 | 698 |
630 }; | 699 }; |
631 | 700 |
632 #endif // __DEFINED__SkPdfStructureTreeRootDictionary | 701 #endif // __DEFINED__SkPdfStructureTreeRootDictionary |
OLD | NEW |