OLD | NEW |
1 #ifndef __DEFINED__SkPdfViewerPreferencesDictionary | 1 #ifndef __DEFINED__SkPdfViewerPreferencesDictionary |
2 #define __DEFINED__SkPdfViewerPreferencesDictionary | 2 #define __DEFINED__SkPdfViewerPreferencesDictionary |
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 a viewer preferences dictionary |
8 class SkPdfViewerPreferencesDictionary : public SkPdfDictionary { | 9 class SkPdfViewerPreferencesDictionary : public SkPdfDictionary { |
9 public: | 10 public: |
10 virtual SkPdfObjectType getType() const { return kViewerPreferencesDictionary_
SkPdfObjectType;} | 11 virtual SkPdfObjectType getType() const { return kViewerPreferencesDictionary_
SkPdfObjectType;} |
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kViewerP
referencesDictionary_SkPdfObjectType + 1);} | 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kViewerP
referencesDictionary_SkPdfObjectType + 1);} |
12 public: | 13 public: |
13 virtual SkPdfViewerPreferencesDictionary* asViewerPreferencesDictionary() {ret
urn this;} | 14 virtual SkPdfViewerPreferencesDictionary* asViewerPreferencesDictionary() {ret
urn this;} |
14 virtual const SkPdfViewerPreferencesDictionary* asViewerPreferencesDictionary(
) const {return this;} | 15 virtual const SkPdfViewerPreferencesDictionary* asViewerPreferencesDictionary(
) 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 SkPdfViewerPreferencesDictionary(const PdfMemDocument* podofoDoc = NULL, const
PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} | 519 SkPdfViewerPreferencesDictionary(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 SkPdfViewerPreferencesDictionary& operator=(const SkPdfViewerPreferencesDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} | 523 SkPdfViewerPreferencesDictionary& operator=(const SkPdfViewerPreferencesDictio
nary& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofo
Obj; return *this;} |
523 | 524 |
| 525 /** (Optional) A flag specifying whether to hide the viewer application's tool |
| 526 * bars when the document is active. Default value: false. |
| 527 **/ |
| 528 bool has_HideToolbar() const { |
| 529 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideT
oolbar", "", NULL)); |
| 530 } |
| 531 |
524 bool HideToolbar() const { | 532 bool HideToolbar() const { |
525 bool ret; | 533 bool ret; |
526 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideToolbar
", "", &ret)) return ret; | 534 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideToolbar
", "", &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 false; | 536 return false; |
529 } | 537 } |
530 | 538 |
| 539 /** (Optional) A flag specifying whether to hide the viewer application's |
| 540 * menu bar when the document is active. Default value: false. |
| 541 **/ |
| 542 bool has_HideMenubar() const { |
| 543 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideM
enubar", "", NULL)); |
| 544 } |
| 545 |
531 bool HideMenubar() const { | 546 bool HideMenubar() const { |
532 bool ret; | 547 bool ret; |
533 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideMenubar
", "", &ret)) return ret; | 548 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideMenubar
", "", &ret)) return ret; |
534 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 549 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
535 return false; | 550 return false; |
536 } | 551 } |
537 | 552 |
| 553 /** (Optional) A flag specifying whether to hide user interface elements in |
| 554 * the document's window (such as scroll bars and navigation controls), |
| 555 * leaving only the document's contents displayed. Default value: false. |
| 556 **/ |
| 557 bool has_HideWindowUI() const { |
| 558 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideW
indowUI", "", NULL)); |
| 559 } |
| 560 |
538 bool HideWindowUI() const { | 561 bool HideWindowUI() const { |
539 bool ret; | 562 bool ret; |
540 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideWindowU
I", "", &ret)) return ret; | 563 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "HideWindowU
I", "", &ret)) return ret; |
541 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 564 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
542 return false; | 565 return false; |
543 } | 566 } |
544 | 567 |
| 568 /** (Optional) A flag specifying whether to resize the document's window to |
| 569 * fit the size of the first displayed page. Default value: false. |
| 570 **/ |
| 571 bool has_FitWindow() const { |
| 572 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FitWi
ndow", "", NULL)); |
| 573 } |
| 574 |
545 bool FitWindow() const { | 575 bool FitWindow() const { |
546 bool ret; | 576 bool ret; |
547 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FitWindow",
"", &ret)) return ret; | 577 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "FitWindow",
"", &ret)) return ret; |
548 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 578 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
549 return false; | 579 return false; |
550 } | 580 } |
551 | 581 |
| 582 /** (Optional) A flag specifying whether to position the document's window |
| 583 * in the center of the screen. Default value: false. |
| 584 **/ |
| 585 bool has_CenterWindow() const { |
| 586 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Cente
rWindow", "", NULL)); |
| 587 } |
| 588 |
552 bool CenterWindow() const { | 589 bool CenterWindow() const { |
553 bool ret; | 590 bool ret; |
554 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CenterWindo
w", "", &ret)) return ret; | 591 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "CenterWindo
w", "", &ret)) return ret; |
555 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 592 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
556 return false; | 593 return false; |
557 } | 594 } |
558 | 595 |
| 596 /** (Optional; PDF 1.4) A flag specifying whether the window's title bar |
| 597 * should display the document title taken from the Title entry of the docu- |
| 598 * ment information dictionary (see Section 9.2.1, "Document Informa- |
| 599 * tion Dictionary"). If false, the title bar should instead display the name |
| 600 * of the PDF file containing the document. Default value: false. |
| 601 **/ |
| 602 bool has_DisplayDocTitle() const { |
| 603 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Displ
ayDocTitle", "", NULL)); |
| 604 } |
| 605 |
559 bool DisplayDocTitle() const { | 606 bool DisplayDocTitle() const { |
560 bool ret; | 607 bool ret; |
561 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DisplayDocT
itle", "", &ret)) return ret; | 608 if (BoolFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "DisplayDocT
itle", "", &ret)) return ret; |
562 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 609 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
563 return false; | 610 return false; |
564 } | 611 } |
565 | 612 |
| 613 /** (Optional) The document's page mode, specifying how to display the |
| 614 * document on exiting full-screen mode: |
| 615 * UseNone Neither document outline nor thumbnail images |
| 616 * visible |
| 617 * UseOutlines Document outline visible |
| 618 * UseThumbs Thumbnail images visible |
| 619 * This entry is meaningful only if the value of the PageMode entry in the |
| 620 * catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; |
| 621 * it is ignored otherwise. Default value: UseNone. |
| 622 **/ |
| 623 bool has_NonFullScreenPageMode() const { |
| 624 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "NonFu
llScreenPageMode", "", NULL)); |
| 625 } |
| 626 |
566 std::string NonFullScreenPageMode() const { | 627 std::string NonFullScreenPageMode() const { |
567 std::string ret; | 628 std::string ret; |
568 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "NonFullScre
enPageMode", "", &ret)) return ret; | 629 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "NonFullScre
enPageMode", "", &ret)) return ret; |
569 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 630 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
570 return ""; | 631 return ""; |
571 } | 632 } |
572 | 633 |
| 634 /** (Optional; PDF 1.3) The predominant reading order for text: |
| 635 * L2R Left to right |
| 636 * R2L Right to left (including vertical writing systems |
| 637 * such as Chinese, Japanese, and Korean) |
| 638 * This entry has no direct effect on the document's contents or page num- |
| 639 * bering, but can be used to determine the relative positioning of pages |
| 640 * when displayed side by side or printed n-up. Default value: L2R. |
| 641 **/ |
| 642 bool has_Direction() const { |
| 643 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Direc
tion", "", NULL)); |
| 644 } |
| 645 |
573 std::string Direction() const { | 646 std::string Direction() const { |
574 std::string ret; | 647 std::string ret; |
575 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Direction",
"", &ret)) return ret; | 648 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Direction",
"", &ret)) return ret; |
576 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 649 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
577 return ""; | 650 return ""; |
578 } | 651 } |
579 | 652 |
| 653 /** (Optional; PDF 1.4) The name of the page boundary representing the |
| 654 * area of a page to be displayed when viewing the document on the screen. |
| 655 * The value is the key designating the relevant page boundary in the page |
| 656 * object (see "Page Objects" on page 87 and Section 9.10.1, "Page Bound- |
| 657 * aries"). If the specified page boundary is not defined in the page object, |
| 658 * its default value will be used, as specified in Table 3.18 on page 88. |
| 659 * Default value: CropBox. |
| 660 * Note: This entry is intended primarily for use by prepress applications that |
| 661 * interpret or manipulate the page boundaries as described in Section 9.10.1, |
| 662 * "Page Boundaries." Most PDF consumer applications will disregard it. |
| 663 **/ |
| 664 bool has_ViewArea() const { |
| 665 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewA
rea", "", NULL)); |
| 666 } |
| 667 |
580 std::string ViewArea() const { | 668 std::string ViewArea() const { |
581 std::string ret; | 669 std::string ret; |
582 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewArea",
"", &ret)) return ret; | 670 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewArea",
"", &ret)) return ret; |
583 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 671 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
584 return ""; | 672 return ""; |
585 } | 673 } |
586 | 674 |
| 675 /** (Optional; PDF 1.4) The name of the page boundary to which the con- |
| 676 * tents of a page are to be clipped when viewing the document on the |
| 677 * screen. The value is the key designating the relevant page boundary in |
| 678 * the page object (see "Page Objects" on page 87 and Section 9.10.1, "Page |
| 679 * Boundaries"). If the specified page boundary is not defined in the page |
| 680 * object, its default value will be used, as specified in Table 3.18 on page |
| 681 * 88. Default value: CropBox. |
| 682 * Note: This entry is intended primarily for use by prepress applications that |
| 683 * interpret or manipulate the page boundaries as described in Section 9.10.1, |
| 684 * "Page Boundaries." Most PDF consumer applications will disregard it. |
| 685 **/ |
| 686 bool has_ViewClip() const { |
| 687 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewC
lip", "", NULL)); |
| 688 } |
| 689 |
587 std::string ViewClip() const { | 690 std::string ViewClip() const { |
588 std::string ret; | 691 std::string ret; |
589 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewClip",
"", &ret)) return ret; | 692 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ViewClip",
"", &ret)) return ret; |
590 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 693 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
591 return ""; | 694 return ""; |
592 } | 695 } |
593 | 696 |
| 697 /** (Optional; PDF 1.4) The name of the page boundary representing the |
| 698 * area of a page to be rendered when printing the document. The value is |
| 699 * the key designating the relevant page boundary in the page object (see |
| 700 * "Page Objects" on page 87 and Section 9.10.1, "Page Boundaries"). If the |
| 701 * specified page boundary is not defined in the page object, its default value |
| 702 * will be used, as specified in Table 3.18 on page 88. Default value: CropBox. |
| 703 * Note: This entry is intended primarily for use by prepress applications that |
| 704 * interpret or manipulate the page boundaries as described in Section 9.10.1, |
| 705 * "Page Boundaries." Most PDF consumer applications will disregard it. |
| 706 **/ |
| 707 bool has_PrintArea() const { |
| 708 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Print
Area", "", NULL)); |
| 709 } |
| 710 |
594 std::string PrintArea() const { | 711 std::string PrintArea() const { |
595 std::string ret; | 712 std::string ret; |
596 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PrintArea",
"", &ret)) return ret; | 713 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PrintArea",
"", &ret)) return ret; |
597 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 714 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
598 return ""; | 715 return ""; |
599 } | 716 } |
600 | 717 |
| 718 /** (Optional; PDF 1.4) The name of the page boundary to which the con- |
| 719 * tents of a page are to be clipped when printing the document. The value |
| 720 * is the key designating the relevant page boundary in the page object (see |
| 721 * "Page Objects" on page 87 and Section 9.10.1, "Page Boundaries"). If the |
| 722 * specified page boundary is not defined in the page object, its default value |
| 723 * will be used, as specified in Table 3.18 on page 88. Default value: CropBox. |
| 724 * Note: This entry is intended primarily for use by prepress applications that |
| 725 * interpret or manipulate the page boundaries as described in Section 9.10.1, |
| 726 * "Page Boundaries." Most PDF consumer applications will disregard it. |
| 727 **/ |
| 728 bool has_PrintClip() const { |
| 729 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Print
Clip", "", NULL)); |
| 730 } |
| 731 |
601 std::string PrintClip() const { | 732 std::string PrintClip() const { |
602 std::string ret; | 733 std::string ret; |
603 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PrintClip",
"", &ret)) return ret; | 734 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "PrintClip",
"", &ret)) return ret; |
604 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | 735 // TODO(edisonn): warn about missing required field, assert for known good p
dfs |
605 return ""; | 736 return ""; |
606 } | 737 } |
607 | 738 |
608 }; | 739 }; |
609 | 740 |
610 #endif // __DEFINED__SkPdfViewerPreferencesDictionary | 741 #endif // __DEFINED__SkPdfViewerPreferencesDictionary |
OLD | NEW |