From 05259e98f7416b59da18ee6059b48a23fddca8af Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 20 Oct 2016 09:59:48 -0700 Subject: Move fwl/lightwidget to fwl/core This CL moves the code from fwl/lightwidget into fwl/core. In anticipation of merging the two hierarchies. Review-Url: https://chromiumcodereview.appspot.com/2430923006 --- xfa/fwl/core/cfwl_widget.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 xfa/fwl/core/cfwl_widget.h (limited to 'xfa/fwl/core/cfwl_widget.h') diff --git a/xfa/fwl/core/cfwl_widget.h b/xfa/fwl/core/cfwl_widget.h new file mode 100644 index 0000000000..cc6967852f --- /dev/null +++ b/xfa/fwl/core/cfwl_widget.h @@ -0,0 +1,65 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef XFA_FWL_CORE_CFWL_WIDGET_H_ +#define XFA_FWL_CORE_CFWL_WIDGET_H_ + +#include + +#include "xfa/fwl/core/cfwl_event.h" +#include "xfa/fwl/core/cfwl_widgetproperties.h" +#include "xfa/fwl/core/ifwl_widget.h" + +class CFWL_Event; +class CFWL_Message; +class CFWL_Widget; +class CFWL_WidgetDelegate; +class CFWL_WidgetMgr; + +class CFWL_Widget { + public: + CFWL_Widget(); + virtual ~CFWL_Widget(); + + virtual IFWL_Widget* GetWidget(); + virtual const IFWL_Widget* GetWidget() const; + + FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); + FWL_Error SetWidgetRect(const CFX_RectF& rect); + FWL_Error GetGlobalRect(CFX_RectF& rect); + FWL_Error GetClientRect(CFX_RectF& rtClient); + + FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved); + uint32_t GetStylesEx(); + FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, + uint32_t dwStylesExRemoved); + + uint32_t GetStates(); + void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); + + void SetLayoutItem(void* pItem); + + void Update(); + void LockUpdate(); + void UnlockUpdate(); + + FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); + + FWL_Error DrawWidget(CFX_Graphics* pGraphics, + const CFX_Matrix* pMatrix = nullptr); + + IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); + + protected: + FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); + + std::unique_ptr m_pIface; + IFWL_WidgetDelegate* m_pDelegate; + CFWL_WidgetMgr* const m_pWidgetMgr; + std::unique_ptr m_pProperties; +}; + +#endif // XFA_FWL_CORE_CFWL_WIDGET_H_ -- cgit v1.2.3