| 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_IFWL_WIDGET_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_ |
| 8 #define XFA_FWL_CORE_IFWL_WIDGET_H_ | 8 #define XFA_FWL_CORE_IFWL_WIDGET_H_ |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 class CFWL_Widget; | 57 class CFWL_Widget; |
| 58 class CFWL_WidgetProperties; | 58 class CFWL_WidgetProperties; |
| 59 class CFWL_WidgetMgr; | 59 class CFWL_WidgetMgr; |
| 60 class CFWL_App; | 60 class CFWL_App; |
| 61 class IFWL_ThemeProvider; | 61 class IFWL_ThemeProvider; |
| 62 class IFWL_Widget; | 62 class IFWL_Widget; |
| 63 enum class FWL_Type; | 63 enum class FWL_Type; |
| 64 | 64 |
| 65 class IFWL_Widget : public IFWL_WidgetDelegate { | 65 class IFWL_Widget : public IFWL_WidgetDelegate { |
| 66 public: | 66 public: |
| 67 class DataProvider {}; | |
| 68 | |
| 69 ~IFWL_Widget() override; | 67 ~IFWL_Widget() override; |
| 70 | 68 |
| 71 virtual FWL_Type GetClassID() const = 0; | 69 virtual FWL_Type GetClassID() const = 0; |
| 72 virtual bool IsInstance(const CFX_WideStringC& wsClass) const; | 70 virtual bool IsInstance(const CFX_WideStringC& wsClass) const; |
| 73 virtual void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); | 71 virtual void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); |
| 74 virtual void GetClientRect(CFX_RectF& rect); | 72 virtual void GetClientRect(CFX_RectF& rect); |
| 75 virtual void ModifyStylesEx(uint32_t dwStylesExAdded, | 73 virtual void ModifyStylesEx(uint32_t dwStylesExAdded, |
| 76 uint32_t dwStylesExRemoved); | 74 uint32_t dwStylesExRemoved); |
| 77 virtual void SetStates(uint32_t dwStates, bool bSet = true); | 75 virtual void SetStates(uint32_t dwStates, bool bSet = true); |
| 78 virtual void Update() = 0; | 76 virtual void Update() = 0; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 101 | 99 |
| 102 void LockUpdate() { m_iLock++; } | 100 void LockUpdate() { m_iLock++; } |
| 103 void UnlockUpdate() { | 101 void UnlockUpdate() { |
| 104 if (IsLocked()) | 102 if (IsLocked()) |
| 105 m_iLock--; | 103 m_iLock--; |
| 106 } | 104 } |
| 107 | 105 |
| 108 void TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 106 void TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); |
| 109 void GetMatrix(CFX_Matrix& matrix, bool bGlobal = false); | 107 void GetMatrix(CFX_Matrix& matrix, bool bGlobal = false); |
| 110 IFWL_ThemeProvider* GetThemeProvider() const; | 108 IFWL_ThemeProvider* GetThemeProvider() const; |
| 111 IFWL_Widget::DataProvider* GetDataProvider() const; | |
| 112 | 109 |
| 113 void SetDelegate(IFWL_WidgetDelegate* delegate) { m_pDelegate = delegate; } | 110 void SetDelegate(IFWL_WidgetDelegate* delegate) { m_pDelegate = delegate; } |
| 114 IFWL_WidgetDelegate* GetDelegate() { | 111 IFWL_WidgetDelegate* GetDelegate() { |
| 115 return m_pDelegate ? m_pDelegate : this; | 112 return m_pDelegate ? m_pDelegate : this; |
| 116 } | 113 } |
| 117 const IFWL_WidgetDelegate* GetDelegate() const { | 114 const IFWL_WidgetDelegate* GetDelegate() const { |
| 118 return m_pDelegate ? m_pDelegate : this; | 115 return m_pDelegate ? m_pDelegate : this; |
| 119 } | 116 } |
| 120 | 117 |
| 121 const CFWL_App* GetOwnerApp() const { return m_pOwnerApp; } | 118 const CFWL_App* GetOwnerApp() const { return m_pOwnerApp; } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void NotifyDriver(); | 208 void NotifyDriver(); |
| 212 bool IsParent(IFWL_Widget* pParent); | 209 bool IsParent(IFWL_Widget* pParent); |
| 213 | 210 |
| 214 void* m_pLayoutItem; | 211 void* m_pLayoutItem; |
| 215 CFWL_Widget* m_pAssociate; | 212 CFWL_Widget* m_pAssociate; |
| 216 uint32_t m_nEventKey; | 213 uint32_t m_nEventKey; |
| 217 IFWL_WidgetDelegate* m_pDelegate; // Not owned. | 214 IFWL_WidgetDelegate* m_pDelegate; // Not owned. |
| 218 }; | 215 }; |
| 219 | 216 |
| 220 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ | 217 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ |
| OLD | NEW |