OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_PAGE_INCLUDE_CPDF_PAGE_H_ | 7 #ifndef CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ | 8 #define CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" | 12 #include "core/fpdfapi/fpdf_page/include/cpdf_pageobjectholder.h" |
13 #include "core/fxcrt/include/fx_basic.h" | 13 #include "core/fxcrt/include/fx_basic.h" |
14 #include "core/fxcrt/include/fx_coordinates.h" | 14 #include "core/fxcrt/include/fx_coordinates.h" |
15 #include "core/fxcrt/include/fx_system.h" | 15 #include "core/fxcrt/include/fx_system.h" |
16 | 16 |
17 class CPDF_Dictionary; | 17 class CPDF_Dictionary; |
18 class CPDF_Document; | 18 class CPDF_Document; |
19 class CPDF_Object; | 19 class CPDF_Object; |
20 class CPDF_PageRenderCache; | 20 class CPDF_PageRenderCache; |
21 | 21 |
22 class CPDF_Page : public CPDF_PageObjectHolder, public CFX_PrivateData { | 22 class CPDF_Page : public CPDF_PageObjectHolder { |
23 public: | 23 public: |
| 24 class View {}; // Caller implements as desired, empty here due to layering. |
| 25 |
24 CPDF_Page(CPDF_Document* pDocument, | 26 CPDF_Page(CPDF_Document* pDocument, |
25 CPDF_Dictionary* pPageDict, | 27 CPDF_Dictionary* pPageDict, |
26 bool bPageCache); | 28 bool bPageCache); |
27 ~CPDF_Page(); | 29 ~CPDF_Page(); |
28 | 30 |
29 void ParseContent(); | 31 void ParseContent(); |
30 | 32 |
31 void GetDisplayMatrix(CFX_Matrix& matrix, | 33 void GetDisplayMatrix(CFX_Matrix& matrix, |
32 int xPos, | 34 int xPos, |
33 int yPos, | 35 int yPos, |
34 int xSize, | 36 int xSize, |
35 int ySize, | 37 int ySize, |
36 int iRotate) const; | 38 int iRotate) const; |
37 | 39 |
38 FX_FLOAT GetPageWidth() const { return m_PageWidth; } | 40 FX_FLOAT GetPageWidth() const { return m_PageWidth; } |
39 FX_FLOAT GetPageHeight() const { return m_PageHeight; } | 41 FX_FLOAT GetPageHeight() const { return m_PageHeight; } |
40 CFX_FloatRect GetPageBBox() const { return m_BBox; } | 42 CFX_FloatRect GetPageBBox() const { return m_BBox; } |
41 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } | 43 const CFX_Matrix& GetPageMatrix() const { return m_PageMatrix; } |
42 CPDF_Object* GetPageAttr(const CFX_ByteString& name) const; | 44 CPDF_Object* GetPageAttr(const CFX_ByteString& name) const; |
43 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); } | 45 CPDF_PageRenderCache* GetRenderCache() const { return m_pPageRender.get(); } |
44 | 46 |
| 47 CFX_Deletable* GetRenderContext() const { return m_pRenderContext.get(); } |
| 48 void SetRenderContext(std::unique_ptr<CFX_Deletable> pContext) { |
| 49 m_pRenderContext = std::move(pContext); |
| 50 } |
| 51 |
| 52 View* GetView() const { return m_pView; } |
| 53 void SetView(View* pView) { m_pView = pView; } |
| 54 |
45 protected: | 55 protected: |
46 friend class CPDF_ContentParser; | 56 friend class CPDF_ContentParser; |
47 | 57 |
48 void StartParse(); | 58 void StartParse(); |
49 | 59 |
50 FX_FLOAT m_PageWidth; | 60 FX_FLOAT m_PageWidth; |
51 FX_FLOAT m_PageHeight; | 61 FX_FLOAT m_PageHeight; |
52 CFX_Matrix m_PageMatrix; | 62 CFX_Matrix m_PageMatrix; |
| 63 View* m_pView; |
53 std::unique_ptr<CPDF_PageRenderCache> m_pPageRender; | 64 std::unique_ptr<CPDF_PageRenderCache> m_pPageRender; |
| 65 std::unique_ptr<CFX_Deletable> m_pRenderContext; |
54 }; | 66 }; |
55 | 67 |
56 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ | 68 #endif // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_PAGE_H_ |
OLD | NEW |