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_WIDGETIMP_H_ | 7 #ifndef XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
8 #define XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 8 #define XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_coordinates.h" | 10 #include "core/fxcrt/include/fx_coordinates.h" |
11 #include "core/fxcrt/include/fx_system.h" | 11 #include "core/fxcrt/include/fx_system.h" |
12 #include "xfa/fwl/core/cfwl_event.h" | 12 #include "xfa/fwl/core/cfwl_event.h" |
13 #include "xfa/fwl/core/cfwl_themepart.h" | 13 #include "xfa/fwl/core/cfwl_themepart.h" |
14 #include "xfa/fwl/core/ifwl_widgetdelegate.h" | 14 #include "xfa/fwl/core/ifwl_widgetdelegate.h" |
15 #include "xfa/fwl/theme/cfwl_widgettp.h" | 15 #include "xfa/fwl/theme/cfwl_widgettp.h" |
16 | 16 |
17 class CFWL_AppImp; | 17 class CFWL_AppImp; |
18 class CFWL_MsgKey; | 18 class CFWL_MsgKey; |
19 class CFWL_WidgetImpProperties; | 19 class CFWL_WidgetImpProperties; |
20 class CFWL_WidgetMgr; | 20 class CFWL_WidgetMgr; |
21 class IFWL_App; | 21 class IFWL_App; |
22 class IFWL_DataProvider; | 22 class IFWL_DataProvider; |
23 class IFWL_ThemeProvider; | 23 class IFWL_ThemeProvider; |
24 class IFWL_Widget; | 24 class IFWL_Widget; |
25 | 25 |
26 class CFWL_WidgetImp { | 26 class CFWL_WidgetImp { |
27 public: | 27 public: |
28 virtual ~CFWL_WidgetImp(); | 28 virtual ~CFWL_WidgetImp(); |
29 | 29 |
30 virtual FWL_ERR Initialize(); | 30 virtual FWL_Error Initialize(); |
31 virtual FWL_ERR Finalize(); | 31 virtual FWL_Error Finalize(); |
32 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 32 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; |
33 virtual uint32_t GetClassID() const; | 33 virtual uint32_t GetClassID() const; |
34 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; | 34 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; |
35 | 35 |
36 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 36 virtual FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
37 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); | 37 virtual FWL_Error GetGlobalRect(CFX_RectF& rect); |
38 virtual FWL_ERR SetWidgetRect(const CFX_RectF& rect); | 38 virtual FWL_Error SetWidgetRect(const CFX_RectF& rect); |
39 virtual FWL_ERR GetClientRect(CFX_RectF& rect); | 39 virtual FWL_Error GetClientRect(CFX_RectF& rect); |
40 virtual IFWL_Widget* GetParent(); | 40 virtual IFWL_Widget* GetParent(); |
41 virtual FWL_ERR SetParent(IFWL_Widget* pParent); | 41 virtual FWL_Error SetParent(IFWL_Widget* pParent); |
42 virtual IFWL_Widget* GetOwner(); | 42 virtual IFWL_Widget* GetOwner(); |
43 virtual FWL_ERR SetOwner(IFWL_Widget* pOwner); | 43 virtual FWL_Error SetOwner(IFWL_Widget* pOwner); |
44 virtual IFWL_Widget* GetOuter(); | 44 virtual IFWL_Widget* GetOuter(); |
45 virtual uint32_t GetStyles(); | 45 virtual uint32_t GetStyles(); |
46 virtual FWL_ERR ModifyStyles(uint32_t dwStylesAdded, | 46 virtual FWL_Error ModifyStyles(uint32_t dwStylesAdded, |
47 uint32_t dwStylesRemoved); | 47 uint32_t dwStylesRemoved); |
48 virtual uint32_t GetStylesEx(); | 48 virtual uint32_t GetStylesEx(); |
49 virtual FWL_ERR ModifyStylesEx(uint32_t dwStylesExAdded, | 49 virtual FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, |
50 uint32_t dwStylesExRemoved); | 50 uint32_t dwStylesExRemoved); |
51 virtual uint32_t GetStates(); | 51 virtual uint32_t GetStates(); |
52 virtual FWL_ERR SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); | 52 virtual FWL_Error SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); |
53 virtual FWL_ERR SetPrivateData(void* module_id, | 53 virtual FWL_Error SetPrivateData(void* module_id, |
54 void* pData, | 54 void* pData, |
55 PD_CALLBACK_FREEDATA callback); | 55 PD_CALLBACK_FREEDATA callback); |
56 virtual void* GetPrivateData(void* module_id); | 56 virtual void* GetPrivateData(void* module_id); |
57 virtual FWL_ERR Update(); | 57 virtual FWL_Error Update(); |
58 virtual FWL_ERR LockUpdate(); | 58 virtual FWL_Error LockUpdate(); |
59 virtual FWL_ERR UnlockUpdate(); | 59 virtual FWL_Error UnlockUpdate(); |
60 virtual uint32_t HitTest(FX_FLOAT fx, FX_FLOAT fy); | 60 virtual uint32_t HitTest(FX_FLOAT fx, FX_FLOAT fy); |
61 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 61 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, |
62 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); | 62 FX_FLOAT& fx, |
63 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 63 FX_FLOAT& fy); |
64 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); | 64 virtual FWL_Error TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); |
65 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 65 virtual FWL_Error GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
66 const CFX_Matrix* pMatrix = NULL); | 66 virtual FWL_Error SetMatrix(const CFX_Matrix& matrix); |
| 67 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 68 const CFX_Matrix* pMatrix = NULL); |
67 virtual IFWL_ThemeProvider* GetThemeProvider(); | 69 virtual IFWL_ThemeProvider* GetThemeProvider(); |
68 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 70 virtual FWL_Error SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
69 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); | 71 virtual FWL_Error SetDataProvider(IFWL_DataProvider* pDataProvider); |
70 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 72 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
71 virtual IFWL_App* GetOwnerApp() const; | 73 virtual IFWL_App* GetOwnerApp() const; |
72 FWL_ERR SetOwnerApp(CFWL_AppImp* pOwnerApp); | 74 FWL_Error SetOwnerApp(CFWL_AppImp* pOwnerApp); |
73 IFWL_Widget* GetInterface() const; | 75 IFWL_Widget* GetInterface() const; |
74 void SetInterface(IFWL_Widget* pInterface); | 76 void SetInterface(IFWL_Widget* pInterface); |
75 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); | 77 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
76 | 78 |
77 protected: | 79 protected: |
78 friend class CFWL_WidgetImpDelegate; | 80 friend class CFWL_WidgetImpDelegate; |
79 | 81 |
80 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 82 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
81 IFWL_Widget* pOuter); | 83 IFWL_Widget* pOuter); |
82 | 84 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 IFWL_Widget* m_pOuter; | 158 IFWL_Widget* m_pOuter; |
157 IFWL_Widget* m_pInterface; | 159 IFWL_Widget* m_pInterface; |
158 int32_t m_iLock; | 160 int32_t m_iLock; |
159 }; | 161 }; |
160 | 162 |
161 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { | 163 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { |
162 public: | 164 public: |
163 CFWL_WidgetImpDelegate(); | 165 CFWL_WidgetImpDelegate(); |
164 ~CFWL_WidgetImpDelegate() override {} | 166 ~CFWL_WidgetImpDelegate() override {} |
165 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 167 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
166 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | 168 FWL_Error OnProcessEvent(CFWL_Event* pEvent) override; |
167 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 169 FWL_Error OnDrawWidget(CFX_Graphics* pGraphics, |
168 const CFX_Matrix* pMatrix = NULL) override; | 170 const CFX_Matrix* pMatrix = NULL) override; |
169 }; | 171 }; |
170 | 172 |
171 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 173 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
OLD | NEW |