Chromium Code Reviews| Index: xfa/fwl/core/ifwl_widget.h |
| diff --git a/xfa/fwl/core/ifwl_widget.h b/xfa/fwl/core/ifwl_widget.h |
| index 3540a3c87c87d6765b51e0bfb163ce42e68b859f..3b819ad86ed0161f46378e9018e1452532c3d8b4 100644 |
| --- a/xfa/fwl/core/ifwl_widget.h |
| +++ b/xfa/fwl/core/ifwl_widget.h |
| @@ -7,21 +7,38 @@ |
| #ifndef XFA_FWL_CORE_IFWL_WIDGET_H_ |
| #define XFA_FWL_CORE_IFWL_WIDGET_H_ |
| +#include <memory> |
| + |
| #include "core/fxcrt/include/fx_basic.h" |
| #include "core/fxcrt/include/fx_coordinates.h" |
| #include "core/fxcrt/include/fx_system.h" |
| #include "xfa/fwl/core/fwl_error.h" |
| -#include "xfa/fwl/core/ifwl_target.h" |
| +#include "xfa/fwl/core/fwl_widgetimp.h" |
| + |
| +// FWL contains three parallel inheritance hierarchies, which reference each |
| +// other via pointers as follows: |
| +// |
| +// m_pIface m_pImpl |
| +// CFWL_Widget ----------> IFWL_Widget ----------> CFWL_WidgetImp |
| +// | | | |
| +// A A A |
| +// | | | |
| +// CFWL_... IFWL_... CFWL_...Imp |
| +// |
| +class CFWL_WidgetImp; |
| class CFX_Graphics; |
| +class IFWL_App; |
| class IFWL_DataProvider; |
| class IFWL_Form; |
| -class IFWL_Thread; |
| class IFWL_ThemeProvider; |
| class IFWL_WidgetDelegate; |
| -class IFWL_Widget : public IFWL_Target { |
| +class IFWL_Widget { |
| public: |
| + IFWL_Widget() : m_pImpl(nullptr) {} |
| + virtual ~IFWL_Widget(); |
| + |
| FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
| FWL_ERR GetGlobalRect(CFX_RectF& rect); |
| FWL_ERR SetWidgetRect(const CFX_RectF& rect); |
| @@ -54,8 +71,24 @@ class IFWL_Widget : public IFWL_Target { |
| FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
| FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); |
| IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
| - IFWL_Thread* GetOwnerThread() const; |
| + IFWL_App* GetOwnerApp() const; |
| CFX_SizeF GetOffsetFromParent(IFWL_Widget* pParent); |
| + |
| + // These call into equivalent polymorphic methods of m_pImpl. There |
| + // should be no need to override these in subclasses. |
| + FWL_ERR GetClassName(CFX_WideString& wsClass) const; |
| + uint32_t GetClassID() const; |
| + FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; |
| + FWL_ERR Initialize(); |
| + FWL_ERR Finalize(); |
| + |
| + CFWL_WidgetImp* GetImpl() const { return m_pImpl.get(); } |
| + |
| + protected: |
| + void SetImpl(CFWL_WidgetImp* pImpl) { m_pImpl.reset(pImpl); } |
|
Tom Sepez
2016/04/28 16:59:29
nit: comment // Takes ownership of |pImpl|.
dsinclair
2016/04/28 18:00:59
Done.
|
| + |
| + private: |
| + std::unique_ptr<CFWL_WidgetImp> m_pImpl; |
| }; |
| #endif // XFA_FWL_CORE_IFWL_WIDGET_H_ |