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 1976003003: Clean up CPDF_Creator. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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_create.cpp ('k') | no next file » | 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_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 <memory>
11
10 #include "core/fxcrt/include/fx_basic.h" 12 #include "core/fxcrt/include/fx_basic.h"
11 13
12 class CPDF_Array; 14 class CPDF_Array;
13 class CPDF_CryptoHandler; 15 class CPDF_CryptoHandler;
14 class CPDF_Dictionary; 16 class CPDF_Dictionary;
15 class CPDF_Document; 17 class CPDF_Document;
16 class CPDF_Object; 18 class CPDF_Object;
17 class CPDF_Parser; 19 class CPDF_Parser;
18 class CPDF_XRefStream; 20 class CPDF_XRefStream;
19 21
20 #define FPDFCREATE_INCREMENTAL 1 22 #define FPDFCREATE_INCREMENTAL 1
21 #define FPDFCREATE_NO_ORIGINAL 2 23 #define FPDFCREATE_NO_ORIGINAL 2
22 #define FPDFCREATE_PROGRESSIVE 4 24 #define FPDFCREATE_PROGRESSIVE 4
23 #define FPDFCREATE_OBJECTSTREAM 8 25 #define FPDFCREATE_OBJECTSTREAM 8
24 26
25 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj); 27 CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj);
26 28
27 class CPDF_Creator { 29 class CPDF_Creator {
28 public: 30 public:
29 CPDF_Creator(CPDF_Document* pDoc); 31 explicit CPDF_Creator(CPDF_Document* pDoc);
30 ~CPDF_Creator(); 32 ~CPDF_Creator();
31 33
32 void RemoveSecurity(); 34 void RemoveSecurity();
33 bool Create(IFX_StreamWrite* pFile, uint32_t flags = 0); 35 bool Create(IFX_StreamWrite* pFile, uint32_t flags = 0);
34 int32_t Continue(IFX_Pause* pPause = NULL); 36 int32_t Continue(IFX_Pause* pPause = NULL);
35 FX_BOOL SetFileVersion(int32_t fileVersion = 17); 37 FX_BOOL SetFileVersion(int32_t fileVersion = 17);
36 38
37 private: 39 private:
38 friend class CPDF_ObjectStream; 40 friend class CPDF_ObjectStream;
39 friend class CPDF_XRefStream; 41 friend class CPDF_XRefStream;
(...skipping 24 matching lines...) Expand all
64 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj); 66 int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj);
65 int32_t WriteIndirectObj(uint32_t objnum, const CPDF_Object* pObj); 67 int32_t WriteIndirectObj(uint32_t objnum, const CPDF_Object* pObj);
66 int32_t WriteIndirectObjectToStream(uint32_t objnum, 68 int32_t WriteIndirectObjectToStream(uint32_t objnum,
67 const uint8_t* pBuffer, 69 const uint8_t* pBuffer,
68 uint32_t dwSize); 70 uint32_t dwSize);
69 71
70 int32_t WriteStream(const CPDF_Object* pStream, 72 int32_t WriteStream(const CPDF_Object* pStream,
71 uint32_t objnum, 73 uint32_t objnum,
72 CPDF_CryptoHandler* pCrypto); 74 CPDF_CryptoHandler* pCrypto);
73 75
74 CPDF_Document* m_pDocument; 76 CPDF_Document* const m_pDocument;
75 CPDF_Parser* m_pParser; 77 CPDF_Parser* const m_pParser;
76 FX_BOOL m_bCompress;
77 FX_BOOL m_bSecurityChanged; 78 FX_BOOL m_bSecurityChanged;
78 CPDF_Dictionary* m_pEncryptDict; 79 CPDF_Dictionary* m_pEncryptDict;
79 uint32_t m_dwEnryptObjNum; 80 uint32_t m_dwEncryptObjNum;
80 FX_BOOL m_bEncryptCloned; 81 FX_BOOL m_bEncryptCloned;
81 CPDF_CryptoHandler* m_pCryptoHandler; 82 CPDF_CryptoHandler* m_pCryptoHandler;
82 FX_BOOL m_bLocalCryptoHandler; 83 FX_BOOL m_bLocalCryptoHandler;
83 FX_BOOL m_bEncryptMetadata;
84 CPDF_Object* m_pMetadata; 84 CPDF_Object* m_pMetadata;
85 CPDF_XRefStream* m_pXRefStream; 85 std::unique_ptr<CPDF_XRefStream> m_pXRefStream;
86 int32_t m_ObjectStreamSize; 86 int32_t m_ObjectStreamSize;
87 uint32_t m_dwLastObjNum; 87 uint32_t m_dwLastObjNum;
88 CFX_FileBufferArchive m_File; 88 CFX_FileBufferArchive m_File;
89 FX_FILESIZE m_Offset; 89 FX_FILESIZE m_Offset;
90 int32_t m_iStage; 90 int32_t m_iStage;
91 uint32_t m_dwFlags; 91 uint32_t m_dwFlags;
92 FX_POSITION m_Pos; 92 FX_POSITION m_Pos;
93 FX_FILESIZE m_XrefStart; 93 FX_FILESIZE m_XrefStart;
94 CFX_FileSizeListArray m_ObjectOffset; 94 CFX_FileSizeListArray m_ObjectOffset;
95 CFX_ArrayTemplate<uint32_t> m_NewObjNumArray; 95 CFX_ArrayTemplate<uint32_t> m_NewObjNumArray;
96 CPDF_Array* m_pIDArray; 96 CPDF_Array* m_pIDArray;
97 int32_t m_FileVersion; 97 int32_t m_FileVersion;
98 }; 98 };
99 99
100 #endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_ 100 #endif // CORE_FPDFAPI_FPDF_EDIT_INCLUDE_CPDF_CREATOR_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698