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