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