OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 24 matching lines...) Expand all Loading... |
35 #define FPDFPERM_PRINT 0x0004 | 35 #define FPDFPERM_PRINT 0x0004 |
36 #define FPDFPERM_MODIFY 0x0008 | 36 #define FPDFPERM_MODIFY 0x0008 |
37 #define FPDFPERM_EXTRACT 0x0010 | 37 #define FPDFPERM_EXTRACT 0x0010 |
38 #define FPDFPERM_ANNOT_FORM 0x0020 | 38 #define FPDFPERM_ANNOT_FORM 0x0020 |
39 #define FPDFPERM_FILL_FORM 0x0100 | 39 #define FPDFPERM_FILL_FORM 0x0100 |
40 #define FPDFPERM_EXTRACT_ACCESS 0x0200 | 40 #define FPDFPERM_EXTRACT_ACCESS 0x0200 |
41 #define FPDFPERM_ASSEMBLE 0x0400 | 41 #define FPDFPERM_ASSEMBLE 0x0400 |
42 #define FPDFPERM_PRINT_HIGH 0x0800 | 42 #define FPDFPERM_PRINT_HIGH 0x0800 |
43 #define FPDF_PAGE_MAX_NUM 0xFFFFF | 43 #define FPDF_PAGE_MAX_NUM 0xFFFFF |
44 | 44 |
45 // TODO(thestig) Using unique_ptr with ReleaseDeleter is still not ideal. | |
46 // Come up or wait for something better. | |
47 using ScopedFileStream = | |
48 std::unique_ptr<IFX_FileStream, ReleaseDeleter<IFX_FileStream>>; | |
49 | |
50 template <typename T> | |
51 class ScopedSetInsertion { | |
52 public: | |
53 ScopedSetInsertion(std::set<T>* org_set, T elem) | |
54 : m_Set(org_set), m_Entry(elem) { | |
55 m_Set->insert(m_Entry); | |
56 } | |
57 ~ScopedSetInsertion() { m_Set->erase(m_Entry); } | |
58 | |
59 private: | |
60 std::set<T>* const m_Set; | |
61 const T m_Entry; | |
62 }; | |
63 | |
64 // Indexed by 8-bit char code, contains unicode code points. | 45 // Indexed by 8-bit char code, contains unicode code points. |
65 extern const FX_WORD PDFDocEncoding[256]; | 46 extern const FX_WORD PDFDocEncoding[256]; |
66 | 47 |
67 class CPDF_CryptoHandler { | 48 class CPDF_CryptoHandler { |
68 public: | 49 public: |
69 virtual ~CPDF_CryptoHandler() {} | 50 virtual ~CPDF_CryptoHandler() {} |
70 | 51 |
71 virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, | 52 virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict, |
72 IPDF_SecurityHandler* pSecurityHandler) = 0; | 53 IPDF_SecurityHandler* pSecurityHandler) = 0; |
73 | 54 |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 FX_DWORD src_size, | 310 FX_DWORD src_size, |
330 const CPDF_Dictionary* pDict, | 311 const CPDF_Dictionary* pDict, |
331 uint8_t*& dest_buf, | 312 uint8_t*& dest_buf, |
332 FX_DWORD& dest_size, | 313 FX_DWORD& dest_size, |
333 CFX_ByteString& ImageEncoding, | 314 CFX_ByteString& ImageEncoding, |
334 CPDF_Dictionary*& pImageParms, | 315 CPDF_Dictionary*& pImageParms, |
335 FX_DWORD estimated_size, | 316 FX_DWORD estimated_size, |
336 FX_BOOL bImageAcc); | 317 FX_BOOL bImageAcc); |
337 | 318 |
338 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ | 319 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ |
OLD | NEW |