| 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 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ | 7 #ifndef FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ |
| 8 #define FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ | 8 #define FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "core/fxcrt/fx_system.h" | 12 #include "core/fxcrt/fx_system.h" |
| 13 | 13 |
| 14 class CFX_Matrix; | 14 class CFX_Matrix; |
| 15 class CPDFXFA_Context; | 15 class CPDFXFA_Context; |
| 16 class CPDF_Dictionary; | 16 class CPDF_Dictionary; |
| 17 class CPDF_Page; | 17 class CPDF_Page; |
| 18 class CXFA_FFPageView; | 18 class CXFA_FFPageView; |
| 19 | 19 |
| 20 class CPDFXFA_Page { | 20 class CPDFXFA_Page { |
| 21 public: | 21 public: |
| 22 CPDFXFA_Page(CPDFXFA_Context* pContext, int page_index); | 22 CPDFXFA_Page(CPDFXFA_Context* pContext, int page_index); |
| 23 | 23 |
| 24 void Retain() { m_iRef++; } | 24 void Retain() { m_iRef++; } |
| 25 void Release() { | 25 void Release() { |
| 26 if (--m_iRef <= 0) | 26 if (--m_iRef <= 0) |
| 27 delete this; | 27 delete this; |
| 28 } | 28 } |
| 29 | 29 |
| 30 FX_BOOL LoadPage(); | 30 bool LoadPage(); |
| 31 FX_BOOL LoadPDFPage(CPDF_Dictionary* pageDict); | 31 bool LoadPDFPage(CPDF_Dictionary* pageDict); |
| 32 CPDFXFA_Context* GetContext() const { return m_pContext; } | 32 CPDFXFA_Context* GetContext() const { return m_pContext; } |
| 33 int GetPageIndex() const { return m_iPageIndex; } | 33 int GetPageIndex() const { return m_iPageIndex; } |
| 34 CPDF_Page* GetPDFPage() const { return m_pPDFPage.get(); } | 34 CPDF_Page* GetPDFPage() const { return m_pPDFPage.get(); } |
| 35 CXFA_FFPageView* GetXFAPageView() const { return m_pXFAPageView; } | 35 CXFA_FFPageView* GetXFAPageView() const { return m_pXFAPageView; } |
| 36 | 36 |
| 37 void SetXFAPageView(CXFA_FFPageView* pPageView) { | 37 void SetXFAPageView(CXFA_FFPageView* pPageView) { |
| 38 m_pXFAPageView = pPageView; | 38 m_pXFAPageView = pPageView; |
| 39 } | 39 } |
| 40 | 40 |
| 41 FX_FLOAT GetPageWidth() const; | 41 FX_FLOAT GetPageWidth() const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 64 int xPos, | 64 int xPos, |
| 65 int yPos, | 65 int yPos, |
| 66 int xSize, | 66 int xSize, |
| 67 int ySize, | 67 int ySize, |
| 68 int iRotate) const; | 68 int iRotate) const; |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 // Refcounted class. | 71 // Refcounted class. |
| 72 ~CPDFXFA_Page(); | 72 ~CPDFXFA_Page(); |
| 73 | 73 |
| 74 FX_BOOL LoadPDFPage(); | 74 bool LoadPDFPage(); |
| 75 FX_BOOL LoadXFAPageView(); | 75 bool LoadXFAPageView(); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 std::unique_ptr<CPDF_Page> m_pPDFPage; | 78 std::unique_ptr<CPDF_Page> m_pPDFPage; |
| 79 CXFA_FFPageView* m_pXFAPageView; | 79 CXFA_FFPageView* m_pXFAPageView; |
| 80 CPDFXFA_Context* const m_pContext; | 80 CPDFXFA_Context* const m_pContext; |
| 81 const int m_iPageIndex; | 81 const int m_iPageIndex; |
| 82 int m_iRef; | 82 int m_iRef; |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 #endif // FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ | 85 #endif // FPDFSDK_FPDFXFA_CPDFXFA_PAGE_H_ |
| OLD | NEW |