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