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

Side by Side Diff: experimental/PdfViewer/SkPdfEncryptionCommonDictionary_autogen.h

Issue 16975013: Deal with ca and CA transparency operators in pdf. add comments to generated classes. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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__SkPdfEncryptionCommonDictionary 1 #ifndef __DEFINED__SkPdfEncryptionCommonDictionary
2 #define __DEFINED__SkPdfEncryptionCommonDictionary 2 #define __DEFINED__SkPdfEncryptionCommonDictionary
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 common to all encryption dictionaries
8 class SkPdfEncryptionCommonDictionary : public SkPdfDictionary { 9 class SkPdfEncryptionCommonDictionary : public SkPdfDictionary {
9 public: 10 public:
10 virtual SkPdfObjectType getType() const { return kEncryptionCommonDictionary_S kPdfObjectType;} 11 virtual SkPdfObjectType getType() const { return kEncryptionCommonDictionary_S kPdfObjectType;}
11 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEncrypt ionCommonDictionary_SkPdfObjectType + 1);} 12 virtual SkPdfObjectType getTypeEnd() const { return (SkPdfObjectType)(kEncrypt ionCommonDictionary_SkPdfObjectType + 1);}
12 public: 13 public:
13 virtual SkPdfEncryptionCommonDictionary* asEncryptionCommonDictionary() {retur n this;} 14 virtual SkPdfEncryptionCommonDictionary* asEncryptionCommonDictionary() {retur n this;}
14 virtual const SkPdfEncryptionCommonDictionary* asEncryptionCommonDictionary() const {return this;} 15 virtual const SkPdfEncryptionCommonDictionary* asEncryptionCommonDictionary() 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
514 515
515 public: 516 public:
516 private: 517 private:
517 public: 518 public:
518 SkPdfEncryptionCommonDictionary(const PdfMemDocument* podofoDoc = NULL, const PdfObject* podofoObj = NULL) : SkPdfDictionary(podofoDoc, podofoObj) {} 519 SkPdfEncryptionCommonDictionary(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 SkPdfEncryptionCommonDictionary& operator=(const SkPdfEncryptionCommonDictiona ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb j; return *this;} 523 SkPdfEncryptionCommonDictionary& operator=(const SkPdfEncryptionCommonDictiona ry& from) {this->fPodofoDoc = from.fPodofoDoc; this->fPodofoObj = from.fPodofoOb j; return *this;}
523 524
525 /** (Required) The name of the security handler for this document; see below. De fault value:
526 * Standard, for the built-in security handler. (Names for other security handl ers can be
527 * registered using the procedure described in Appendix E.)
528 **/
529 bool has_Filter() const {
530 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filte r", "", NULL));
531 }
532
524 std::string Filter() const { 533 std::string Filter() const {
525 std::string ret; 534 std::string ret;
526 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", "" , &ret)) return ret; 535 if (NameFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Filter", "" , &ret)) return ret;
527 // TODO(edisonn): warn about missing required field, assert for known good p dfs 536 // TODO(edisonn): warn about missing required field, assert for known good p dfs
528 return ""; 537 return "";
529 } 538 }
530 539
540 /** (Optional but strongly recommended) A code specifying the algorithm to be us ed in en-
541 * crypting and decrypting the document:
542 * 0 An algorithm that is undocumented and no longer supported, and whos e use is
543 * strongly discouraged.
544 * 1 Algorithm 3.1 on page 73, with an encryption key length of 40 bits; see below.
545 * 2 (PDF 1.4) Algorithm 3.1 on page 73, but allowing encryption key len gths greater
546 * than 40 bits.
547 * 3 (PDF 1.4) An unpublished algorithm allowing encryption key lengths ranging
548 * from 40 to 128 bits. (This algorithm is unpublished as an export re quirement of
549 * the U.S. Department of Commerce.)
550 * The default value if this entry is omitted is 0, but a value of 1 or greater is strongly rec-
551 * ommended. (See implementation note 15 in Appendix H.)
552 **/
553 bool has_V() const {
554 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", " ", NULL));
555 }
556
531 double V() const { 557 double V() const {
532 double ret; 558 double ret;
533 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", "", & ret)) return ret; 559 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "V", "", & ret)) return ret;
534 // TODO(edisonn): warn about missing required field, assert for known good p dfs 560 // TODO(edisonn): warn about missing required field, assert for known good p dfs
535 return 0; 561 return 0;
536 } 562 }
537 563
564 /** (Optional; PDF 1.4; only if V is 2 or 3) The length of the encryption key, i n bits. The value
565 * must be a multiple of 8, in the range 40 to 128. Default value: 40.
566 **/
567 bool has_Length() const {
568 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Lengt h", "", NULL));
569 }
570
538 long Length() const { 571 long Length() const {
539 long ret; 572 long ret;
540 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length", "" , &ret)) return ret; 573 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "Length", "" , &ret)) return ret;
541 // TODO(edisonn): warn about missing required field, assert for known good p dfs 574 // TODO(edisonn): warn about missing required field, assert for known good p dfs
542 return 0; 575 return 0;
543 } 576 }
544 577
545 }; 578 };
546 579
547 #endif // __DEFINED__SkPdfEncryptionCommonDictionary 580 #endif // __DEFINED__SkPdfEncryptionCommonDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698