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

Side by Side Diff: experimental/PdfViewer/autogen/SkPdfStandardSecurityHandlerDictionary_autogen.h

Issue 17856004: refactoring for pdf viewer lib (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__SkPdfStandardSecurityHandlerDictionary 1 #ifndef __DEFINED__SkPdfStandardSecurityHandlerDictionary
2 #define __DEFINED__SkPdfStandardSecurityHandlerDictionary 2 #define __DEFINED__SkPdfStandardSecurityHandlerDictionary
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 // Additional encryption dictionary entries for the standard security handler 9 // Additional encryption dictionary entries for the standard security handler
10 class SkPdfStandardSecurityHandlerDictionary : public SkPdfDictionary { 10 class SkPdfStandardSecurityHandlerDictionary : public SkPdfDictionary {
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 * be used to interpret this dictionary. The revision number should be 2 if the document is 529 * be used to interpret this dictionary. The revision number should be 2 if the document is
530 * encrypted with a V value less than 2 (see Table 3.13) and does not have any of the access 530 * encrypted with a V value less than 2 (see Table 3.13) and does not have any of the access
531 * permissions set (via the P entry, below) that are designated "Revision 3" in Table 3.15; 531 * permissions set (via the P entry, below) that are designated "Revision 3" in Table 3.15;
532 * otherwise (that is, if the document is encrypted with a V value greater than 2 or has any 532 * otherwise (that is, if the document is encrypted with a V value greater than 2 or has any
533 * "Revision 3" access permissions set), this value should be 3. 533 * "Revision 3" access permissions set), this value should be 3.
534 **/ 534 **/
535 bool has_R() const { 535 bool has_R() const {
536 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", " ", NULL)); 536 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", " ", NULL));
537 } 537 }
538 538
539 double R() const { 539 double R() const;
540 double ret;
541 if (DoubleFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "R", "", & ret)) return ret;
542 // TODO(edisonn): warn about missing required field, assert for known good p dfs
543 return 0;
544 }
545
546 /** (Required) A 32-byte string, based on both the owner and user passwords, tha t is used in 540 /** (Required) A 32-byte string, based on both the owner and user passwords, tha t is used in
547 * computing the encryption key and in determining whether a valid owner passwo rd was 541 * computing the encryption key and in determining whether a valid owner passwo rd was
548 * entered. For more information, see "Encryption Key Algorithm" on page 78 and "Pass- 542 * entered. For more information, see "Encryption Key Algorithm" on page 78 and "Pass-
549 * word Algorithms" on page 79. 543 * word Algorithms" on page 79.
550 **/ 544 **/
551 bool has_O() const { 545 bool has_O() const {
552 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "O", " ", NULL)); 546 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "O", " ", NULL));
553 } 547 }
554 548
555 std::string O() const { 549 std::string O() const;
556 std::string ret;
557 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "O", "", & ret)) return ret;
558 // TODO(edisonn): warn about missing required field, assert for known good p dfs
559 return "";
560 }
561
562 /** (Required) A 32-byte string, based on the user password, that is used in det ermining 550 /** (Required) A 32-byte string, based on the user password, that is used in det ermining
563 * whether to prompt the user for a password and, if so, whether a valid user o r owner pass- 551 * whether to prompt the user for a password and, if so, whether a valid user o r owner pass-
564 * word was entered. For more information, see "Password Algorithms" on page 79 . 552 * word was entered. For more information, see "Password Algorithms" on page 79 .
565 **/ 553 **/
566 bool has_U() const { 554 bool has_U() const {
567 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "U", " ", NULL)); 555 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "U", " ", NULL));
568 } 556 }
569 557
570 std::string U() const { 558 std::string U() const;
571 std::string ret;
572 if (StringFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "U", "", & ret)) return ret;
573 // TODO(edisonn): warn about missing required field, assert for known good p dfs
574 return "";
575 }
576
577 /** (Required) A set of flags specifying which operations are permitted when the document is 559 /** (Required) A set of flags specifying which operations are permitted when the document is
578 * opened with user access (see Table 3.15). 560 * opened with user access (see Table 3.15).
579 **/ 561 **/
580 bool has_P() const { 562 bool has_P() const {
581 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", " ", NULL)); 563 return (ObjectFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", " ", NULL));
582 } 564 }
583 565
584 long P() const { 566 long P() const;
585 long ret;
586 if (LongFromDictionary(fPodofoDoc, fPodofoObj->GetDictionary(), "P", "", &re t)) return ret;
587 // TODO(edisonn): warn about missing required field, assert for known good p dfs
588 return 0;
589 }
590
591 }; 567 };
592 568
593 #endif // __DEFINED__SkPdfStandardSecurityHandlerDictionary 569 #endif // __DEFINED__SkPdfStandardSecurityHandlerDictionary
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698