| Index: xfa/fwl/core/ifwl_pushbutton.h
|
| diff --git a/xfa/fwl/basewidget/fwl_pushbuttonimp.h b/xfa/fwl/core/ifwl_pushbutton.h
|
| similarity index 56%
|
| rename from xfa/fwl/basewidget/fwl_pushbuttonimp.h
|
| rename to xfa/fwl/core/ifwl_pushbutton.h
|
| index 31ad5519bbce6fd2286da2b576d6862dd198502e..9901c1a44c3fa37f7d4cd89802f61c75a8ea1b39 100644
|
| --- a/xfa/fwl/basewidget/fwl_pushbuttonimp.h
|
| +++ b/xfa/fwl/core/ifwl_pushbutton.h
|
| @@ -4,24 +4,51 @@
|
|
|
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
|
|
|
| -#ifndef XFA_FWL_BASEWIDGET_FWL_PUSHBUTTONIMP_H_
|
| -#define XFA_FWL_BASEWIDGET_FWL_PUSHBUTTONIMP_H_
|
| +#ifndef XFA_FWL_CORE_IFWL_PUSHBUTTON_H_
|
| +#define XFA_FWL_CORE_IFWL_PUSHBUTTON_H_
|
|
|
| -#include "xfa/fwl/core/fwl_widgetimp.h"
|
| +#include "xfa/fwl/core/cfwl_widgetimpproperties.h"
|
| +#include "xfa/fwl/core/ifwl_dataprovider.h"
|
| #include "xfa/fwl/core/ifwl_widget.h"
|
|
|
| +#define FWL_CLASS_PushButton L"FWL_PUSHBUTTON"
|
| +#define FWL_STYLEEXT_PSB_Left (0L << 0)
|
| +#define FWL_STYLEEXT_PSB_Center (1L << 0)
|
| +#define FWL_STYLEEXT_PSB_Right (2L << 0)
|
| +#define FWL_STYLEEXT_PSB_Top (0L << 2)
|
| +#define FWL_STYLEEXT_PSB_VCenter (1L << 2)
|
| +#define FWL_STYLEEXT_PSB_Bottom (2L << 2)
|
| +#define FWL_STYLEEXT_PSB_TextOnly (0L << 4)
|
| +#define FWL_STYLEEXT_PSB_IconOnly (1L << 4)
|
| +#define FWL_STYLEEXT_PSB_TextIcon (2L << 4)
|
| +#define FWL_STYLEEXT_PSB_HLayoutMask (3L << 0)
|
| +#define FWL_STYLEEXT_PSB_VLayoutMask (3L << 2)
|
| +#define FWL_STYLEEXT_PSB_ModeMask (3L << 4)
|
| +#define FWL_STATE_PSB_Hovered (1 << FWL_WGTSTATE_MAX)
|
| +#define FWL_STATE_PSB_Pressed (1 << (FWL_WGTSTATE_MAX + 1))
|
| +#define FWL_STATE_PSB_Default (1 << (FWL_WGTSTATE_MAX + 2))
|
| +
|
| class CFWL_MsgMouse;
|
| -class CFWL_WidgetImpProperties;
|
| class CFWL_PushButtonImpDelegate;
|
| +class CFWL_WidgetImpProperties;
|
| +class CFX_DIBitmap;
|
| class IFWL_Widget;
|
|
|
| -class CFWL_PushButtonImp : public CFWL_WidgetImp {
|
| +class IFWL_PushButtonDP : public IFWL_DataProvider {
|
| public:
|
| - CFWL_PushButtonImp(const CFWL_WidgetImpProperties& properties,
|
| - IFWL_Widget* pOuter);
|
| - ~CFWL_PushButtonImp() override;
|
| + virtual CFX_DIBitmap* GetPicture(IFWL_Widget* pWidget) = 0;
|
| +};
|
| +
|
| +class IFWL_PushButton : public IFWL_Widget {
|
| + public:
|
| + static IFWL_PushButton* Create(const CFWL_WidgetImpProperties& properties,
|
| + IFWL_Widget* pOuter);
|
| +
|
| + IFWL_PushButton(const CFWL_WidgetImpProperties& properties,
|
| + IFWL_Widget* pOuter);
|
| + ~IFWL_PushButton() override;
|
|
|
| - // CFWL_WidgetImp
|
| + // IFWL_Widget
|
| FWL_Error GetClassName(CFX_WideString& wsClass) const override;
|
| FWL_Type GetClassID() const override;
|
| FWL_Error Initialize() override;
|
| @@ -53,7 +80,7 @@ class CFWL_PushButtonImp : public CFWL_WidgetImp {
|
|
|
| class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate {
|
| public:
|
| - CFWL_PushButtonImpDelegate(CFWL_PushButtonImp* pOwner);
|
| + CFWL_PushButtonImpDelegate(IFWL_PushButton* pOwner);
|
| void OnProcessMessage(CFWL_Message* pMessage) override;
|
| void OnProcessEvent(CFWL_Event* pEvent) override;
|
| void OnDrawWidget(CFX_Graphics* pGraphics,
|
| @@ -66,7 +93,7 @@ class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate {
|
| void OnMouseMove(CFWL_MsgMouse* pMsg);
|
| void OnMouseLeave(CFWL_MsgMouse* pMsg);
|
| void OnKeyDown(CFWL_MsgKey* pMsg);
|
| - CFWL_PushButtonImp* m_pOwner;
|
| + IFWL_PushButton* m_pOwner;
|
| };
|
|
|
| -#endif // XFA_FWL_BASEWIDGET_FWL_PUSHBUTTONIMP_H_
|
| +#endif // XFA_FWL_CORE_IFWL_PUSHBUTTON_H_
|
|
|