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; |
tsepez | cc4d6d8 | 2016-05-16 13:21:03 -0700 | [diff] [blame^] | 39 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 40 | class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator { |
| 41 | public: |
tsepez | deee3d2 | 2016-03-25 14:38:58 -0700 | [diff] [blame] | 42 | CXFA_FFPageWidgetIterator(CXFA_FFPageView* pPageView, uint32_t dwFilter); |
tsepez | cc4d6d8 | 2016-05-16 13:21:03 -0700 | [diff] [blame^] | 43 | ~CXFA_FFPageWidgetIterator() override; |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 44 | |
| 45 | void Reset() override; |
| 46 | CXFA_FFWidget* MoveToFirst() override; |
| 47 | CXFA_FFWidget* MoveToLast() override; |
| 48 | CXFA_FFWidget* MoveToNext() override; |
| 49 | CXFA_FFWidget* MoveToPrevious() override; |
| 50 | CXFA_FFWidget* GetCurrentWidget() override; |
| 51 | FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 52 | |
| 53 | protected: |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 54 | CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); |
| 55 | |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 56 | CXFA_FFPageView* m_pPageView; |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 57 | CXFA_FFWidget* m_hCurWidget; |
tsepez | deee3d2 | 2016-03-25 14:38:58 -0700 | [diff] [blame] | 58 | uint32_t m_dwFilter; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 59 | FX_BOOL m_bIgnorerelevant; |
| 60 | CXFA_LayoutItemIterator m_sIterator; |
| 61 | }; |
| 62 | typedef CFX_ArrayTemplate<CXFA_FFWidget*> CXFA_WidgetArray; |
| 63 | class CXFA_TabParam { |
| 64 | public: |
| 65 | CXFA_TabParam() : m_pWidget(NULL) {} |
| 66 | ~CXFA_TabParam() {} |
| 67 | |
| 68 | CXFA_FFWidget* m_pWidget; |
| 69 | CXFA_WidgetArray m_Children; |
| 70 | }; |
| 71 | class CXFA_FFTabOrderPageWidgetIterator : public IXFA_WidgetIterator { |
| 72 | public: |
| 73 | CXFA_FFTabOrderPageWidgetIterator(CXFA_FFPageView* pPageView, |
tsepez | deee3d2 | 2016-03-25 14:38:58 -0700 | [diff] [blame] | 74 | uint32_t dwFilter); |
tsepez | cc4d6d8 | 2016-05-16 13:21:03 -0700 | [diff] [blame^] | 75 | ~CXFA_FFTabOrderPageWidgetIterator() override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 76 | |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 77 | void Reset() override; |
| 78 | CXFA_FFWidget* MoveToFirst() override; |
| 79 | CXFA_FFWidget* MoveToLast() override; |
| 80 | CXFA_FFWidget* MoveToNext() override; |
| 81 | CXFA_FFWidget* MoveToPrevious() override; |
| 82 | CXFA_FFWidget* GetCurrentWidget() override; |
| 83 | FX_BOOL SetCurrentWidget(CXFA_FFWidget* hWidget) override; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 84 | |
| 85 | protected: |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 86 | CXFA_FFWidget* GetTraverseWidget(CXFA_FFWidget* pWidget); |
tsepez | 70c5520 | 2016-04-14 15:32:35 -0700 | [diff] [blame] | 87 | CXFA_FFWidget* FindWidgetByName(const CFX_WideString& wsWidgetName, |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 88 | CXFA_FFWidget* pRefWidget); |
| 89 | void CreateTabOrderWidgetArray(); |
| 90 | void CreateSpaceOrderWidgetArray(CXFA_WidgetArray& WidgetArray); |
| 91 | CXFA_FFWidget* GetWidget(CXFA_LayoutItem* pLayoutItem); |
| 92 | void OrderContainer(CXFA_LayoutItemIterator* sIterator, |
| 93 | CXFA_LayoutItem* pContainerItem, |
| 94 | CXFA_TabParam* pContainer, |
| 95 | FX_BOOL& bCurrentItem, |
| 96 | FX_BOOL& bContentArea, |
| 97 | FX_BOOL bMarsterPage = FALSE); |
dsinclair | df4bc59 | 2016-03-31 20:34:43 -0700 | [diff] [blame] | 98 | |
| 99 | CXFA_WidgetArray m_TabOrderWidgetArray; |
| 100 | CXFA_FFPageView* m_pPageView; |
| 101 | uint32_t m_dwFilter; |
| 102 | int32_t m_iCurWidget; |
| 103 | FX_BOOL m_bIgnorerelevant; |
Dan Sinclair | 1770c02 | 2016-03-14 14:14:16 -0400 | [diff] [blame] | 104 | }; |
| 105 | |
dsinclair | 7222ea6 | 2016-04-06 14:33:07 -0700 | [diff] [blame] | 106 | #endif // XFA_FXFA_INCLUDE_XFA_FFPAGEVIEW_H_ |