| OLD | NEW |
| 1 #ifndef __DEFINED__SkPdfEncryptionCommonDictionary | 1 #ifndef __DEFINED__SkPdfEncryptionCommonDictionary |
| 2 #define __DEFINED__SkPdfEncryptionCommonDictionary | 2 #define __DEFINED__SkPdfEncryptionCommonDictionary |
| 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 common to all encryption dictionaries | 9 // Entries common to all encryption dictionaries |
| 10 class SkPdfEncryptionCommonDictionary : public SkPdfDictionary { | 10 class SkPdfEncryptionCommonDictionary : public SkPdfDictionary { |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 SkPdfEncryptionCommonDictionary& operator=(const SkPdfEncryptionCommonDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} | 526 SkPdfEncryptionCommonDictionary& operator=(const SkPdfEncryptionCommonDictiona
ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb
j; return *this;} |
| 527 | 527 |
| 528 /** (Required) The name of the security handler for this document; see below. De
fault value: | 528 /** (Required) The name of the security handler for this document; see below. De
fault value: |
| 529 * Standard, for the built-in security handler. (Names for other security handl
ers can be | 529 * Standard, for the built-in security handler. (Names for other security handl
ers can be |
| 530 * registered using the procedure described in Appendix E.) | 530 * registered using the procedure described in Appendix E.) |
| 531 **/ | 531 **/ |
| 532 bool has_Filter() const { | 532 bool has_Filter() const { |
| 533 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filte
r", "", NULL)); | 533 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filte
r", "", NULL)); |
| 534 } | 534 } |
| 535 | 535 |
| 536 std::string Filter() const { | 536 std::string Filter() const; |
| 537 std::string ret; | |
| 538 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", ""
, &ret)) return ret; | |
| 539 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 540 return ""; | |
| 541 } | |
| 542 | |
| 543 /** (Optional but strongly recommended) A code specifying the algorithm to be us
ed in en- | 537 /** (Optional but strongly recommended) A code specifying the algorithm to be us
ed in en- |
| 544 * crypting and decrypting the document: | 538 * crypting and decrypting the document: |
| 545 * 0 An algorithm that is undocumented and no longer supported, and whos
e use is | 539 * 0 An algorithm that is undocumented and no longer supported, and whos
e use is |
| 546 * strongly discouraged. | 540 * strongly discouraged. |
| 547 * 1 Algorithm 3.1 on page 73, with an encryption key length of 40 bits;
see below. | 541 * 1 Algorithm 3.1 on page 73, with an encryption key length of 40 bits;
see below. |
| 548 * 2 (PDF 1.4) Algorithm 3.1 on page 73, but allowing encryption key len
gths greater | 542 * 2 (PDF 1.4) Algorithm 3.1 on page 73, but allowing encryption key len
gths greater |
| 549 * than 40 bits. | 543 * than 40 bits. |
| 550 * 3 (PDF 1.4) An unpublished algorithm allowing encryption key lengths
ranging | 544 * 3 (PDF 1.4) An unpublished algorithm allowing encryption key lengths
ranging |
| 551 * from 40 to 128 bits. (This algorithm is unpublished as an export re
quirement of | 545 * from 40 to 128 bits. (This algorithm is unpublished as an export re
quirement of |
| 552 * the U.S. Department of Commerce.) | 546 * the U.S. Department of Commerce.) |
| 553 * The default value if this entry is omitted is 0, but a value of 1 or greater
is strongly rec- | 547 * The default value if this entry is omitted is 0, but a value of 1 or greater
is strongly rec- |
| 554 * ommended. (See implementation note 15 in Appendix H.) | 548 * ommended. (See implementation note 15 in Appendix H.) |
| 555 **/ | 549 **/ |
| 556 bool has_V() const { | 550 bool has_V() const { |
| 557 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", "
", NULL)); | 551 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", "
", NULL)); |
| 558 } | 552 } |
| 559 | 553 |
| 560 double V() const { | 554 double V() const; |
| 561 double ret; | |
| 562 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", "", &
ret)) return ret; | |
| 563 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 564 return 0; | |
| 565 } | |
| 566 | |
| 567 /** (Optional; PDF 1.4; only if V is 2 or 3) The length of the encryption key, i
n bits. The value | 555 /** (Optional; PDF 1.4; only if V is 2 or 3) The length of the encryption key, i
n bits. The value |
| 568 * must be a multiple of 8, in the range 40 to 128. Default value: 40. | 556 * must be a multiple of 8, in the range 40 to 128. Default value: 40. |
| 569 **/ | 557 **/ |
| 570 bool has_Length() const { | 558 bool has_Length() const { |
| 571 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h", "", NULL)); | 559 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt
h", "", NULL)); |
| 572 } | 560 } |
| 573 | 561 |
| 574 long Length() const { | 562 long Length() const; |
| 575 long ret; | |
| 576 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length", ""
, &ret)) return ret; | |
| 577 // TODO(edisonn): warn about missing required field, assert for known good p
dfs | |
| 578 return 0; | |
| 579 } | |
| 580 | |
| 581 }; | 563 }; |
| 582 | 564 |
| 583 #endif // __DEFINED__SkPdfEncryptionCommonDictionary | 565 #endif // __DEFINED__SkPdfEncryptionCommonDictionary |
| OLD | NEW |