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/fwl_targetimp.h" | |
15 #include "xfa/fwl/core/ifwl_widgetdelegate.h" | 14 #include "xfa/fwl/core/ifwl_widgetdelegate.h" |
16 #include "xfa/fwl/theme/cfwl_widgettp.h" | 15 #include "xfa/fwl/theme/cfwl_widgettp.h" |
17 | 16 |
17 class CFWL_AppImp; | |
18 class CFWL_MsgKey; | 18 class CFWL_MsgKey; |
19 class CFWL_ThreadImp; | |
20 class CFWL_WidgetImpProperties; | 19 class CFWL_WidgetImpProperties; |
21 class CFWL_WidgetMgr; | 20 class CFWL_WidgetMgr; |
21 class IFWL_App; | |
22 class IFWL_DataProvider; | 22 class IFWL_DataProvider; |
23 class IFWL_Thread; | |
24 class IFWL_ThemeProvider; | 23 class IFWL_ThemeProvider; |
25 class IFWL_Widget; | 24 class IFWL_Widget; |
26 | 25 |
27 class CFWL_WidgetImp : public CFWL_TargetImp { | 26 class CFWL_WidgetImp { |
28 public: | 27 public: |
28 virtual ~CFWL_WidgetImp(); | |
29 | |
29 virtual FWL_ERR Initialize(); | 30 virtual FWL_ERR Initialize(); |
30 virtual FWL_ERR Finalize(); | 31 virtual FWL_ERR Finalize(); |
32 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | |
33 virtual uint32_t GetClassID() const; | |
34 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; | |
31 | 35 |
32 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 36 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
33 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); | 37 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); |
34 virtual FWL_ERR SetWidgetRect(const CFX_RectF& rect); | 38 virtual FWL_ERR SetWidgetRect(const CFX_RectF& rect); |
35 virtual FWL_ERR GetClientRect(CFX_RectF& rect); | 39 virtual FWL_ERR GetClientRect(CFX_RectF& rect); |
36 virtual IFWL_Widget* GetParent(); | 40 virtual IFWL_Widget* GetParent(); |
37 virtual FWL_ERR SetParent(IFWL_Widget* pParent); | 41 virtual FWL_ERR SetParent(IFWL_Widget* pParent); |
38 virtual IFWL_Widget* GetOwner(); | 42 virtual IFWL_Widget* GetOwner(); |
39 virtual FWL_ERR SetOwner(IFWL_Widget* pOwner); | 43 virtual FWL_ERR SetOwner(IFWL_Widget* pOwner); |
40 virtual IFWL_Widget* GetOuter(); | 44 virtual IFWL_Widget* GetOuter(); |
(...skipping 16 matching lines...) Expand all Loading... | |
57 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 61 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); |
58 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); | 62 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); |
59 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 63 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
60 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); | 64 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); |
61 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 65 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
62 const CFX_Matrix* pMatrix = NULL); | 66 const CFX_Matrix* pMatrix = NULL); |
63 virtual IFWL_ThemeProvider* GetThemeProvider(); | 67 virtual IFWL_ThemeProvider* GetThemeProvider(); |
64 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 68 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
65 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); | 69 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); |
66 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 70 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
67 virtual IFWL_Thread* GetOwnerThread() const; | 71 virtual IFWL_App* GetOwnerThread() const; |
68 FWL_ERR SetOwnerThread(CFWL_ThreadImp* pOwnerThread); | 72 FWL_ERR SetOwnerThread(CFWL_AppImp* pOwnerThread); |
69 IFWL_Widget* GetInterface() const; | 73 IFWL_Widget* GetInterface() const; |
70 void SetInterface(IFWL_Widget* pInterface); | 74 void SetInterface(IFWL_Widget* pInterface); |
71 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); | 75 CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
72 | 76 |
73 protected: | 77 protected: |
78 friend class CFWL_WidgetImpDelegate; | |
79 | |
74 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, | 80 CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, |
75 IFWL_Widget* pOuter); | 81 IFWL_Widget* pOuter); |
76 virtual ~CFWL_WidgetImp(); | 82 |
77 FX_BOOL IsEnabled() const; | 83 FX_BOOL IsEnabled() const; |
78 FX_BOOL IsVisible() const; | 84 FX_BOOL IsVisible() const; |
79 FX_BOOL IsActive() const; | 85 FX_BOOL IsActive() const; |
80 FX_BOOL IsOverLapper() const; | 86 FX_BOOL IsOverLapper() const; |
81 FX_BOOL IsPopup() const; | 87 FX_BOOL IsPopup() const; |
82 FX_BOOL IsChild() const; | 88 FX_BOOL IsChild() const; |
83 FX_BOOL IsLocked() const; | 89 FX_BOOL IsLocked() const; |
84 FX_BOOL IsOffscreen() const; | 90 FX_BOOL IsOffscreen() const; |
85 FX_BOOL HasBorder() const; | 91 FX_BOOL HasBorder() const; |
86 FX_BOOL HasEdge() const; | 92 FX_BOOL HasEdge() const; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 IFWL_ThemeProvider* pTheme, | 140 IFWL_ThemeProvider* pTheme, |
135 const CFX_Matrix* pMatrix = NULL); | 141 const CFX_Matrix* pMatrix = NULL); |
136 void DrawEdge(CFX_Graphics* pGraphics, | 142 void DrawEdge(CFX_Graphics* pGraphics, |
137 CFWL_Part iPartEdge, | 143 CFWL_Part iPartEdge, |
138 IFWL_ThemeProvider* pTheme, | 144 IFWL_ThemeProvider* pTheme, |
139 const CFX_Matrix* pMatrix = NULL); | 145 const CFX_Matrix* pMatrix = NULL); |
140 void NotifyDriver(); | 146 void NotifyDriver(); |
141 | 147 |
142 FX_BOOL IsParent(IFWL_Widget* pParent); | 148 FX_BOOL IsParent(IFWL_Widget* pParent); |
143 | 149 |
144 friend class CFWL_WidgetImpDelegate; | |
145 | |
146 CFWL_WidgetMgr* m_pWidgetMgr; | 150 CFWL_WidgetMgr* m_pWidgetMgr; |
147 CFWL_ThreadImp* m_pOwnerThread; | 151 CFWL_AppImp* m_pOwnerThread; |
Tom Sepez
2016/04/27 20:23:34
ditto on "thread"
dsinclair
2016/04/27 20:58:55
Done.
| |
148 CFWL_WidgetImpProperties* m_pProperties; | 152 CFWL_WidgetImpProperties* m_pProperties; |
149 CFX_PrivateData* m_pPrivateData; | 153 CFX_PrivateData* m_pPrivateData; |
150 IFWL_WidgetDelegate* m_pDelegate; | 154 IFWL_WidgetDelegate* m_pDelegate; |
151 IFWL_WidgetDelegate* m_pCurDelegate; | 155 IFWL_WidgetDelegate* m_pCurDelegate; |
152 IFWL_Widget* m_pOuter; | 156 IFWL_Widget* m_pOuter; |
153 IFWL_Widget* m_pInterface; | 157 IFWL_Widget* m_pInterface; |
154 int32_t m_iLock; | 158 int32_t m_iLock; |
155 }; | 159 }; |
156 | 160 |
157 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { | 161 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { |
158 public: | 162 public: |
159 CFWL_WidgetImpDelegate(); | 163 CFWL_WidgetImpDelegate(); |
160 ~CFWL_WidgetImpDelegate() override {} | 164 ~CFWL_WidgetImpDelegate() override {} |
161 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 165 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
162 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | 166 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; |
163 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 167 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
164 const CFX_Matrix* pMatrix = NULL) override; | 168 const CFX_Matrix* pMatrix = NULL) override; |
165 }; | 169 }; |
166 | 170 |
167 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 171 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
OLD | NEW |