OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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_FPDFAPI_EDIT_CPDF_CREATOR_H_ | 7 #ifndef CORE_FPDFAPI_EDIT_CPDF_CREATOR_H_ |
8 #define CORE_FPDFAPI_EDIT_CPDF_CREATOR_H_ | 8 #define CORE_FPDFAPI_EDIT_CPDF_CREATOR_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
| 12 #include "core/fxcrt/cfx_retain_ptr.h" |
12 #include "core/fxcrt/fx_basic.h" | 13 #include "core/fxcrt/fx_basic.h" |
13 | 14 |
14 class CPDF_Array; | 15 class CPDF_Array; |
15 class CPDF_CryptoHandler; | 16 class CPDF_CryptoHandler; |
16 class CPDF_Dictionary; | 17 class CPDF_Dictionary; |
17 class CPDF_Document; | 18 class CPDF_Document; |
18 class CPDF_Object; | 19 class CPDF_Object; |
19 class CPDF_Parser; | 20 class CPDF_Parser; |
20 class CPDF_XRefStream; | 21 class CPDF_XRefStream; |
21 | 22 |
22 #define FPDFCREATE_INCREMENTAL 1 | 23 #define FPDFCREATE_INCREMENTAL 1 |
23 #define FPDFCREATE_NO_ORIGINAL 2 | 24 #define FPDFCREATE_NO_ORIGINAL 2 |
24 #define FPDFCREATE_PROGRESSIVE 4 | 25 #define FPDFCREATE_PROGRESSIVE 4 |
25 #define FPDFCREATE_OBJECTSTREAM 8 | 26 #define FPDFCREATE_OBJECTSTREAM 8 |
26 | 27 |
27 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj); | 28 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj); |
28 | 29 |
29 class CPDF_Creator { | 30 class CPDF_Creator { |
30 public: | 31 public: |
31 explicit CPDF_Creator(CPDF_Document* pDoc); | 32 explicit CPDF_Creator(CPDF_Document* pDoc); |
32 ~CPDF_Creator(); | 33 ~CPDF_Creator(); |
33 | 34 |
34 void RemoveSecurity(); | 35 void RemoveSecurity(); |
35 bool Create(IFX_WriteStream* pFile, uint32_t flags = 0); | 36 bool Create(const CFX_RetainPtr<IFX_WriteStream>& pFile, uint32_t flags = 0); |
36 int32_t Continue(IFX_Pause* pPause = nullptr); | 37 int32_t Continue(IFX_Pause* pPause = nullptr); |
37 bool SetFileVersion(int32_t fileVersion = 17); | 38 bool SetFileVersion(int32_t fileVersion = 17); |
38 | 39 |
39 private: | 40 private: |
40 friend class CPDF_ObjectStream; | 41 friend class CPDF_ObjectStream; |
41 friend class CPDF_XRefStream; | 42 friend class CPDF_XRefStream; |
42 | 43 |
43 bool Create(uint32_t flags); | 44 bool Create(uint32_t flags); |
44 void ResetStandardSecurity(); | 45 void ResetStandardSecurity(); |
45 void Clear(); | 46 void Clear(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 uint32_t m_dwFlags; | 93 uint32_t m_dwFlags; |
93 FX_POSITION m_Pos; | 94 FX_POSITION m_Pos; |
94 FX_FILESIZE m_XrefStart; | 95 FX_FILESIZE m_XrefStart; |
95 CFX_FileSizeListArray m_ObjectOffset; | 96 CFX_FileSizeListArray m_ObjectOffset; |
96 CFX_ArrayTemplate<uint32_t> m_NewObjNumArray; | 97 CFX_ArrayTemplate<uint32_t> m_NewObjNumArray; |
97 std::unique_ptr<CPDF_Array> m_pIDArray; | 98 std::unique_ptr<CPDF_Array> m_pIDArray; |
98 int32_t m_FileVersion; | 99 int32_t m_FileVersion; |
99 }; | 100 }; |
100 | 101 |
101 #endif // CORE_FPDFAPI_EDIT_CPDF_CREATOR_H_ | 102 #endif // CORE_FPDFAPI_EDIT_CPDF_CREATOR_H_ |
OLD | NEW |