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_CFWL_WIDGET_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_WIDGET_H_ |
8 #define XFA_FWL_CORE_CFWL_WIDGET_H_ | 8 #define XFA_FWL_CORE_CFWL_WIDGET_H_ |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 class CFWL_WidgetMgr; | 44 class CFWL_WidgetMgr; |
45 class CFWL_WidgetProperties; | 45 class CFWL_WidgetProperties; |
46 class IFWL_ThemeProvider; | 46 class IFWL_ThemeProvider; |
47 | 47 |
48 class CFWL_Widget : public IFWL_WidgetDelegate { | 48 class CFWL_Widget : public IFWL_WidgetDelegate { |
49 public: | 49 public: |
50 ~CFWL_Widget() override; | 50 ~CFWL_Widget() override; |
51 | 51 |
52 virtual FWL_Type GetClassID() const = 0; | 52 virtual FWL_Type GetClassID() const = 0; |
53 virtual bool IsInstance(const CFX_WideStringC& wsClass) const; | 53 virtual bool IsInstance(const CFX_WideStringC& wsClass) const; |
54 virtual void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false); | 54 virtual void GetWidgetRect(CFX_RectF& rect, bool bAutoSize); |
55 virtual void GetClientRect(CFX_RectF& rect); | 55 virtual void GetClientRect(CFX_RectF& rect); |
56 virtual void ModifyStylesEx(uint32_t dwStylesExAdded, | 56 virtual void ModifyStylesEx(uint32_t dwStylesExAdded, |
57 uint32_t dwStylesExRemoved); | 57 uint32_t dwStylesExRemoved); |
58 virtual void SetStates(uint32_t dwStates, bool bSet = true); | 58 virtual void SetStates(uint32_t dwStates); |
| 59 virtual void RemoveStates(uint32_t dwStates); |
59 virtual void Update() = 0; | 60 virtual void Update() = 0; |
60 virtual FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); | 61 virtual FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); |
61 virtual void DrawWidget(CFX_Graphics* pGraphics, | 62 virtual void DrawWidget(CFX_Graphics* pGraphics, |
62 const CFX_Matrix* pMatrix = nullptr) = 0; | 63 const CFX_Matrix* pMatrix) = 0; |
63 virtual void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 64 virtual void SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
64 | 65 |
65 // IFWL_WidgetDelegate. | 66 // IFWL_WidgetDelegate. |
66 void OnProcessMessage(CFWL_Message* pMessage) override; | 67 void OnProcessMessage(CFWL_Message* pMessage) override; |
67 void OnProcessEvent(CFWL_Event* pEvent) override; | 68 void OnProcessEvent(CFWL_Event* pEvent) override; |
68 void OnDrawWidget(CFX_Graphics* pGraphics, | 69 void OnDrawWidget(CFX_Graphics* pGraphics, |
69 const CFX_Matrix* pMatrix = nullptr) override; | 70 const CFX_Matrix* pMatrix = nullptr) override; |
70 | 71 |
71 void SetWidgetRect(const CFX_RectF& rect); | 72 void SetWidgetRect(const CFX_RectF& rect); |
72 | 73 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const CFX_Matrix* pMatrix = nullptr); | 186 const CFX_Matrix* pMatrix = nullptr); |
186 void NotifyDriver(); | 187 void NotifyDriver(); |
187 bool IsParent(CFWL_Widget* pParent); | 188 bool IsParent(CFWL_Widget* pParent); |
188 | 189 |
189 void* m_pLayoutItem; | 190 void* m_pLayoutItem; |
190 uint32_t m_nEventKey; | 191 uint32_t m_nEventKey; |
191 IFWL_WidgetDelegate* m_pDelegate; // Not owned. | 192 IFWL_WidgetDelegate* m_pDelegate; // Not owned. |
192 }; | 193 }; |
193 | 194 |
194 #endif // XFA_FWL_CORE_CFWL_WIDGET_H_ | 195 #endif // XFA_FWL_CORE_CFWL_WIDGET_H_ |
OLD | NEW |