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

Side by Side Diff: core/include/fpdfapi/fpdf_parser.h

Issue 1353093003: Support linearized loading (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 1 month 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 | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.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_PARSER_H_ 7 #ifndef CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 8 #define CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
9 9
10 #include "../../../public/fpdf_dataavail.h"
10 #include "../../../third_party/base/nonstd_unique_ptr.h" 11 #include "../../../third_party/base/nonstd_unique_ptr.h"
11 #include "../fxcrt/fx_system.h" 12 #include "../fxcrt/fx_system.h"
12 #include "fpdf_objects.h" 13 #include "fpdf_objects.h"
13 14
15 class CFDF_Document;
16 class CFDF_Parser;
17 class CFX_AffineMatrix;
18 class CFX_DIBSource;
19 class CFX_FloatRect;
20 class CFX_Font;
21 class CFX_PrivateData;
22 class CPDF_ColorSpace;
23 class CPDF_CryptoHandler;
24 class CPDF_DocPageData;
25 class CPDF_DocRenderData;
14 class CPDF_Document; 26 class CPDF_Document;
27 class CPDF_Font;
28 class CPDF_FontEncoding;
29 class CPDF_HintTables;
30 class CPDF_IccProfile;
31 class CPDF_Image;
32 class CPDF_ModuleMgr;
33 class CPDF_Object;
15 class CPDF_Parser; 34 class CPDF_Parser;
35 class CPDF_Pattern;
36 class CPDF_Point;
16 class CPDF_SecurityHandler; 37 class CPDF_SecurityHandler;
17 class CPDF_StandardSecurityHandler; 38 class CPDF_StandardSecurityHandler;
18 class CPDF_CryptoHandler;
19 class CPDF_Object;
20 class IFX_FileRead; 39 class IFX_FileRead;
21 class CFDF_Document; 40
22 class CFDF_Parser;
23 class CFX_Font;
24 class CFX_AffineMatrix;
25 class CFX_FloatRect;
26 class CPDF_Point;
27 class CPDF_DocPageData;
28 class CPDF_DocRenderData;
29 class CPDF_ModuleMgr;
30 class CFX_DIBSource;
31 class CPDF_Font;
32 class CPDF_Image;
33 class CPDF_ColorSpace;
34 class CPDF_Pattern;
35 class CPDF_FontEncoding;
36 class CPDF_IccProfile;
37 class CFX_PrivateData;
38 #define FPDFPERM_PRINT 0x0004 41 #define FPDFPERM_PRINT 0x0004
39 #define FPDFPERM_MODIFY 0x0008 42 #define FPDFPERM_MODIFY 0x0008
40 #define FPDFPERM_EXTRACT 0x0010 43 #define FPDFPERM_EXTRACT 0x0010
41 #define FPDFPERM_ANNOT_FORM 0x0020 44 #define FPDFPERM_ANNOT_FORM 0x0020
42 #define FPDFPERM_FILL_FORM 0x0100 45 #define FPDFPERM_FILL_FORM 0x0100
43 #define FPDFPERM_EXTRACT_ACCESS 0x0200 46 #define FPDFPERM_EXTRACT_ACCESS 0x0200
44 #define FPDFPERM_ASSEMBLE 0x0400 47 #define FPDFPERM_ASSEMBLE 0x0400
45 #define FPDFPERM_PRINT_HIGH 0x0800 48 #define FPDFPERM_PRINT_HIGH 0x0800
46 #define FPDF_PAGE_MAX_NUM 0xFFFFF 49 #define FPDF_PAGE_MAX_NUM 0xFFFFF
47 50
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 class IFX_FileAvail { 859 class IFX_FileAvail {
857 public: 860 public:
858 virtual ~IFX_FileAvail() {} 861 virtual ~IFX_FileAvail() {}
859 virtual FX_BOOL IsDataAvail(FX_FILESIZE offset, FX_DWORD size) = 0; 862 virtual FX_BOOL IsDataAvail(FX_FILESIZE offset, FX_DWORD size) = 0;
860 }; 863 };
861 class IFX_DownloadHints { 864 class IFX_DownloadHints {
862 public: 865 public:
863 virtual ~IFX_DownloadHints() {} 866 virtual ~IFX_DownloadHints() {}
864 virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0; 867 virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
865 }; 868 };
866 #define PDF_IS_LINEARIZED 1 869
867 #define PDF_NOT_LINEARIZED 0
868 #define PDF_UNKNOW_LINEARIZED -1
869 #define PDFFORM_NOTAVAIL 0
870 #define PDFFORM_AVAIL 1
871 #define PDFFORM_NOTEXIST 2
872 class IPDF_DataAvail { 870 class IPDF_DataAvail {
873 public: 871 public:
874 static IPDF_DataAvail* Create(IFX_FileAvail* pFileAvail, 872 static IPDF_DataAvail* Create(IFX_FileAvail* pFileAvail,
875 IFX_FileRead* pFileRead); 873 IFX_FileRead* pFileRead);
876 virtual ~IPDF_DataAvail() {} 874 virtual ~IPDF_DataAvail() {}
877 875
878 IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; } 876 IFX_FileAvail* GetFileAvail() const { return m_pFileAvail; }
879 IFX_FileRead* GetFileRead() const { return m_pFileRead; } 877 IFX_FileRead* GetFileRead() const { return m_pFileRead; }
880 878
881 virtual FX_BOOL IsDocAvail(IFX_DownloadHints* pHints) = 0; 879 virtual int IsDocAvail(IFX_DownloadHints* pHints) = 0;
882 virtual void SetDocument(CPDF_Document* pDoc) = 0; 880 virtual void SetDocument(CPDF_Document* pDoc) = 0;
883 virtual FX_BOOL IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0; 881 virtual int IsPageAvail(int iPage, IFX_DownloadHints* pHints) = 0;
884 virtual FX_BOOL IsLinearized() = 0; 882 virtual FX_BOOL IsLinearized() = 0;
885 virtual int32_t IsFormAvail(IFX_DownloadHints* pHints) = 0; 883 virtual int IsFormAvail(IFX_DownloadHints* pHints) = 0;
886 virtual int32_t IsLinearizedPDF() = 0; 884 virtual int IsLinearizedPDF() = 0;
887 virtual void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, 885 virtual void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos,
888 FX_DWORD* pSize) = 0; 886 FX_DWORD* pSize) = 0;
889 887
890 protected: 888 protected:
891 IPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead); 889 IPDF_DataAvail(IFX_FileAvail* pFileAvail, IFX_FileRead* pFileRead);
892 890
893 IFX_FileAvail* m_pFileAvail; 891 IFX_FileAvail* m_pFileAvail;
894 IFX_FileRead* m_pFileRead; 892 IFX_FileRead* m_pFileRead;
895 }; 893 };
896 class CPDF_SortObjNumArray { 894 class CPDF_SortObjNumArray {
(...skipping 21 matching lines...) Expand all
918 CPDF_PageNode() : m_type(PDF_PAGENODE_UNKOWN) {} 916 CPDF_PageNode() : m_type(PDF_PAGENODE_UNKOWN) {}
919 ~CPDF_PageNode(); 917 ~CPDF_PageNode();
920 PDF_PAGENODE_TYPE m_type; 918 PDF_PAGENODE_TYPE m_type;
921 FX_DWORD m_dwPageNo; 919 FX_DWORD m_dwPageNo;
922 CFX_PtrArray m_childNode; 920 CFX_PtrArray m_childNode;
923 }; 921 };
924 enum PDF_DATAAVAIL_STATUS { 922 enum PDF_DATAAVAIL_STATUS {
925 PDF_DATAAVAIL_HEADER = 0, 923 PDF_DATAAVAIL_HEADER = 0,
926 PDF_DATAAVAIL_FIRSTPAGE, 924 PDF_DATAAVAIL_FIRSTPAGE,
927 PDF_DATAAVAIL_FIRSTPAGE_PREPARE, 925 PDF_DATAAVAIL_FIRSTPAGE_PREPARE,
926 PDF_DATAAVAIL_HINTTABLE,
928 PDF_DATAAVAIL_END, 927 PDF_DATAAVAIL_END,
929 PDF_DATAAVAIL_CROSSREF, 928 PDF_DATAAVAIL_CROSSREF,
930 PDF_DATAAVAIL_CROSSREF_ITEM, 929 PDF_DATAAVAIL_CROSSREF_ITEM,
931 PDF_DATAAVAIL_CROSSREF_STREAM, 930 PDF_DATAAVAIL_CROSSREF_STREAM,
932 PDF_DATAAVAIL_TRAILER, 931 PDF_DATAAVAIL_TRAILER,
933 PDF_DATAAVAIL_LOADALLCRSOSSREF, 932 PDF_DATAAVAIL_LOADALLCRSOSSREF,
934 PDF_DATAAVAIL_ROOT, 933 PDF_DATAAVAIL_ROOT,
935 PDF_DATAAVAIL_INFO, 934 PDF_DATAAVAIL_INFO,
936 PDF_DATAAVAIL_ACROFORM, 935 PDF_DATAAVAIL_ACROFORM,
937 PDF_DATAAVAIL_ACROFORM_SUBOBJECT, 936 PDF_DATAAVAIL_ACROFORM_SUBOBJECT,
(...skipping 11 matching lines...) Expand all
949 FX_DWORD src_size, 948 FX_DWORD src_size,
950 const CPDF_Dictionary* pDict, 949 const CPDF_Dictionary* pDict,
951 uint8_t*& dest_buf, 950 uint8_t*& dest_buf,
952 FX_DWORD& dest_size, 951 FX_DWORD& dest_size,
953 CFX_ByteString& ImageEncoding, 952 CFX_ByteString& ImageEncoding,
954 CPDF_Dictionary*& pImageParms, 953 CPDF_Dictionary*& pImageParms,
955 FX_DWORD estimated_size, 954 FX_DWORD estimated_size,
956 FX_BOOL bImageAcc); 955 FX_BOOL bImageAcc);
957 956
958 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_ 957 #endif // CORE_INCLUDE_FPDFAPI_FPDF_PARSER_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698