OLD | NEW |
| (Empty) |
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 FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_PAGE_H_ | |
8 #define FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_PAGE_H_ | |
9 | |
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h" | |
11 #include "core/fpdfapi/include/cpdf_modulemgr.h" | |
12 #include "core/fxcrt/include/fx_coordinates.h" | |
13 #include "core/fxcrt/include/fx_system.h" | |
14 | |
15 class CPDFXFA_Document; | |
16 class CPDF_Page; | |
17 class CXFA_FFPageView; | |
18 | |
19 class CPDFXFA_Page { | |
20 public: | |
21 CPDFXFA_Page(CPDFXFA_Document* pDoc, int page_index); | |
22 ~CPDFXFA_Page(); | |
23 | |
24 void Release(); | |
25 void AddRef() { m_iRef++; } | |
26 FX_BOOL LoadPage(); | |
27 FX_BOOL LoadPDFPage(CPDF_Dictionary* pageDict); | |
28 CPDFXFA_Document* GetDocument() { return m_pDocument; } | |
29 int GetPageIndex() { return m_iPageIndex; } | |
30 CPDF_Page* GetPDFPage() { return m_pPDFPage; } | |
31 CXFA_FFPageView* GetXFAPageView() { return m_pXFAPageView; } | |
32 void SetXFAPageView(CXFA_FFPageView* pPageView) { | |
33 m_pXFAPageView = pPageView; | |
34 } | |
35 | |
36 FX_FLOAT GetPageWidth(); | |
37 FX_FLOAT GetPageHeight(); | |
38 | |
39 void DeviceToPage(int start_x, | |
40 int start_y, | |
41 int size_x, | |
42 int size_y, | |
43 int rotate, | |
44 int device_x, | |
45 int device_y, | |
46 double* page_x, | |
47 double* page_y); | |
48 void PageToDevice(int start_x, | |
49 int start_y, | |
50 int size_x, | |
51 int size_y, | |
52 int rotate, | |
53 double page_x, | |
54 double page_y, | |
55 int* device_x, | |
56 int* device_y); | |
57 | |
58 void GetDisplayMatrix(CFX_Matrix& matrix, | |
59 int xPos, | |
60 int yPos, | |
61 int xSize, | |
62 int ySize, | |
63 int iRotate) const; | |
64 | |
65 protected: | |
66 FX_BOOL LoadPDFPage(); | |
67 FX_BOOL LoadXFAPageView(); | |
68 | |
69 private: | |
70 CPDF_Page* m_pPDFPage; | |
71 CXFA_FFPageView* m_pXFAPageView; | |
72 int m_iPageIndex; | |
73 CPDFXFA_Document* m_pDocument; | |
74 int m_iRef; | |
75 }; | |
76 | |
77 #endif // FPDFSDK_INCLUDE_FPDFXFA_FPDFXFA_PAGE_H_ | |
OLD | NEW |