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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class IFWL_DataProvider; | 60 class IFWL_DataProvider; |
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 { | 65 class IFWL_Widget { |
66 public: | 66 public: |
67 virtual ~IFWL_Widget(); | 67 virtual ~IFWL_Widget(); |
68 | 68 |
69 virtual FWL_Error Initialize(); | 69 virtual FWL_Error Initialize(); |
70 virtual FWL_Error Finalize(); | 70 virtual void Finalize(); |
71 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; | |
72 virtual FWL_Type GetClassID() const = 0; | 71 virtual FWL_Type GetClassID() const = 0; |
73 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; | 72 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; |
74 | 73 |
75 virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 74 virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
76 virtual FWL_Error GetGlobalRect(CFX_RectF& rect); | 75 virtual FWL_Error GetGlobalRect(CFX_RectF& rect); |
77 virtual FWL_Error SetWidgetRect(const CFX_RectF& rect); | 76 virtual FWL_Error SetWidgetRect(const CFX_RectF& rect); |
78 virtual FWL_Error GetClientRect(CFX_RectF& rect); | 77 virtual FWL_Error GetClientRect(CFX_RectF& rect); |
| 78 |
79 virtual IFWL_Widget* GetParent(); | 79 virtual IFWL_Widget* GetParent(); |
80 virtual FWL_Error SetParent(IFWL_Widget* pParent); | 80 virtual FWL_Error SetParent(IFWL_Widget* pParent); |
| 81 |
81 virtual IFWL_Widget* GetOwner(); | 82 virtual IFWL_Widget* GetOwner(); |
82 virtual FWL_Error SetOwner(IFWL_Widget* pOwner); | 83 virtual FWL_Error SetOwner(IFWL_Widget* pOwner); |
| 84 |
83 virtual IFWL_Widget* GetOuter(); | 85 virtual IFWL_Widget* GetOuter(); |
| 86 |
84 virtual uint32_t GetStyles(); | 87 virtual uint32_t GetStyles(); |
85 virtual FWL_Error ModifyStyles(uint32_t dwStylesAdded, | 88 virtual FWL_Error ModifyStyles(uint32_t dwStylesAdded, |
86 uint32_t dwStylesRemoved); | 89 uint32_t dwStylesRemoved); |
87 virtual uint32_t GetStylesEx(); | 90 virtual uint32_t GetStylesEx(); |
88 virtual FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, | 91 virtual FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, |
89 uint32_t dwStylesExRemoved); | 92 uint32_t dwStylesExRemoved); |
| 93 |
90 virtual uint32_t GetStates(); | 94 virtual uint32_t GetStates(); |
91 virtual void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); | 95 virtual void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); |
| 96 |
92 virtual FWL_Error Update(); | 97 virtual FWL_Error Update(); |
93 virtual FWL_Error LockUpdate(); | 98 virtual FWL_Error LockUpdate(); |
94 virtual FWL_Error UnlockUpdate(); | 99 virtual FWL_Error UnlockUpdate(); |
| 100 |
95 virtual FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); | 101 virtual FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); |
| 102 |
96 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, | 103 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, |
97 FX_FLOAT& fx, | 104 FX_FLOAT& fx, |
98 FX_FLOAT& fy); | 105 FX_FLOAT& fy); |
99 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); | 106 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); |
| 107 |
100 virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 108 virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
101 virtual FWL_Error SetMatrix(const CFX_Matrix& matrix); | 109 virtual FWL_Error SetMatrix(const CFX_Matrix& matrix); |
| 110 |
102 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 111 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
103 const CFX_Matrix* pMatrix = nullptr); | 112 const CFX_Matrix* pMatrix = nullptr); |
| 113 |
104 virtual IFWL_ThemeProvider* GetThemeProvider(); | 114 virtual IFWL_ThemeProvider* GetThemeProvider(); |
105 virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 115 virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
106 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 116 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
107 virtual IFWL_App* GetOwnerApp() const; | 117 virtual IFWL_App* GetOwnerApp() const; |
108 | 118 |
109 FWL_Error SetOwnerApp(IFWL_App* pOwnerApp); | 119 FWL_Error SetOwnerApp(IFWL_App* pOwnerApp); |
110 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); | 120 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
111 | 121 |
112 uint32_t GetEventKey() const; | 122 uint32_t GetEventKey() const; |
113 void SetEventKey(uint32_t key); | 123 void SetEventKey(uint32_t key); |
114 | 124 |
115 void* GetLayoutItem() const; | 125 void* GetLayoutItem() const; |
116 void SetLayoutItem(void* pItem); | 126 void SetLayoutItem(void* pItem); |
117 | 127 |
118 CFWL_Widget* GetAssociateWidget() const; | |
119 void SetAssociateWidget(CFWL_Widget* pAssociate); | 128 void SetAssociateWidget(CFWL_Widget* pAssociate); |
120 | 129 |
121 protected: | 130 protected: |
122 friend class CFWL_WidgetImpDelegate; | 131 friend class CFWL_WidgetImpDelegate; |
123 | 132 |
124 IFWL_Widget(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); | 133 IFWL_Widget(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
125 | 134 |
126 FX_BOOL IsEnabled() const; | 135 FX_BOOL IsEnabled() const; |
127 FX_BOOL IsVisible() const; | 136 FX_BOOL IsVisible() const; |
128 FX_BOOL IsActive() const; | 137 FX_BOOL IsActive() const; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 public: | 215 public: |
207 CFWL_WidgetImpDelegate(); | 216 CFWL_WidgetImpDelegate(); |
208 ~CFWL_WidgetImpDelegate() override {} | 217 ~CFWL_WidgetImpDelegate() override {} |
209 void OnProcessMessage(CFWL_Message* pMessage) override; | 218 void OnProcessMessage(CFWL_Message* pMessage) override; |
210 void OnProcessEvent(CFWL_Event* pEvent) override; | 219 void OnProcessEvent(CFWL_Event* pEvent) override; |
211 void OnDrawWidget(CFX_Graphics* pGraphics, | 220 void OnDrawWidget(CFX_Graphics* pGraphics, |
212 const CFX_Matrix* pMatrix = nullptr) override; | 221 const CFX_Matrix* pMatrix = nullptr) override; |
213 }; | 222 }; |
214 | 223 |
215 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ | 224 #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ |
OLD | NEW |