1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_
8 #define CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_
9 
10 class CPDF_ObjectStream
11 {
12 public:
13     CPDF_ObjectStream();
14 
15     FX_BOOL				Start();
16 
17     FX_INT32			CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj);
18     FX_INT32			CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize);
19 
20     FX_FILESIZE			End(CPDF_Creator* pCreator);
21 
22     CFX_DWordArray		m_ObjNumArray;
23 
24     CFX_ByteTextBuf		m_Buffer;
25     FX_DWORD			m_dwObjNum;
26     FX_INT32			m_index;
27 protected:
28 
29     CFX_DWordArray		m_OffsetArray;
30 };
31 class CPDF_XRefStream
32 {
33 public:
34 
35     CPDF_XRefStream();
36 
37     FX_BOOL				Start();
38 
39     FX_INT32			CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object *pObj, CPDF_Creator *pCreator);
40 
41     FX_INT32			CompressIndirectObject(FX_DWORD dwObjNum, FX_LPCBYTE pBuffer, FX_DWORD dwSize, CPDF_Creator *pCreator);
42 
43     FX_BOOL				End(CPDF_Creator *pCreator, FX_BOOL bEOF = FALSE);
44     FX_BOOL				AddObjectNumberToIndexArray(FX_DWORD objnum);
45     FX_BOOL				EndXRefStream(CPDF_Creator* pCreator);
46 
47 
48     CFX_DWordArray		m_IndexArray;
49 
50     FX_FILESIZE			m_PrevOffset;
51     FX_DWORD			m_dwTempObjNum;
52 
53 protected:
54     FX_INT32			EndObjectStream(CPDF_Creator *pCreator, FX_BOOL bEOF = TRUE);
55     FX_BOOL				GenerateXRefStream(CPDF_Creator* pCreator, FX_BOOL bEOF);
56     FX_INT32			m_iSeg;
57     CPDF_ObjectStream	m_ObjStream;
58     CFX_ByteTextBuf		m_Buffer;
59 };
60 
61 #endif  // CORE_SRC_FPDFAPI_FPDF_EDIT_EDITINT_H_
62