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_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 7 #ifndef XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
8 #define XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 8 #define XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_system.h" | 10 #include "core/fxcrt/include/fx_system.h" |
11 #include "xfa/fwl/core/fwl_error.h" | 11 #include "xfa/fwl/core/fwl_error.h" |
12 #include "xfa/fwl/core/ifwl_widgetmgr.h" | 12 #include "xfa/fwl/core/ifwl_widgetmgr.h" |
13 #include "xfa/fxgraphics/include/cfx_graphics.h" | 13 #include "xfa/fxgraphics/include/cfx_graphics.h" |
14 | 14 |
15 #define FWL_WGTMGR_DisableThread 0x00000001 | 15 #define FWL_WGTMGR_DisableThread 0x00000001 |
16 #define FWL_WGTMGR_DisableForm 0x00000002 | 16 #define FWL_WGTMGR_DisableForm 0x00000002 |
17 | 17 |
18 class CFWL_Message; | 18 class CFWL_Message; |
19 class CFWL_WidgetMgrDelegate; | 19 class CFWL_WidgetMgrDelegate; |
| 20 class CXFA_FFApp; |
| 21 class CXFA_FWLAdapterWidgetMgr; |
20 class CFX_Graphics; | 22 class CFX_Graphics; |
21 class CFX_Matrix; | 23 class CFX_Matrix; |
22 class IFWL_AdapterWidgetMgr; | |
23 class IFWL_AdapterNative; | |
24 class IFWL_Widget; | 24 class IFWL_Widget; |
25 | 25 |
26 class CFWL_WidgetMgrItem { | 26 class CFWL_WidgetMgrItem { |
27 public: | 27 public: |
28 CFWL_WidgetMgrItem() | 28 CFWL_WidgetMgrItem() |
29 : pParent(NULL), | 29 : pParent(NULL), |
30 pOwner(NULL), | 30 pOwner(NULL), |
31 pChild(NULL), | 31 pChild(NULL), |
32 pPrevious(NULL), | 32 pPrevious(NULL), |
33 pNext(NULL), | 33 pNext(NULL), |
(...skipping 20 matching lines...) Expand all Loading... |
54 IFWL_Widget* pWidget; | 54 IFWL_Widget* pWidget; |
55 CFX_Graphics* pOffscreen; | 55 CFX_Graphics* pOffscreen; |
56 int32_t iRedrawCounter; | 56 int32_t iRedrawCounter; |
57 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 57 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
58 FX_BOOL bOutsideChanged; | 58 FX_BOOL bOutsideChanged; |
59 #endif | 59 #endif |
60 }; | 60 }; |
61 | 61 |
62 class CFWL_WidgetMgr : public IFWL_WidgetMgr { | 62 class CFWL_WidgetMgr : public IFWL_WidgetMgr { |
63 public: | 63 public: |
64 CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative); | 64 CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative); |
65 ~CFWL_WidgetMgr() override; | 65 ~CFWL_WidgetMgr() override; |
66 | 66 |
67 // IFWL_WidgetMgr: | 67 // IFWL_WidgetMgr: |
68 int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; | 68 int32_t CountWidgets(IFWL_Widget* pParent = NULL) override; |
69 IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; | 69 IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override; |
70 IFWL_Widget* GetWidget(IFWL_Widget* pWidget, | 70 IFWL_Widget* GetWidget(IFWL_Widget* pWidget, |
71 FWL_WGTRELATION eRelation) override; | 71 FWL_WGTRELATION eRelation) override; |
72 int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; | 72 int32_t GetWidgetIndex(IFWL_Widget* pWidget) override; |
73 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; | 73 FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override; |
74 FWL_ERR RepaintWidget(IFWL_Widget* pWidget, | 74 FWL_ERR RepaintWidget(IFWL_Widget* pWidget, |
75 const CFX_RectF* pRect = NULL) override; | 75 const CFX_RectF* pRect = NULL) override; |
76 uint32_t GetCapability() override { return m_dwCapability; } | 76 uint32_t GetCapability() override { return m_dwCapability; } |
77 | 77 |
78 void AddWidget(IFWL_Widget* pWidget); | 78 void AddWidget(IFWL_Widget* pWidget); |
79 void InsertWidget(IFWL_Widget* pParent, | 79 void InsertWidget(IFWL_Widget* pParent, |
80 IFWL_Widget* pChild, | 80 IFWL_Widget* pChild, |
81 int32_t nIndex = -1); | 81 int32_t nIndex = -1); |
82 void RemoveWidget(IFWL_Widget* pWidget); | 82 void RemoveWidget(IFWL_Widget* pWidget); |
83 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); | 83 void SetOwner(IFWL_Widget* pOwner, IFWL_Widget* pOwned); |
84 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); | 84 void SetParent(IFWL_Widget* pParent, IFWL_Widget* pChild); |
85 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); | 85 FX_BOOL IsChild(IFWL_Widget* pChild, IFWL_Widget* pParent); |
86 FWL_ERR CreateWidget_Native(IFWL_Widget* pWidget); | |
87 FWL_ERR DestroyWidget_Native(IFWL_Widget* pWidget); | |
88 FWL_ERR GetWidgetRect_Native(IFWL_Widget* pWidget, CFX_RectF& rect); | |
89 FWL_ERR SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); | 86 FWL_ERR SetWidgetRect_Native(IFWL_Widget* pWidget, const CFX_RectF& rect); |
90 FWL_ERR SetWidgetPosition_Native(IFWL_Widget* pWidget, | |
91 FX_FLOAT fx, | |
92 FX_FLOAT fy); | |
93 FWL_ERR SetWidgetIcon_Native(IFWL_Widget* pWidget, | |
94 const CFX_DIBitmap* pIcon, | |
95 FX_BOOL bBig); | |
96 FWL_ERR SetWidgetCaption_Native(IFWL_Widget* pWidget, | |
97 const CFX_WideStringC& wsCaption); | |
98 FWL_ERR SetBorderRegion_Native(IFWL_Widget* pWidget, CFX_Path* pPath); | |
99 FWL_ERR ShowWidget_Native(IFWL_Widget* pWidget); | |
100 FWL_ERR HideWidget_Native(IFWL_Widget* pWidget); | |
101 FWL_ERR SetNormal_Native(IFWL_Widget* pWidget); | |
102 FWL_ERR SetMaximize_Native(IFWL_Widget* pWidget); | |
103 FWL_ERR SetMinimize_Native(IFWL_Widget* pWidget); | |
104 FX_BOOL CheckMessage_Native(); | |
105 FWL_ERR DispatchMessage_Native(); | |
106 FX_BOOL IsIdleMessage_Native(); | |
107 FWL_ERR Exit_Native(int32_t iExitCode); | |
108 FWL_ERR CreateWidgetWithNativeId_Native(IFWL_Widget* pWidget, void* vp); | |
109 IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy); | 87 IFWL_Widget* GetWidgetAtPoint(IFWL_Widget* pParent, FX_FLOAT fx, FX_FLOAT fy); |
110 void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy); | 88 void NotifySizeChanged(IFWL_Widget* pForm, FX_FLOAT fx, FX_FLOAT fy); |
111 IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind); | 89 IFWL_Widget* nextTab(IFWL_Widget* parent, IFWL_Widget* focus, FX_BOOL& bFind); |
112 int32_t CountRadioButtonGroup(IFWL_Widget* pFirst); | 90 int32_t CountRadioButtonGroup(IFWL_Widget* pFirst); |
113 IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, FX_BOOL bNext); | 91 IFWL_Widget* GetSiblingRadioButton(IFWL_Widget* pWidget, FX_BOOL bNext); |
114 IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget* pRadioButton); | 92 IFWL_Widget* GetRadioButtonGroupHeader(IFWL_Widget* pRadioButton); |
115 void GetSameGroupRadioButton(IFWL_Widget* pRadioButton, | 93 void GetSameGroupRadioButton(IFWL_Widget* pRadioButton, |
116 CFX_ArrayTemplate<IFWL_Widget*>& group); | 94 CFX_ArrayTemplate<IFWL_Widget*>& group); |
117 IFWL_Widget* GetDefaultButton(IFWL_Widget* pParent); | 95 IFWL_Widget* GetDefaultButton(IFWL_Widget* pParent); |
118 void AddRedrawCounts(IFWL_Widget* pWidget); | 96 void AddRedrawCounts(IFWL_Widget* pWidget); |
119 void ResetRedrawCounts(IFWL_Widget* pWidget); | 97 void ResetRedrawCounts(IFWL_Widget* pWidget); |
120 IFWL_AdapterWidgetMgr* GetAdapterWidgetMgr() { return m_pAdapter; } | 98 CXFA_FWLAdapterWidgetMgr* GetAdapterWidgetMgr() const { return m_pAdapter; } |
121 CFWL_WidgetMgrDelegate* GetDelegate() { return m_pDelegate; } | 99 CFWL_WidgetMgrDelegate* GetDelegate() const { return m_pDelegate; } |
122 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget); | 100 CFWL_WidgetMgrItem* GetWidgetMgrItem(IFWL_Widget* pWidget); |
123 bool IsThreadEnabled(); | 101 bool IsThreadEnabled(); |
124 bool IsFormDisabled(); | 102 bool IsFormDisabled(); |
125 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, | 103 FX_BOOL GetAdapterPopupPos(IFWL_Widget* pWidget, |
126 FX_FLOAT fMinHeight, | 104 FX_FLOAT fMinHeight, |
127 FX_FLOAT fMaxHeight, | 105 FX_FLOAT fMaxHeight, |
128 const CFX_RectF& rtAnchor, | 106 const CFX_RectF& rtAnchor, |
129 CFX_RectF& rtPopup); | 107 CFX_RectF& rtPopup); |
130 | 108 |
131 protected: | 109 protected: |
132 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, | 110 int32_t TravelWidgetMgr(CFWL_WidgetMgrItem* pParent, |
133 int32_t* pIndex, | 111 int32_t* pIndex, |
134 CFWL_WidgetMgrItem* pItem, | 112 CFWL_WidgetMgrItem* pItem, |
135 IFWL_Widget** pWidget = NULL); | 113 IFWL_Widget** pWidget = NULL); |
136 FX_BOOL IsAbleNative(IFWL_Widget* pWidget); | 114 FX_BOOL IsAbleNative(IFWL_Widget* pWidget); |
137 CFX_MapPtrToPtr m_mapWidgetItem; | 115 CFX_MapPtrToPtr m_mapWidgetItem; |
138 IFWL_AdapterWidgetMgr* m_pAdapter; | 116 CXFA_FWLAdapterWidgetMgr* m_pAdapter; |
139 CFWL_WidgetMgrDelegate* m_pDelegate; | 117 CFWL_WidgetMgrDelegate* m_pDelegate; |
140 friend class CFWL_WidgetMgrDelegate; | 118 friend class CFWL_WidgetMgrDelegate; |
141 uint32_t m_dwCapability; | 119 uint32_t m_dwCapability; |
142 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) | 120 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) |
143 CFX_RectF m_rtScreen; | 121 CFX_RectF m_rtScreen; |
144 #endif | 122 #endif |
145 }; | 123 }; |
146 | 124 |
147 class CFWL_WidgetMgrDelegate { | 125 class CFWL_WidgetMgrDelegate { |
148 public: | 126 public: |
(...skipping 20 matching lines...) Expand all Loading... |
169 const CFX_Matrix* pMatrix); | 147 const CFX_Matrix* pMatrix); |
170 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, | 148 FX_BOOL IsNeedRepaint(IFWL_Widget* pWidget, |
171 CFX_Matrix* pMatrix, | 149 CFX_Matrix* pMatrix, |
172 const CFX_RectF& rtDirty); | 150 const CFX_RectF& rtDirty); |
173 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); | 151 FX_BOOL bUseOffscreenDirect(IFWL_Widget* pWidget); |
174 | 152 |
175 CFWL_WidgetMgr* m_pWidgetMgr; | 153 CFWL_WidgetMgr* m_pWidgetMgr; |
176 }; | 154 }; |
177 | 155 |
178 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ | 156 #endif // XFA_FWL_CORE_FWL_WIDGETMGRIMP_H_ |
OLD | NEW |