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_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ |
8 #define CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ | 8 #define CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_basic.h" | 10 #include "core/fxcrt/include/fx_basic.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #define FPDFCREATE_OBJECTSTREAM 8 | 23 #define FPDFCREATE_OBJECTSTREAM 8 |
24 | 24 |
25 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj); | 25 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj); |
26 | 26 |
27 class CPDF_Creator { | 27 class CPDF_Creator { |
28 public: | 28 public: |
29 CPDF_Creator(CPDF_Document* pDoc); | 29 CPDF_Creator(CPDF_Document* pDoc); |
30 ~CPDF_Creator(); | 30 ~CPDF_Creator(); |
31 | 31 |
32 void RemoveSecurity(); | 32 void RemoveSecurity(); |
33 bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); | 33 bool Create(IFX_StreamWrite* pFile, uint32_t flags = 0); |
34 int32_t Continue(IFX_Pause* pPause = NULL); | 34 int32_t Continue(IFX_Pause* pPause = NULL); |
35 FX_BOOL SetFileVersion(int32_t fileVersion = 17); | 35 FX_BOOL SetFileVersion(int32_t fileVersion = 17); |
36 | 36 |
37 private: | 37 private: |
38 friend class CPDF_ObjectStream; | 38 friend class CPDF_ObjectStream; |
39 friend class CPDF_XRefStream; | 39 friend class CPDF_XRefStream; |
40 | 40 |
41 bool Create(FX_DWORD flags); | 41 bool Create(uint32_t flags); |
42 void ResetStandardSecurity(); | 42 void ResetStandardSecurity(); |
43 void Clear(); | 43 void Clear(); |
44 | 44 |
45 void InitOldObjNumOffsets(); | 45 void InitOldObjNumOffsets(); |
46 void InitNewObjNumOffsets(); | 46 void InitNewObjNumOffsets(); |
47 void InitID(FX_BOOL bDefault = TRUE); | 47 void InitID(FX_BOOL bDefault = TRUE); |
48 | 48 |
49 void AppendNewObjNum(FX_DWORD objbum); | 49 void AppendNewObjNum(uint32_t objbum); |
50 int32_t AppendObjectNumberToXRef(FX_DWORD objnum); | 50 int32_t AppendObjectNumberToXRef(uint32_t objnum); |
51 | 51 |
52 int32_t WriteDoc_Stage1(IFX_Pause* pPause); | 52 int32_t WriteDoc_Stage1(IFX_Pause* pPause); |
53 int32_t WriteDoc_Stage2(IFX_Pause* pPause); | 53 int32_t WriteDoc_Stage2(IFX_Pause* pPause); |
54 int32_t WriteDoc_Stage3(IFX_Pause* pPause); | 54 int32_t WriteDoc_Stage3(IFX_Pause* pPause); |
55 int32_t WriteDoc_Stage4(IFX_Pause* pPause); | 55 int32_t WriteDoc_Stage4(IFX_Pause* pPause); |
56 | 56 |
57 int32_t WriteOldIndirectObject(FX_DWORD objnum); | 57 int32_t WriteOldIndirectObject(uint32_t objnum); |
58 int32_t WriteOldObjs(IFX_Pause* pPause); | 58 int32_t WriteOldObjs(IFX_Pause* pPause); |
59 int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause); | 59 int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause); |
60 int32_t WriteIndirectObj(const CPDF_Object* pObj); | 60 int32_t WriteIndirectObj(const CPDF_Object* pObj); |
61 int32_t WriteDirectObj(FX_DWORD objnum, | 61 int32_t WriteDirectObj(uint32_t objnum, |
62 const CPDF_Object* pObj, | 62 const CPDF_Object* pObj, |
63 FX_BOOL bEncrypt = TRUE); | 63 FX_BOOL bEncrypt = TRUE); |
64 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); | 64 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); |
65 int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); | 65 int32_t WriteIndirectObj(uint32_t objnum, const CPDF_Object* pObj); |
66 int32_t WriteIndirectObjectToStream(FX_DWORD objnum, | 66 int32_t WriteIndirectObjectToStream(uint32_t objnum, |
67 const uint8_t* pBuffer, | 67 const uint8_t* pBuffer, |
68 FX_DWORD dwSize); | 68 uint32_t dwSize); |
69 | 69 |
70 int32_t WriteStream(const CPDF_Object* pStream, | 70 int32_t WriteStream(const CPDF_Object* pStream, |
71 FX_DWORD objnum, | 71 uint32_t objnum, |
72 IPDF_CryptoHandler* pCrypto); | 72 IPDF_CryptoHandler* pCrypto); |
73 | 73 |
74 CPDF_Document* m_pDocument; | 74 CPDF_Document* m_pDocument; |
75 CPDF_Parser* m_pParser; | 75 CPDF_Parser* m_pParser; |
76 FX_BOOL m_bCompress; | 76 FX_BOOL m_bCompress; |
77 FX_BOOL m_bSecurityChanged; | 77 FX_BOOL m_bSecurityChanged; |
78 CPDF_Dictionary* m_pEncryptDict; | 78 CPDF_Dictionary* m_pEncryptDict; |
79 FX_DWORD m_dwEnryptObjNum; | 79 uint32_t m_dwEnryptObjNum; |
80 FX_BOOL m_bEncryptCloned; | 80 FX_BOOL m_bEncryptCloned; |
81 FX_BOOL m_bStandardSecurity; | 81 FX_BOOL m_bStandardSecurity; |
82 IPDF_CryptoHandler* m_pCryptoHandler; | 82 IPDF_CryptoHandler* m_pCryptoHandler; |
83 FX_BOOL m_bNewCrypto; | 83 FX_BOOL m_bNewCrypto; |
84 FX_BOOL m_bEncryptMetadata; | 84 FX_BOOL m_bEncryptMetadata; |
85 CPDF_Object* m_pMetadata; | 85 CPDF_Object* m_pMetadata; |
86 CPDF_XRefStream* m_pXRefStream; | 86 CPDF_XRefStream* m_pXRefStream; |
87 int32_t m_ObjectStreamSize; | 87 int32_t m_ObjectStreamSize; |
88 FX_DWORD m_dwLastObjNum; | 88 uint32_t m_dwLastObjNum; |
89 CFX_FileBufferArchive m_File; | 89 CFX_FileBufferArchive m_File; |
90 FX_FILESIZE m_Offset; | 90 FX_FILESIZE m_Offset; |
91 int32_t m_iStage; | 91 int32_t m_iStage; |
92 FX_DWORD m_dwFlags; | 92 uint32_t m_dwFlags; |
93 FX_POSITION m_Pos; | 93 FX_POSITION m_Pos; |
94 FX_FILESIZE m_XrefStart; | 94 FX_FILESIZE m_XrefStart; |
95 CFX_FileSizeListArray m_ObjectOffset; | 95 CFX_FileSizeListArray m_ObjectOffset; |
96 CFX_ArrayTemplate<FX_DWORD> m_NewObjNumArray; | 96 CFX_ArrayTemplate<uint32_t> m_NewObjNumArray; |
97 CPDF_Array* m_pIDArray; | 97 CPDF_Array* m_pIDArray; |
98 int32_t m_FileVersion; | 98 int32_t m_FileVersion; |
99 }; | 99 }; |
100 | 100 |
101 #endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ | 101 #endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ |
OLD | NEW |