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