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 XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ | 7 #ifndef XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ |
8 #define XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ | 8 #define XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ |
9 | 9 |
10 #include "xfa/fxfa/parser/xfa_doclayout.h" | 10 #include "xfa/fxfa/parser/xfa_doclayout.h" |
11 | 11 |
12 class CXFA_FFWidget; | 12 class CXFA_FFWidget; |
13 class CXFA_FFDocView; | 13 class CXFA_FFDocView; |
14 class CXFA_FFPageView : public CXFA_ContainerLayoutItem, public IXFA_PageView { | 14 class CXFA_FFPageView : public CXFA_ContainerLayoutItem, public IXFA_PageView { |
15 public: | 15 public: |
16 CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea); | 16 CXFA_FFPageView(CXFA_FFDocView* pDocView, CXFA_Node* pPageArea); |
17 ~CXFA_FFPageView() override; | 17 ~CXFA_FFPageView() override; |
18 | 18 |
19 // IFXA_PageView: | 19 // IFXA_PageView: |
20 IXFA_DocView* GetDocView() override; | 20 IXFA_DocView* GetDocView() override; |
21 int32_t GetPageViewIndex() override; | 21 int32_t GetPageViewIndex() override; |
22 void GetPageViewRect(CFX_RectF& rtPage) override; | 22 void GetPageViewRect(CFX_RectF& rtPage) override; |
23 void GetDisplayMatrix(CFX_Matrix& mt, | 23 void GetDisplayMatrix(CFX_Matrix& mt, |
24 const CFX_Rect& rtDisp, | 24 const CFX_Rect& rtDisp, |
25 int32_t iRotate) override; | 25 int32_t iRotate) override; |
26 int32_t LoadPageView(IFX_Pause* pPause = NULL) override; | 26 int32_t LoadPageView(IFX_Pause* pPause = NULL) override; |
27 void UnloadPageView() override; | 27 void UnloadPageView() override; |
28 IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) override; | 28 IXFA_Widget* GetWidgetByPos(FX_FLOAT fx, FX_FLOAT fy) override; |
29 IXFA_WidgetIterator* CreateWidgetIterator( | 29 IXFA_WidgetIterator* CreateWidgetIterator( |
30 FX_DWORD dwTraverseWay = XFA_TRAVERSEWAY_Form, | 30 uint32_t dwTraverseWay = XFA_TRAVERSEWAY_Form, |
31 FX_DWORD dwWidgetFilter = XFA_WIDGETFILTER_Visible | | 31 uint32_t dwWidgetFilter = XFA_WIDGETFILTER_Visible | |
32 XFA_WIDGETFILTER_Viewable | | 32 XFA_WIDGETFILTER_Viewable | |
33 XFA_WIDGETFILTER_AllType) override; | 33 XFA_WIDGETFILTER_AllType) override; |
34 | 34 |
35 FX_BOOL IsPageViewLoaded(); | 35 FX_BOOL IsPageViewLoaded(); |
36 | 36 |
37 protected: | 37 protected: |
38 CXFA_FFDocView* m_pDocView; | 38 CXFA_FFDocView* m_pDocView; |
39 FX_BOOL m_bLoaded; | 39 FX_BOOL m_bLoaded; |
40 }; | 40 }; |
41 typedef CXFA_NodeIteratorTemplate<CXFA_LayoutItem, | 41 typedef CXFA_NodeIteratorTemplate<CXFA_LayoutItem, |
42 CXFA_TraverseStrategy_LayoutItem> | 42 CXFA_TraverseStrategy_LayoutItem> |
43 CXFA_LayoutItemIterator; | 43 CXFA_LayoutItemIterator; |
44 class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator { | 44 class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator { |
45 public: | 45 public: |
46 CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, FX_DWORD dwFilter); | 46 CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, uint32_t dwFilter); |
47 virtual ~CXFA_FFPageWidgetIterator(); | 47 virtual ~CXFA_FFPageWidgetIterator(); |
48 virtual void Release() { delete this; } | 48 virtual void Release() { delete this; } |
49 | 49 |
50 virtual void Reset(); | 50 virtual void Reset(); |
51 virtual IXFA_Widget* MoveToFirst(); | 51 virtual IXFA_Widget* MoveToFirst(); |
52 virtual IXFA_Widget* MoveToLast(); | 52 virtual IXFA_Widget* MoveToLast(); |
53 virtual IXFA_Widget* MoveToNext(); | 53 virtual IXFA_Widget* MoveToNext(); |
54 virtual IXFA_Widget* MoveToPrevious(); | 54 virtual IXFA_Widget* MoveToPrevious(); |
55 virtual IXFA_Widget* GetCurrentWidget(); | 55 virtual IXFA_Widget* GetCurrentWidget(); |
56 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget); | 56 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget); |
57 | 57 |
58 protected: | 58 protected: |
59 IXFA_Widget* GetWidget(CXFA_LayoutItem* pLayoutItem); | 59 IXFA_Widget* GetWidget(CXFA_LayoutItem* pLayoutItem); |
60 CXFA_FFPageView* m_pPageView; | 60 CXFA_FFPageView* m_pPageView; |
61 IXFA_Widget* m_hCurWidget; | 61 IXFA_Widget* m_hCurWidget; |
62 FX_DWORD m_dwFilter; | 62 uint32_t m_dwFilter; |
63 FX_BOOL m_bIgnorerelevant; | 63 FX_BOOL m_bIgnorerelevant; |
64 CXFA_LayoutItemIterator m_sIterator; | 64 CXFA_LayoutItemIterator m_sIterator; |
65 }; | 65 }; |
66 typedef CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray; | 66 typedef CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray; |
67 class CXFA_TabParam { | 67 class CXFA_TabParam { |
68 public: | 68 public: |
69 CXFA_TabParam() : m_pWidget(NULL) {} | 69 CXFA_TabParam() : m_pWidget(NULL) {} |
70 ~CXFA_TabParam() {} | 70 ~CXFA_TabParam() {} |
71 | 71 |
72 CXFA_FFWidget* m_pWidget; | 72 CXFA_FFWidget* m_pWidget; |
73 CXFA_WidgetArray m_Children; | 73 CXFA_WidgetArray m_Children; |
74 }; | 74 }; |
75 class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator { | 75 class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator { |
76 public: | 76 public: |
77 CXFA_FFTabOrderPageWidgetIterator(CXFA_FFPageView* pPageView, | 77 CXFA_FFTabOrderPageWidgetIterator(CXFA_FFPageView* pPageView, |
78 FX_DWORD dwFilter); | 78 uint32_t dwFilter); |
79 virtual ~CXFA_FFTabOrderPageWidgetIterator(); | 79 virtual ~CXFA_FFTabOrderPageWidgetIterator(); |
80 | 80 |
81 virtual void Release(); | 81 virtual void Release(); |
82 | 82 |
83 virtual void Reset(); | 83 virtual void Reset(); |
84 virtual IXFA_Widget* MoveToFirst(); | 84 virtual IXFA_Widget* MoveToFirst(); |
85 virtual IXFA_Widget* MoveToLast(); | 85 virtual IXFA_Widget* MoveToLast(); |
86 virtual IXFA_Widget* MoveToNext(); | 86 virtual IXFA_Widget* MoveToNext(); |
87 virtual IXFA_Widget* MoveToPrevious(); | 87 virtual IXFA_Widget* MoveToPrevious(); |
88 virtual IXFA_Widget* GetCurrentWidget(); | 88 virtual IXFA_Widget* GetCurrentWidget(); |
89 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget); | 89 virtual FX_BOOL SetCurrentWidget(IXFA_Widget* hWidget); |
90 | 90 |
91 protected: | 91 protected: |
92 CXFA_WidgetArray m_TabOrderWidgetArray; | 92 CXFA_WidgetArray m_TabOrderWidgetArray; |
93 CXFA_FFPageView* m_pPageView; | 93 CXFA_FFPageView* m_pPageView; |
94 FX_DWORD m_dwFilter; | 94 uint32_t m_dwFilter; |
95 int32_t m_iCurWidget; | 95 int32_t m_iCurWidget; |
96 FX_BOOL m_bIgnorerelevant; | 96 FX_BOOL m_bIgnorerelevant; |
97 CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget); | 97 CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget); |
98 CXFA_FFWidget* FindWidgetByName(const CFX_WideStringC& wsWidgetName, | 98 CXFA_FFWidget* FindWidgetByName(const CFX_WideStringC& wsWidgetName, |
99 CXFA_FFWidget* pRefWidget); | 99 CXFA_FFWidget* pRefWidget); |
100 void CreateTabOrderWidgetArray(); | 100 void CreateTabOrderWidgetArray(); |
101 void CreateSpaceOrderWidgetArray(CXFA_WidgetArray& WidgetArray); | 101 void CreateSpaceOrderWidgetArray(CXFA_WidgetArray& WidgetArray); |
102 CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); | 102 CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); |
103 void OrderContainer(CXFA_LayoutItemIterator* sIterator, | 103 void OrderContainer(CXFA_LayoutItemIterator* sIterator, |
104 CXFA_LayoutItem* pContainerItem, | 104 CXFA_LayoutItem* pContainerItem, |
105 CXFA_TabParam* pContainer, | 105 CXFA_TabParam* pContainer, |
106 FX_BOOL& bCurrentItem, | 106 FX_BOOL& bCurrentItem, |
107 FX_BOOL& bContentArea, | 107 FX_BOOL& bContentArea, |
108 FX_BOOL bMarsterPage = FALSE); | 108 FX_BOOL bMarsterPage = FALSE); |
109 }; | 109 }; |
110 | 110 |
111 #endif // XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ | 111 #endif // XFA_FXFA_APP_XFA_FFPAGEVIEW_H_ |
OLD | NEW |