OLD | NEW |
1 #ifndef __DEFINED__SkPdfFDFDictionary | 1 #ifndef __DEFINED__SkPdfFDFDictionary |
2 #define __DEFINED__SkPdfFDFDictionary | 2 #define __DEFINED__SkPdfFDFDictionary |
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 FDF dictionary | 9 // Entries in the FDF dictionary |
10 class SkPdfFDFDictionary : public SkPdfDictionary { | 10 class SkPdfFDFDictionary : public SkPdfDictionary { |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 | 525 |
526 SkPdfFDFDictionary& operator=(const SkPdfFDFDictionary& from) {this->fPodofoDo
c = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} | 526 SkPdfFDFDictionary& operator=(const SkPdfFDFDictionary& from) {this->fPodofoDo
c = from.fPodofoDoc; this->fPodofoObj = from.fPodofoObj; return *this;} |
527 | 527 |
528 /** (Optional) The source file or target file: the PDF document file that | 528 /** (Optional) The source file or target file: the PDF document file that |
529 * this FDF file was exported from or is intended to be imported into. | 529 * this FDF file was exported from or is intended to be imported into. |
530 **/ | 530 **/ |
531 bool has_F() const { | 531 bool has_F() const { |
532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); | 532 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "
", NULL)); |
533 } | 533 } |
534 | 534 |
535 SkPdfFileSpec F() const { | 535 SkPdfFileSpec F() const; |
536 SkPdfFileSpec ret; | |
537 if (FileSpecFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "F", "",
&ret)) return ret; | |
538 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
539 return SkPdfFileSpec(); | |
540 } | |
541 | |
542 /** (Optional) An array of two strings constituting a file identifier (see | 536 /** (Optional) An array of two strings constituting a file identifier (see |
543 * Section 9.3, "File Identifiers") for the source or target file designated | 537 * Section 9.3, "File Identifiers") for the source or target file designated |
544 * by F, taken from the ID entry in the file's trailer dictionary (see Sec- | 538 * by F, taken from the ID entry in the file's trailer dictionary (see Sec- |
545 * tion 3.4.4, "File Trailer"). | 539 * tion 3.4.4, "File Trailer"). |
546 **/ | 540 **/ |
547 bool has_ID() const { | 541 bool has_ID() const { |
548 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); | 542 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID",
"", NULL)); |
549 } | 543 } |
550 | 544 |
551 SkPdfArray* ID() const { | 545 SkPdfArray* ID() const; |
552 SkPdfArray* ret; | |
553 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "ID", "", &
ret)) return ret; | |
554 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
555 return NULL; | |
556 } | |
557 | |
558 /** (Optional) An array of FDF field dictionaries (see "FDF Fields" on | 546 /** (Optional) An array of FDF field dictionaries (see "FDF Fields" on |
559 * page 564) describing the root fields (those with no ancestors in | 547 * page 564) describing the root fields (those with no ancestors in |
560 * the field hierarchy) to be exported or imported. This entry and | 548 * the field hierarchy) to be exported or imported. This entry and |
561 * the Pages entry may not both be present. | 549 * the Pages entry may not both be present. |
562 **/ | 550 **/ |
563 bool has_Fields() const { | 551 bool has_Fields() const { |
564 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Field
s", "", NULL)); | 552 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Field
s", "", NULL)); |
565 } | 553 } |
566 | 554 |
567 SkPdfArray* Fields() const { | 555 SkPdfArray* Fields() const; |
568 SkPdfArray* ret; | |
569 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Fields", "
", &ret)) return ret; | |
570 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
571 return NULL; | |
572 } | |
573 | |
574 /** (Optional) A status string to be displayed indicating the result of an | 556 /** (Optional) A status string to be displayed indicating the result of an |
575 * action, typically a submit-form action (see "Submit-Form Actions" | 557 * action, typically a submit-form action (see "Submit-Form Actions" |
576 * on page 550). The string is encoded with PDFDocEncoding. (See | 558 * on page 550). The string is encoded with PDFDocEncoding. (See |
577 * implementation note 91 in Appendix H.) This entry and the Pages | 559 * implementation note 91 in Appendix H.) This entry and the Pages |
578 * entry may not both be present. | 560 * entry may not both be present. |
579 **/ | 561 **/ |
580 bool has_Status() const { | 562 bool has_Status() const { |
581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Statu
s", "", NULL)); | 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Statu
s", "", NULL)); |
582 } | 564 } |
583 | 565 |
584 std::string Status() const { | 566 std::string Status() const; |
585 std::string ret; | |
586 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Status",
"", &ret)) return ret; | |
587 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
588 return ""; | |
589 } | |
590 | |
591 /** (Optional; PDF 1.3) An array of FDF page dictionaries (see "FDF | 567 /** (Optional; PDF 1.3) An array of FDF page dictionaries (see "FDF |
592 * Pages" on page 566) describing new pages to be added to a PDF | 568 * Pages" on page 566) describing new pages to be added to a PDF |
593 * target document. The Fields and Status entries may not be present | 569 * target document. The Fields and Status entries may not be present |
594 * together with this entry. | 570 * together with this entry. |
595 **/ | 571 **/ |
596 bool has_Pages() const { | 572 bool has_Pages() const { |
597 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); | 573 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages
", "", NULL)); |
598 } | 574 } |
599 | 575 |
600 SkPdfArray* Pages() const { | 576 SkPdfArray* Pages() const; |
601 SkPdfArray* ret; | |
602 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Pages", ""
, &ret)) return ret; | |
603 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
604 return NULL; | |
605 } | |
606 | |
607 /** (Optional; PDF 1.3) The encoding to be used for any FDF field | 577 /** (Optional; PDF 1.3) The encoding to be used for any FDF field |
608 * value or option (V or Opt in the field dictionary; see Table 8.72 on | 578 * value or option (V or Opt in the field dictionary; see Table 8.72 on |
609 * page 564) that is a string and does not begin with the Unicode pre- | 579 * page 564) that is a string and does not begin with the Unicode pre- |
610 * fix U+FEFF. (See implementation note 92 in Appendix H.) Default | 580 * fix U+FEFF. (See implementation note 92 in Appendix H.) Default |
611 * value: PDFDocEncoding. | 581 * value: PDFDocEncoding. |
612 **/ | 582 **/ |
613 bool has_Encoding() const { | 583 bool has_Encoding() const { |
614 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encod
ing", "", NULL)); | 584 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encod
ing", "", NULL)); |
615 } | 585 } |
616 | 586 |
617 std::string Encoding() const { | 587 std::string Encoding() const; |
618 std::string ret; | |
619 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Encoding",
"", &ret)) return ret; | |
620 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
621 return ""; | |
622 } | |
623 | |
624 /** (Optional; PDF 1.3) An array of FDF annotation dictionaries (see | 588 /** (Optional; PDF 1.3) An array of FDF annotation dictionaries (see |
625 * "FDF Annotation Dictionaries" on page 568). The array can in- | 589 * "FDF Annotation Dictionaries" on page 568). The array can in- |
626 * clude annotations of any of the standard types listed in Table 8.14 | 590 * clude annotations of any of the standard types listed in Table 8.14 |
627 * on page 499 except Link, Movie, Widget, PrinterMark, and TrapNet. | 591 * on page 499 except Link, Movie, Widget, PrinterMark, and TrapNet. |
628 **/ | 592 **/ |
629 bool has_Annots() const { | 593 bool has_Annots() const { |
630 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annot
s", "", NULL)); | 594 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annot
s", "", NULL)); |
631 } | 595 } |
632 | 596 |
633 SkPdfArray* Annots() const { | 597 SkPdfArray* Annots() const; |
634 SkPdfArray* ret; | |
635 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Annots", "
", &ret)) return ret; | |
636 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
637 return NULL; | |
638 } | |
639 | |
640 /** (Optional; PDF 1.4) A stream containing all the bytes in all incre- | 598 /** (Optional; PDF 1.4) A stream containing all the bytes in all incre- |
641 * mental updates made to the underlying PDF document since it was | 599 * mental updates made to the underlying PDF document since it was |
642 * opened (see Section 3.4.5, "Incremental Updates"). If a submit- | 600 * opened (see Section 3.4.5, "Incremental Updates"). If a submit- |
643 * form action submitting the document to a remote server in FDF | 601 * form action submitting the document to a remote server in FDF |
644 * format has its IncludeAppendSaves flag set (see "Submit-Form | 602 * format has its IncludeAppendSaves flag set (see "Submit-Form |
645 * Actions" on page 550), the contents of this stream are included in | 603 * Actions" on page 550), the contents of this stream are included in |
646 * the submission. This allows any digital signatures (see "Signature | 604 * the submission. This allows any digital signatures (see "Signature |
647 * Fields" on page 547) to be transmitted to the server. An incremental | 605 * Fields" on page 547) to be transmitted to the server. An incremental |
648 * update is automatically performed just before the submission takes | 606 * update is automatically performed just before the submission takes |
649 * place, in order to capture all changes made to the document. Note | 607 * place, in order to capture all changes made to the document. Note |
650 * that the submission always includes the full set of incremental up- | 608 * that the submission always includes the full set of incremental up- |
651 * dates back to the time the document was first opened, even if some | 609 * dates back to the time the document was first opened, even if some |
652 * of them may already have been included in intervening submissions. | 610 * of them may already have been included in intervening submissions. |
653 * Note: Although a Fields or Annots entry (or both) may be present | 611 * Note: Although a Fields or Annots entry (or both) may be present |
654 * along with Differences, there is no guarantee that their contents will be | 612 * along with Differences, there is no guarantee that their contents will be |
655 * consistent with it. In particular, if Differences contains a digital signa- | 613 * consistent with it. In particular, if Differences contains a digital signa- |
656 * ture, only the values of the form fields given in the Differences stream | 614 * ture, only the values of the form fields given in the Differences stream |
657 * can be considered trustworthy under that signature. | 615 * can be considered trustworthy under that signature. |
658 **/ | 616 **/ |
659 bool has_Differences() const { | 617 bool has_Differences() const { |
660 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Diffe
rences", "", NULL)); | 618 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Diffe
rences", "", NULL)); |
661 } | 619 } |
662 | 620 |
663 SkPdfStream* Differences() const { | 621 SkPdfStream* Differences() const; |
664 SkPdfStream* ret; | |
665 if (StreamFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Differenc
es", "", &ret)) return ret; | |
666 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
667 return NULL; | |
668 } | |
669 | |
670 /** (Optional; PDF 1.4) The name of a browser frame in which the un- | 622 /** (Optional; PDF 1.4) The name of a browser frame in which the un- |
671 * derlying PDF document is to be opened. This mimics the behavior | 623 * derlying PDF document is to be opened. This mimics the behavior |
672 * of the target attribute in HTML <href> tags. | 624 * of the target attribute in HTML <href> tags. |
673 **/ | 625 **/ |
674 bool has_Target() const { | 626 bool has_Target() const { |
675 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Targe
t", "", NULL)); | 627 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Targe
t", "", NULL)); |
676 } | 628 } |
677 | 629 |
678 std::string Target() const { | 630 std::string Target() const; |
679 std::string ret; | |
680 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Target",
"", &ret)) return ret; | |
681 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
682 return ""; | |
683 } | |
684 | |
685 /** (Optional; PDF 1.4) An array of file specifications (see Section 3.10, | 631 /** (Optional; PDF 1.4) An array of file specifications (see Section 3.10, |
686 * "File Specifications") representing other FDF files embedded with- | 632 * "File Specifications") representing other FDF files embedded with- |
687 * in this one (Section 3.10.3, "Embedded File Streams"). | 633 * in this one (Section 3.10.3, "Embedded File Streams"). |
688 **/ | 634 **/ |
689 bool has_EmbeddedFDFs() const { | 635 bool has_EmbeddedFDFs() const { |
690 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embed
dedFDFs", "", NULL)); | 636 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Embed
dedFDFs", "", NULL)); |
691 } | 637 } |
692 | 638 |
693 SkPdfArray* EmbeddedFDFs() const { | 639 SkPdfArray* EmbeddedFDFs() const; |
694 SkPdfArray* ret; | |
695 if (ArrayFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "EmbeddedFD
Fs", "", &ret)) return ret; | |
696 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
697 return NULL; | |
698 } | |
699 | |
700 /** (Optional; PDF 1.4) A JavaScript dictionary (see Table 8.71) defin- | 640 /** (Optional; PDF 1.4) A JavaScript dictionary (see Table 8.71) defin- |
701 * ing document-level JavaScript scripts. | 641 * ing document-level JavaScript scripts. |
702 **/ | 642 **/ |
703 bool has_JavaScript() const { | 643 bool has_JavaScript() const { |
704 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", NULL)); | 644 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", NULL)); |
705 } | 645 } |
706 | 646 |
707 SkPdfDictionary* JavaScript() const { | 647 SkPdfDictionary* JavaScript() const; |
708 SkPdfDictionary* ret; | |
709 if (DictionaryFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "JavaS
cript", "", &ret)) return ret; | |
710 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
711 return NULL; | |
712 } | |
713 | |
714 }; | 648 }; |
715 | 649 |
716 #endif // __DEFINED__SkPdfFDFDictionary | 650 #endif // __DEFINED__SkPdfFDFDictionary |
OLD | NEW |