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