1 // Copyright 2014 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 _FPDFXFA_PAGEVIEW_H_
8 #define _FPDFXFA_PAGEVIEW_H_
9 
10 class CPDFXFA_Page {
11  public:
12   CPDFXFA_Page(CPDFXFA_Document* pDoc, int page_index);
13   ~CPDFXFA_Page();
14 
15   void Release();
AddRef()16   void AddRef() { m_iRef++; }
17   FX_BOOL LoadPage();
18   FX_BOOL LoadPDFPage(CPDF_Dictionary* pageDict);
GetDocument()19   CPDFXFA_Document* GetDocument() { return m_pDocument; }
GetPageIndex()20   int GetPageIndex() { return m_iPageIndex; }
GetPDFPage()21   CPDF_Page* GetPDFPage() { return m_pPDFPage; }
GetXFAPageView()22   IXFA_PageView* GetXFAPageView() { return m_pXFAPageView; }
23 
24   FX_FLOAT GetPageWidth();
25   FX_FLOAT GetPageHeight();
26 
27   void DeviceToPage(int start_x,
28                     int start_y,
29                     int size_x,
30                     int size_y,
31                     int rotate,
32                     int device_x,
33                     int device_y,
34                     double* page_x,
35                     double* page_y);
36   void PageToDevice(int start_x,
37                     int start_y,
38                     int size_x,
39                     int size_y,
40                     int rotate,
41                     double page_x,
42                     double page_y,
43                     int* device_x,
44                     int* device_y);
45 
46   void GetDisplayMatrix(CFX_Matrix& matrix,
47                         int xPos,
48                         int yPos,
49                         int xSize,
50                         int ySize,
51                         int iRotate) const;
52 
53  protected:
54   FX_BOOL LoadPDFPage();
55   FX_BOOL LoadXFAPageView();
56 
57  private:
58   CPDF_Page* m_pPDFPage;
59   IXFA_PageView* m_pXFAPageView;
60   int m_iPageIndex;
61   CPDFXFA_Document* m_pDocument;
62   int m_iRef;
63 };
64 
65 #endif
66