Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfOutlineItemDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #ifndef __DEFINED__SkPdfOutlineItemDictionary 1 #ifndef __DEFINED__SkPdfOutlineItemDictionary
2 #define __DEFINED__SkPdfOutlineItemDictionary 2 #define __DEFINED__SkPdfOutlineItemDictionary
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 an outline item dictionary 9 // Entries in an outline item dictionary
10 class SkPdfOutlineItemDictionary : public SkPdfDictionary { 10 class SkPdfOutlineItemDictionary : public SkPdfDictionary {
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 virtual bool valid() const {return true;} 524 virtual bool valid() const {return true;}
525 525
526 SkPdfOutlineItemDictionary& operator=(const SkPdfOutlineItemDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} 526 SkPdfOutlineItemDictionary& operator=(const SkPdfOutlineItemDictionary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
527 527
528 /** (Required) The text to be displayed on the screen for this item. 528 /** (Required) The text to be displayed on the screen for this item.
529 **/ 529 **/
530 bool has_Title() const { 530 bool has_Title() const {
531 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Title ", "", NULL)); 531 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Title ", "", NULL));
532 } 532 }
533 533
534 std::string Title() const { 534 std::string Title() const;
535 std::string ret;
536 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Title", " ", &ret)) return ret;
537 // TODO(edisonn): warn about missing required field, assert for known good p dfs
538 return "";
539 }
540
541 /** (Required; must be an indirect reference) The parent of this item in the out line 535 /** (Required; must be an indirect reference) The parent of this item in the out line
542 * hierarchy. The parent of a top-level item is the outline dictionary itself. 536 * hierarchy. The parent of a top-level item is the outline dictionary itself.
543 **/ 537 **/
544 bool has_Parent() const { 538 bool has_Parent() const {
545 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren t", "", NULL)); 539 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren t", "", NULL));
546 } 540 }
547 541
548 SkPdfDictionary* Parent() const { 542 SkPdfDictionary* Parent() const;
549 SkPdfDictionary* ret;
550 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Paren t", "", &ret)) return ret;
551 // TODO(edisonn): warn about missing required field, assert for known good p dfs
552 return NULL;
553 }
554
555 /** (Required for all but the first item at each level; must be an indirect refe rence) 543 /** (Required for all but the first item at each level; must be an indirect refe rence)
556 * The previous item at this outline level. 544 * The previous item at this outline level.
557 **/ 545 **/
558 bool has_Prev() const { 546 bool has_Prev() const {
559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Prev" , "", NULL)); 547 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Prev" , "", NULL));
560 } 548 }
561 549
562 SkPdfDictionary* Prev() const { 550 SkPdfDictionary* Prev() const;
563 SkPdfDictionary* ret;
564 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Prev" , "", &ret)) return ret;
565 // TODO(edisonn): warn about missing required field, assert for known good p dfs
566 return NULL;
567 }
568
569 /** (Required for all but the last item at each level; must be an indirect refer ence) 551 /** (Required for all but the last item at each level; must be an indirect refer ence)
570 * The next item at this outline level. 552 * The next item at this outline level.
571 **/ 553 **/
572 bool has_Next() const { 554 bool has_Next() const {
573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Next" , "", NULL)); 555 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Next" , "", NULL));
574 } 556 }
575 557
576 SkPdfDictionary* Next() const { 558 SkPdfDictionary* Next() const;
577 SkPdfDictionary* ret;
578 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Next" , "", &ret)) return ret;
579 // TODO(edisonn): warn about missing required field, assert for known good p dfs
580 return NULL;
581 }
582
583 /** (Required if the item has any descendants; must be an indirect reference) Th e 559 /** (Required if the item has any descendants; must be an indirect reference) Th e
584 * first of this item's immediate children in the outline hierarchy. 560 * first of this item's immediate children in the outline hierarchy.
585 **/ 561 **/
586 bool has_First() const { 562 bool has_First() const {
587 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First ", "", NULL)); 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First ", "", NULL));
588 } 564 }
589 565
590 SkPdfDictionary* First() const { 566 SkPdfDictionary* First() const;
591 SkPdfDictionary* ret;
592 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "First ", "", &ret)) return ret;
593 // TODO(edisonn): warn about missing required field, assert for known good p dfs
594 return NULL;
595 }
596
597 /** (Required if the item has any descendants; must be an indirect reference) Th e 567 /** (Required if the item has any descendants; must be an indirect reference) Th e
598 * last of this item's immediate children in the outline hierarchy. 568 * last of this item's immediate children in the outline hierarchy.
599 **/ 569 **/
600 bool has_Last() const { 570 bool has_Last() const {
601 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last" , "", NULL)); 571 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last" , "", NULL));
602 } 572 }
603 573
604 SkPdfDictionary* Last() const { 574 SkPdfDictionary* Last() const;
605 SkPdfDictionary* ret;
606 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Last" , "", &ret)) return ret;
607 // TODO(edisonn): warn about missing required field, assert for known good p dfs
608 return NULL;
609 }
610
611 /** (Required if the item has any descendants) If the item is open, the total nu m- 575 /** (Required if the item has any descendants) If the item is open, the total nu m-
612 * ber of its open descendants at all lower levels of the outline hierarchy. If the 576 * ber of its open descendants at all lower levels of the outline hierarchy. If the
613 * item is closed, a negative integer whose absolute value specifies how many 577 * item is closed, a negative integer whose absolute value specifies how many
614 * descendants would appear if the item were reopened. 578 * descendants would appear if the item were reopened.
615 **/ 579 **/
616 bool has_Count() const { 580 bool has_Count() const {
617 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count ", "", NULL)); 581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count ", "", NULL));
618 } 582 }
619 583
620 long Count() const { 584 long Count() const;
621 long ret;
622 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Count", "", &ret)) return ret;
623 // TODO(edisonn): warn about missing required field, assert for known good p dfs
624 return 0;
625 }
626
627 /** (Optional; not permitted if an A entry is present) The destination to be 585 /** (Optional; not permitted if an A entry is present) The destination to be
628 * displayed when this item is activated (see Section 8.2.1, "Destinations"; se e 586 * displayed when this item is activated (see Section 8.2.1, "Destinations"; se e
629 * also implementation note 56 in Appendix H). 587 * also implementation note 56 in Appendix H).
630 **/ 588 **/
631 bool has_Dest() const { 589 bool has_Dest() const {
632 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest" , "", NULL)); 590 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest" , "", NULL));
633 } 591 }
634 592
635 bool isDestAName() const { 593 bool isDestAName() const {
636 SkPdfObject* ret = NULL; 594 SkPdfObject* ret = NULL;
637 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 595 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
638 return ret->podofo()->GetDataType() == ePdfDataType_Name; 596 return ret->podofo()->GetDataType() == ePdfDataType_Name;
639 } 597 }
640 598
641 std::string getDestAsName() const { 599 std::string getDestAsName() const;
642 std::string ret = "";
643 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
644 // TODO(edisonn): warn about missing required field, assert for known good p dfs
645 return "";
646 }
647
648 bool isDestAString() const { 600 bool isDestAString() const {
649 SkPdfObject* ret = NULL; 601 SkPdfObject* ret = NULL;
650 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 602 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
651 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString; 603 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString;
652 } 604 }
653 605
654 std::string getDestAsString() const { 606 std::string getDestAsString() const;
655 std::string ret = "";
656 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "" , &ret)) return ret;
657 // TODO(edisonn): warn about missing required field, assert for known good p dfs
658 return "";
659 }
660
661 bool isDestAArray() const { 607 bool isDestAArray() const {
662 SkPdfObject* ret = NULL; 608 SkPdfObject* ret = NULL;
663 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 609 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
664 return ret->podofo()->GetDataType() == ePdfDataType_Array; 610 return ret->podofo()->GetDataType() == ePdfDataType_Array;
665 } 611 }
666 612
667 SkPdfArray* getDestAsArray() const { 613 SkPdfArray* getDestAsArray() const;
668 SkPdfArray* ret = NULL;
669 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
670 // TODO(edisonn): warn about missing required field, assert for known good p dfs
671 return NULL;
672 }
673
674 /** (Optional; PDF 1.1; not permitted if a Dest entry is present) The action to be 614 /** (Optional; PDF 1.1; not permitted if a Dest entry is present) The action to be
675 * performed when this item is activated (see Section 8.5, "Actions"). 615 * performed when this item is activated (see Section 8.5, "Actions").
676 **/ 616 **/
677 bool has_A() const { 617 bool has_A() const {
678 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", " ", NULL)); 618 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", " ", NULL));
679 } 619 }
680 620
681 SkPdfDictionary* A() const { 621 SkPdfDictionary* A() const;
682 SkPdfDictionary* ret;
683 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "A", " ", &ret)) return ret;
684 // TODO(edisonn): warn about missing required field, assert for known good p dfs
685 return NULL;
686 }
687
688 /** (Optional; PDF 1.3; must be an indirect reference) The structure element to 622 /** (Optional; PDF 1.3; must be an indirect reference) The structure element to
689 * which the item refers (see Section 9.6.1, "Structure Hierarchy"). 623 * which the item refers (see Section 9.6.1, "Structure Hierarchy").
690 * Note: The ability to associate an outline item with a structure element (suc h as 624 * Note: The ability to associate an outline item with a structure element (suc h as
691 * the beginning of a chapter) is a PDF 1.3 feature. For backward compatibility 625 * the beginning of a chapter) is a PDF 1.3 feature. For backward compatibility
692 * with earlier PDF versions, such an item should also specify a destination (D est) 626 * with earlier PDF versions, such an item should also specify a destination (D est)
693 * corresponding to an area of a page where the contents of the designated stru cture 627 * corresponding to an area of a page where the contents of the designated stru cture
694 * element are displayed. 628 * element are displayed.
695 **/ 629 **/
696 bool has_SE() const { 630 bool has_SE() const {
697 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SE", "", NULL)); 631 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SE", "", NULL));
698 } 632 }
699 633
700 SkPdfDictionary* SE() const { 634 SkPdfDictionary* SE() const;
701 SkPdfDictionary* ret;
702 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "SE", "", &ret)) return ret;
703 // TODO(edisonn): warn about missing required field, assert for known good p dfs
704 return NULL;
705 }
706
707 /** (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0, repre - 635 /** (Optional; PDF 1.4) An array of three numbers in the range 0.0 to 1.0, repre -
708 * senting the components in the DeviceRGB color space of the color to be used 636 * senting the components in the DeviceRGB color space of the color to be used
709 * for the outline entry's text. Default value: [0.0 0.0 0.0]. 637 * for the outline entry's text. Default value: [0.0 0.0 0.0].
710 **/ 638 **/
711 bool has_C() const { 639 bool has_C() const {
712 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", " ", NULL)); 640 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", " ", NULL));
713 } 641 }
714 642
715 SkPdfArray* C() const { 643 SkPdfArray* C() const;
716 SkPdfArray* ret;
717 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "C", "", &r et)) return ret;
718 // TODO(edisonn): warn about missing required field, assert for known good p dfs
719 return NULL;
720 }
721
722 /** (Optional; PDF 1.4) A set of flags specifying style characteristics for disp lay- 644 /** (Optional; PDF 1.4) A set of flags specifying style characteristics for disp lay-
723 * ing the outline item's text (see Table 8.5). Default value: 0. 645 * ing the outline item's text (see Table 8.5). Default value: 0.
724 **/ 646 **/
725 bool has_F() const { 647 bool has_F() const {
726 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", " ", NULL)); 648 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", " ", NULL));
727 } 649 }
728 650
729 long F() const { 651 long F() const;
730 long ret;
731 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "", &re t)) return ret;
732 // TODO(edisonn): warn about missing required field, assert for known good p dfs
733 return 0;
734 }
735
736 }; 652 };
737 653
738 #endif // __DEFINED__SkPdfOutlineItemDictionary 654 #endif // __DEFINED__SkPdfOutlineItemDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698