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

Side by Side Diff: core/fpdfapi/fpdf_edit/include/cpdf_creator.h

Issue 1805603002: core/include/fdpfapi cleanup Part I. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Rebase to master Created 4 years, 9 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
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_image.cpp ('k') | core/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_INCLUDE_FPDFAPI_FPDF_SERIAL_H_ 7 #ifndef CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_SERIAL_H_ 8 #define CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
9 9
10 #include "core/include/fpdfapi/fpdf_page.h" 10 #include "core/include/fpdfapi/fpdf_page.h"
11 #include "core/include/fpdfapi/fpdf_pageobj.h" 11 #include "core/include/fpdfapi/fpdf_pageobj.h"
12 12
13 class CPDF_Parser;
13 class CPDF_XRefStream; 14 class CPDF_XRefStream;
14 class IPDF_CryptoHandler; 15 class IPDF_CryptoHandler;
15 16
16 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
17
18 #define FPDFCREATE_INCREMENTAL 1 17 #define FPDFCREATE_INCREMENTAL 1
19 #define FPDFCREATE_NO_ORIGINAL 2 18 #define FPDFCREATE_NO_ORIGINAL 2
20 #define FPDFCREATE_PROGRESSIVE 4 19 #define FPDFCREATE_PROGRESSIVE 4
21 #define FPDFCREATE_OBJECTSTREAM 8 20 #define FPDFCREATE_OBJECTSTREAM 8
22 21
22 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
23
23 class CPDF_Creator { 24 class CPDF_Creator {
24 public: 25 public:
25 CPDF_Creator(CPDF_Document* pDoc); 26 CPDF_Creator(CPDF_Document* pDoc);
26 ~CPDF_Creator(); 27 ~CPDF_Creator();
27 28
28 void RemoveSecurity(); 29 void RemoveSecurity();
29 bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0); 30 bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
30 int32_t Continue(IFX_Pause* pPause = NULL); 31 int32_t Continue(IFX_Pause* pPause = NULL);
31 FX_BOOL SetFileVersion(int32_t fileVersion = 17); 32 FX_BOOL SetFileVersion(int32_t fileVersion = 17);
32 33
33 protected: 34 private:
34 CPDF_Document* m_pDocument; 35 friend class CPDF_ObjectStream;
36 friend class CPDF_XRefStream;
35 37
36 CPDF_Parser* m_pParser;
37
38 FX_BOOL m_bCompress;
39
40 FX_BOOL m_bSecurityChanged;
41
42 CPDF_Dictionary* m_pEncryptDict;
43 FX_DWORD m_dwEnryptObjNum;
44 FX_BOOL m_bEncryptCloned;
45
46 FX_BOOL m_bStandardSecurity;
47
48 IPDF_CryptoHandler* m_pCryptoHandler;
49 FX_BOOL m_bNewCrypto;
50
51 FX_BOOL m_bEncryptMetadata;
52
53 CPDF_Object* m_pMetadata;
54
55 CPDF_XRefStream* m_pXRefStream;
56
57 int32_t m_ObjectStreamSize;
58
59 FX_DWORD m_dwLastObjNum;
60 bool Create(FX_DWORD flags); 38 bool Create(FX_DWORD flags);
61 void ResetStandardSecurity(); 39 void ResetStandardSecurity();
62 void Clear(); 40 void Clear();
41
42 void InitOldObjNumOffsets();
43 void InitNewObjNumOffsets();
44 void InitID(FX_BOOL bDefault = TRUE);
45
46 void AppendNewObjNum(FX_DWORD objbum);
47 int32_t AppendObjectNumberToXRef(FX_DWORD objnum);
48
63 int32_t WriteDoc_Stage1(IFX_Pause* pPause); 49 int32_t WriteDoc_Stage1(IFX_Pause* pPause);
64 int32_t WriteDoc_Stage2(IFX_Pause* pPause); 50 int32_t WriteDoc_Stage2(IFX_Pause* pPause);
65 int32_t WriteDoc_Stage3(IFX_Pause* pPause); 51 int32_t WriteDoc_Stage3(IFX_Pause* pPause);
66 int32_t WriteDoc_Stage4(IFX_Pause* pPause); 52 int32_t WriteDoc_Stage4(IFX_Pause* pPause);
67 53
68 CFX_FileBufferArchive m_File;
69
70 FX_FILESIZE m_Offset;
71 void InitOldObjNumOffsets();
72 void InitNewObjNumOffsets();
73 void AppendNewObjNum(FX_DWORD objbum);
74 int32_t WriteOldIndirectObject(FX_DWORD objnum); 54 int32_t WriteOldIndirectObject(FX_DWORD objnum);
75 int32_t WriteOldObjs(IFX_Pause* pPause); 55 int32_t WriteOldObjs(IFX_Pause* pPause);
76 int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause); 56 int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause);
77 int32_t WriteIndirectObj(const CPDF_Object* pObj); 57 int32_t WriteIndirectObj(const CPDF_Object* pObj);
78 int32_t WriteDirectObj(FX_DWORD objnum, 58 int32_t WriteDirectObj(FX_DWORD objnum,
79 const CPDF_Object* pObj, 59 const CPDF_Object* pObj,
80 FX_BOOL bEncrypt = TRUE); 60 FX_BOOL bEncrypt = TRUE);
81 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); 61 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj);
82 int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj); 62 int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
83 int32_t WriteIndirectObjectToStream(FX_DWORD objnum, 63 int32_t WriteIndirectObjectToStream(FX_DWORD objnum,
84 const uint8_t* pBuffer, 64 const uint8_t* pBuffer,
85 FX_DWORD dwSize); 65 FX_DWORD dwSize);
86 int32_t AppendObjectNumberToXRef(FX_DWORD objnum); 66
87 void InitID(FX_BOOL bDefault = TRUE);
88 int32_t WriteStream(const CPDF_Object* pStream, 67 int32_t WriteStream(const CPDF_Object* pStream,
89 FX_DWORD objnum, 68 FX_DWORD objnum,
90 IPDF_CryptoHandler* pCrypto); 69 IPDF_CryptoHandler* pCrypto);
91 70
71 CPDF_Document* m_pDocument;
72 CPDF_Parser* m_pParser;
73 FX_BOOL m_bCompress;
74 FX_BOOL m_bSecurityChanged;
75 CPDF_Dictionary* m_pEncryptDict;
76 FX_DWORD m_dwEnryptObjNum;
77 FX_BOOL m_bEncryptCloned;
78 FX_BOOL m_bStandardSecurity;
79 IPDF_CryptoHandler* m_pCryptoHandler;
80 FX_BOOL m_bNewCrypto;
81 FX_BOOL m_bEncryptMetadata;
82 CPDF_Object* m_pMetadata;
83 CPDF_XRefStream* m_pXRefStream;
84 int32_t m_ObjectStreamSize;
85 FX_DWORD m_dwLastObjNum;
86 CFX_FileBufferArchive m_File;
87 FX_FILESIZE m_Offset;
92 int32_t m_iStage; 88 int32_t m_iStage;
93 FX_DWORD m_dwFlags; 89 FX_DWORD m_dwFlags;
94 FX_POSITION m_Pos; 90 FX_POSITION m_Pos;
95 FX_FILESIZE m_XrefStart; 91 FX_FILESIZE m_XrefStart;
96 CFX_FileSizeListArray m_ObjectOffset; 92 CFX_FileSizeListArray m_ObjectOffset;
97 CFX_DWordArray m_NewObjNumArray; 93 CFX_DWordArray m_NewObjNumArray;
98 CPDF_Array* m_pIDArray; 94 CPDF_Array* m_pIDArray;
99 int32_t m_FileVersion; 95 int32_t m_FileVersion;
100
101 friend class CPDF_ObjectStream;
102 friend class CPDF_XRefStream;
103 }; 96 };
104 97
105 #endif // CORE_INCLUDE_FPDFAPI_FPDF_SERIAL_H_ 98 #endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_image.cpp ('k') | core/fpdfapi/fpdf_font/fpdf_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698