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

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

Issue 17856004: refactoring for pdf viewer lib (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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__SkPdfALinkAnnotationDictionary 1 #ifndef __DEFINED__SkPdfALinkAnnotationDictionary
2 #define __DEFINED__SkPdfALinkAnnotationDictionary 2 #define __DEFINED__SkPdfALinkAnnotationDictionary
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 link annotation 9 // Additional entries specific to a link annotation
10 class SkPdfALinkAnnotationDictionary : public SkPdfDictionary { 10 class SkPdfALinkAnnotationDictionary : public SkPdfDictionary {
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 525
526 SkPdfALinkAnnotationDictionary& operator=(const SkPdfALinkAnnotationDictionary & from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} 526 SkPdfALinkAnnotationDictionary& operator=(const SkPdfALinkAnnotationDictionary & from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;}
527 527
528 /** (Required) The type of annotation that this dictionary describes; must be Li nk 528 /** (Required) The type of annotation that this dictionary describes; must be Li nk
529 * for a link annotation. 529 * for a link annotation.
530 **/ 530 **/
531 bool has_Subtype() const { 531 bool has_Subtype() const {
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty pe", "", NULL)); 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subty pe", "", NULL));
533 } 533 }
534 534
535 std::string Subtype() const { 535 std::string Subtype() const;
536 std::string ret;
537 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Subtype", " ", &ret)) return ret;
538 // TODO(edisonn): warn about missing required field, assert for known good p dfs
539 return "";
540 }
541
542 /** (Optional; PDF 1.4) An alternate representation of the annotation's contents in 536 /** (Optional; PDF 1.4) An alternate representation of the annotation's contents in
543 * human-readable form, useful when extracting the document's contents in sup- 537 * human-readable form, useful when extracting the document's contents in sup-
544 * port of accessibility to disabled users or for other purposes (see Section 9 .8.2, 538 * port of accessibility to disabled users or for other purposes (see Section 9 .8.2,
545 * "Alternate Descriptions"). 539 * "Alternate Descriptions").
546 **/ 540 **/
547 bool has_Contents() const { 541 bool has_Contents() const {
548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte nts", "", NULL)); 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Conte nts", "", NULL));
549 } 543 }
550 544
551 std::string Contents() const { 545 std::string Contents() const;
552 std::string ret;
553 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Contents" , "", &ret)) return ret;
554 // TODO(edisonn): warn about missing required field, assert for known good p dfs
555 return "";
556 }
557
558 /** (Optional; not permitted if an A entry is present) A destination to be displ ayed 546 /** (Optional; not permitted if an A entry is present) A destination to be displ ayed
559 * when the annotation is activated (see Section 8.2.1, "Destinations"; see als o 547 * when the annotation is activated (see Section 8.2.1, "Destinations"; see als o
560 * implementation note 66 in Appendix H). 548 * implementation note 66 in Appendix H).
561 **/ 549 **/
562 bool has_Dest() const { 550 bool has_Dest() const {
563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest" , "", NULL)); 551 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest" , "", NULL));
564 } 552 }
565 553
566 bool isDestAArray() const { 554 bool isDestAArray() const {
567 SkPdfObject* ret = NULL; 555 SkPdfObject* ret = NULL;
568 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 556 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
569 return ret->podofo()->GetDataType() == ePdfDataType_Array; 557 return ret->podofo()->GetDataType() == ePdfDataType_Array;
570 } 558 }
571 559
572 SkPdfArray* getDestAsArray() const { 560 SkPdfArray* getDestAsArray() const;
573 SkPdfArray* ret = NULL;
574 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
575 // TODO(edisonn): warn about missing required field, assert for known good p dfs
576 return NULL;
577 }
578
579 bool isDestAName() const { 561 bool isDestAName() const {
580 SkPdfObject* ret = NULL; 562 SkPdfObject* ret = NULL;
581 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 563 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
582 return ret->podofo()->GetDataType() == ePdfDataType_Name; 564 return ret->podofo()->GetDataType() == ePdfDataType_Name;
583 } 565 }
584 566
585 std::string getDestAsName() const { 567 std::string getDestAsName() const;
586 std::string ret = "";
587 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "", &ret)) return ret;
588 // TODO(edisonn): warn about missing required field, assert for known good p dfs
589 return "";
590 }
591
592 bool isDestAString() const { 568 bool isDestAString() const {
593 SkPdfObject* ret = NULL; 569 SkPdfObject* ret = NULL;
594 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false; 570 if (!ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", " ", &ret)) return false;
595 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString; 571 return ret->podofo()->GetDataType() == ePdfDataType_String || ret->podofo()- >GetDataType() == ePdfDataType_HexString;
596 } 572 }
597 573
598 std::string getDestAsString() const { 574 std::string getDestAsString() const;
599 std::string ret = "";
600 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Dest", "" , &ret)) return ret;
601 // TODO(edisonn): warn about missing required field, assert for known good p dfs
602 return "";
603 }
604
605 /** (Optional; PDF 1.2) The annotation's highlighting mode, the visual effect to be 575 /** (Optional; PDF 1.2) The annotation's highlighting mode, the visual effect to be
606 * used when the mouse button is pressed or held down inside its active area: 576 * used when the mouse button is pressed or held down inside its active area:
607 * N (None) No highlighting. 577 * N (None) No highlighting.
608 * I (Invert) Invert the contents of the annotation rectangle. 578 * I (Invert) Invert the contents of the annotation rectangle.
609 * O (Outline) Invert the annotation's border. 579 * O (Outline) Invert the annotation's border.
610 * P (Push) Display the annotation's down appearance, if any (see Sectio n 580 * P (Push) Display the annotation's down appearance, if any (see Sectio n
611 * 8.4.4, "Appearance Streams"). If no down appearance is defined, off set 581 * 8.4.4, "Appearance Streams"). If no down appearance is defined, off set
612 * the contents of the annotation rectangle to appear as if it were be ing 582 * the contents of the annotation rectangle to appear as if it were be ing
613 * "pushed" below the surface of the page. 583 * "pushed" below the surface of the page.
614 * A highlighting mode other than P overrides any down appearance defined for 584 * A highlighting mode other than P overrides any down appearance defined for
615 * the annotation. Default value: I. 585 * the annotation. Default value: I.
616 * Note: In PDF 1.1, highlighting is always done by inverting colors inside the anno- 586 * Note: In PDF 1.1, highlighting is always done by inverting colors inside the anno-
617 * tation rectangle. 587 * tation rectangle.
618 **/ 588 **/
619 bool has_H() const { 589 bool has_H() const {
620 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "H", " ", NULL)); 590 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "H", " ", NULL));
621 } 591 }
622 592
623 std::string H() const { 593 std::string H() const;
624 std::string ret;
625 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "H", "", &re t)) return ret;
626 // TODO(edisonn): warn about missing required field, assert for known good p dfs
627 return "";
628 }
629
630 /** (Optional; PDF 1.3) A URI action (see "URI Actions" on page 523) formerly 594 /** (Optional; PDF 1.3) A URI action (see "URI Actions" on page 523) formerly
631 * associated with this annotation. When Web Capture (Section 9.9, "Web Cap- 595 * associated with this annotation. When Web Capture (Section 9.9, "Web Cap-
632 * ture") changes an annotation from a URI to a go-to action ("Go-To Actions" 596 * ture") changes an annotation from a URI to a go-to action ("Go-To Actions"
633 * on page 519), it uses this entry to save the data from the original URI acti on so 597 * on page 519), it uses this entry to save the data from the original URI acti on so
634 * that it can be changed back in case the target page for the go-to action is subse- 598 * that it can be changed back in case the target page for the go-to action is subse-
635 * quently deleted. 599 * quently deleted.
636 **/ 600 **/
637 bool has_PA() const { 601 bool has_PA() const {
638 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PA", "", NULL)); 602 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PA", "", NULL));
639 } 603 }
640 604
641 SkPdfDictionary* PA() const { 605 SkPdfDictionary* PA() const;
642 SkPdfDictionary* ret;
643 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PA", "", &ret)) return ret;
644 // TODO(edisonn): warn about missing required field, assert for known good p dfs
645 return NULL;
646 }
647
648 }; 606 };
649 607
650 #endif // __DEFINED__SkPdfALinkAnnotationDictionary 608 #endif // __DEFINED__SkPdfALinkAnnotationDictionary
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfUtils.cpp ('k') | experimental/PdfViewer/autogen/SkPdfALinkAnnotationDictionary_autogen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698