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/fwl_targetimp.h" | 13 #include "xfa/fwl/core/fwl_targetimp.h" |
14 #include "xfa/fwl/core/ifwl_widgetdelegate.h" | 14 #include "xfa/fwl/core/ifwl_widgetdelegate.h" |
15 | 15 |
16 class CFWL_MsgKey; | 16 class CFWL_MsgKey; |
17 class CFWL_NoteThreadImp; | 17 class CFWL_ThreadImp; |
18 class CFWL_WidgetImpProperties; | 18 class CFWL_WidgetImpProperties; |
19 class CFWL_WidgetMgr; | 19 class CFWL_WidgetMgr; |
20 class IFWL_DataProvider; | 20 class IFWL_DataProvider; |
21 class IFWL_NoteThread; | 21 class IFWL_Thread; |
22 class IFWL_ThemeProvider; | 22 class IFWL_ThemeProvider; |
23 class IFWL_Widget; | 23 class IFWL_Widget; |
24 | 24 |
25 class CFWL_WidgetImp : public CFWL_TargetImp { | 25 class CFWL_WidgetImp : public CFWL_TargetImp { |
26 public: | 26 public: |
27 virtual FWL_ERR Initialize(); | 27 virtual FWL_ERR Initialize(); |
28 virtual FWL_ERR Finalize(); | 28 virtual FWL_ERR Finalize(); |
29 | 29 |
30 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 30 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
31 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); | 31 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); |
(...skipping 23 matching lines...) Expand all Loading... |
55 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 55 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); |
56 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); | 56 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); |
57 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 57 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
58 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); | 58 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); |
59 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 59 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
60 const CFX_Matrix* pMatrix = NULL); | 60 const CFX_Matrix* pMatrix = NULL); |
61 virtual IFWL_ThemeProvider* GetThemeProvider(); | 61 virtual IFWL_ThemeProvider* GetThemeProvider(); |
62 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 62 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
63 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); | 63 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); |
64 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 64 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
65 virtual IFWL_NoteThread* GetOwnerThread() const; | 65 virtual IFWL_Thread* GetOwnerThread() const; |
66 FWL_ERR SetOwnerThread(CFWL_NoteThreadImp* pOwnerThread); | 66 FWL_ERR SetOwnerThread(CFWL_ThreadImp* pOwnerThread); |
67 IFWL_Widget* GetInterface() const; | 67 IFWL_Widget* GetInterface() const; |
68 void SetInterface(IFWL_Widget* pInterface); | 68 void SetInterface(IFWL_Widget* pInterface); |
69 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); | 69 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
70 | 70 |
71 protected: | 71 protected: |
72 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 72 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
73 IFWL_Widget* pOuter); | 73 IFWL_Widget* pOuter); |
74 virtual ~CFWL_WidgetImp(); | 74 virtual ~CFWL_WidgetImp(); |
75 FX_BOOL IsEnabled() const; | 75 FX_BOOL IsEnabled() const; |
76 FX_BOOL IsVisible() const; | 76 FX_BOOL IsVisible() const; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 int32_t iPartEdge, | 135 int32_t iPartEdge, |
136 IFWL_ThemeProvider* pTheme, | 136 IFWL_ThemeProvider* pTheme, |
137 const CFX_Matrix* pMatrix = NULL); | 137 const CFX_Matrix* pMatrix = NULL); |
138 void NotifyDriver(); | 138 void NotifyDriver(); |
139 | 139 |
140 FX_BOOL IsParent(IFWL_Widget* pParent); | 140 FX_BOOL IsParent(IFWL_Widget* pParent); |
141 | 141 |
142 friend class CFWL_WidgetImpDelegate; | 142 friend class CFWL_WidgetImpDelegate; |
143 | 143 |
144 CFWL_WidgetMgr* m_pWidgetMgr; | 144 CFWL_WidgetMgr* m_pWidgetMgr; |
145 CFWL_NoteThreadImp* m_pOwnerThread; | 145 CFWL_ThreadImp* m_pOwnerThread; |
146 CFWL_WidgetImpProperties* m_pProperties; | 146 CFWL_WidgetImpProperties* m_pProperties; |
147 CFX_PrivateData* m_pPrivateData; | 147 CFX_PrivateData* m_pPrivateData; |
148 IFWL_WidgetDelegate* m_pDelegate; | 148 IFWL_WidgetDelegate* m_pDelegate; |
149 IFWL_WidgetDelegate* m_pCurDelegate; | 149 IFWL_WidgetDelegate* m_pCurDelegate; |
150 IFWL_Widget* m_pOuter; | 150 IFWL_Widget* m_pOuter; |
151 IFWL_Widget* m_pInterface; | 151 IFWL_Widget* m_pInterface; |
152 int32_t m_iLock; | 152 int32_t m_iLock; |
153 }; | 153 }; |
154 | 154 |
155 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { | 155 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { |
156 public: | 156 public: |
157 CFWL_WidgetImpDelegate(); | 157 CFWL_WidgetImpDelegate(); |
158 ~CFWL_WidgetImpDelegate() override {} | 158 ~CFWL_WidgetImpDelegate() override {} |
159 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 159 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
160 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | 160 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; |
161 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 161 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
162 const CFX_Matrix* pMatrix = NULL) override; | 162 const CFX_Matrix* pMatrix = NULL) override; |
163 }; | 163 }; |
164 | 164 |
165 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 165 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
OLD | NEW |