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 #include "public/fpdf_dataavail.h" | 7 #include "public/fpdf_dataavail.h" |
8 | 8 |
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" | 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" |
10 #include "core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h" | 10 #include "core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 "IPDF_DataAvail::FormNotExist value mismatch"); | 36 "IPDF_DataAvail::FormNotExist value mismatch"); |
37 | 37 |
38 class CFPDF_FileAvailWrap : public IPDF_DataAvail::FileAvail { | 38 class CFPDF_FileAvailWrap : public IPDF_DataAvail::FileAvail { |
39 public: | 39 public: |
40 CFPDF_FileAvailWrap() { m_pfileAvail = NULL; } | 40 CFPDF_FileAvailWrap() { m_pfileAvail = NULL; } |
41 ~CFPDF_FileAvailWrap() override {} | 41 ~CFPDF_FileAvailWrap() override {} |
42 | 42 |
43 void Set(FX_FILEAVAIL* pfileAvail) { m_pfileAvail = pfileAvail; } | 43 void Set(FX_FILEAVAIL* pfileAvail) { m_pfileAvail = pfileAvail; } |
44 | 44 |
45 // IPDF_DataAvail::FileAvail: | 45 // IPDF_DataAvail::FileAvail: |
46 FX_BOOL IsDataAvail(FX_FILESIZE offset, FX_DWORD size) override { | 46 FX_BOOL IsDataAvail(FX_FILESIZE offset, uint32_t size) override { |
47 return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size); | 47 return m_pfileAvail->IsDataAvail(m_pfileAvail, offset, size); |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 FX_FILEAVAIL* m_pfileAvail; | 51 FX_FILEAVAIL* m_pfileAvail; |
52 }; | 52 }; |
53 | 53 |
54 class CFPDF_FileAccessWrap : public IFX_FileRead { | 54 class CFPDF_FileAccessWrap : public IFX_FileRead { |
55 public: | 55 public: |
56 CFPDF_FileAccessWrap() { m_pFileAccess = NULL; } | 56 CFPDF_FileAccessWrap() { m_pFileAccess = NULL; } |
(...skipping 17 matching lines...) Expand all Loading... |
74 | 74 |
75 class CFPDF_DownloadHintsWrap : public IPDF_DataAvail::DownloadHints { | 75 class CFPDF_DownloadHintsWrap : public IPDF_DataAvail::DownloadHints { |
76 public: | 76 public: |
77 explicit CFPDF_DownloadHintsWrap(FX_DOWNLOADHINTS* pDownloadHints) { | 77 explicit CFPDF_DownloadHintsWrap(FX_DOWNLOADHINTS* pDownloadHints) { |
78 m_pDownloadHints = pDownloadHints; | 78 m_pDownloadHints = pDownloadHints; |
79 } | 79 } |
80 ~CFPDF_DownloadHintsWrap() override {} | 80 ~CFPDF_DownloadHintsWrap() override {} |
81 | 81 |
82 public: | 82 public: |
83 // IFX_DownloadHints | 83 // IFX_DownloadHints |
84 void AddSegment(FX_FILESIZE offset, FX_DWORD size) override { | 84 void AddSegment(FX_FILESIZE offset, uint32_t size) override { |
85 m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size); | 85 m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size); |
86 } | 86 } |
87 | 87 |
88 private: | 88 private: |
89 FX_DOWNLOADHINTS* m_pDownloadHints; | 89 FX_DOWNLOADHINTS* m_pDownloadHints; |
90 }; | 90 }; |
91 | 91 |
92 class CFPDF_DataAvail { | 92 class CFPDF_DataAvail { |
93 public: | 93 public: |
94 CFPDF_DataAvail() { m_pDataAvail = NULL; } | 94 CFPDF_DataAvail() { m_pDataAvail = NULL; } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return PDF_FORM_ERROR; | 163 return PDF_FORM_ERROR; |
164 CFPDF_DownloadHintsWrap hints_wrap(hints); | 164 CFPDF_DownloadHintsWrap hints_wrap(hints); |
165 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); | 165 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsFormAvail(&hints_wrap); |
166 } | 166 } |
167 | 167 |
168 DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { | 168 DLLEXPORT int STDCALL FPDFAvail_IsLinearized(FPDF_AVAIL avail) { |
169 if (!avail) | 169 if (!avail) |
170 return PDF_LINEARIZATION_UNKNOWN; | 170 return PDF_LINEARIZATION_UNKNOWN; |
171 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); | 171 return ((CFPDF_DataAvail*)avail)->m_pDataAvail->IsLinearizedPDF(); |
172 } | 172 } |
OLD | NEW |