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