Index: xfa/fwl/core/ifwl_tooltip.h |
diff --git a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h b/xfa/fwl/core/ifwl_tooltip.h |
similarity index 64% |
rename from xfa/fwl/basewidget/fwl_tooltipctrlimp.h |
rename to xfa/fwl/core/ifwl_tooltip.h |
index f814eea256e5eb094af6519552c4dfdf2bec11fe..69f0e13596bea8cf6383e527fd4a348a4a8af5c5 100644 |
--- a/xfa/fwl/basewidget/fwl_tooltipctrlimp.h |
+++ b/xfa/fwl/core/ifwl_tooltip.h |
@@ -4,24 +4,44 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
-#ifndef XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
-#define XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
+#ifndef XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
+#define XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
-#include "xfa/fwl/core/fwl_formimp.h" |
-#include "xfa/fwl/core/fwl_widgetimp.h" |
+#include "xfa/fwl/core/ifwl_form.h" |
#include "xfa/fwl/core/ifwl_timer.h" |
class CFWL_WidgetImpProperties; |
class IFWL_Widget; |
class CFWL_ToolTipImpDelegate; |
-class CFWL_ToolTipImp : public CFWL_FormImp { |
+#define FWL_CLASS_ToolTip L"FWL_TOOLTIP" |
+#define FWL_STYLEEXT_TTP_Rectangle (0L << 3) |
+#define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) |
+#define FWL_STYLEEXT_TTP_Balloon (1L << 4) |
+#define FWL_STYLEEXT_TTP_Multiline (1L << 5) |
+#define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) |
+ |
+class IFWL_ToolTipDP : public IFWL_DataProvider { |
public: |
- CFWL_ToolTipImp(const CFWL_WidgetImpProperties& properties, |
- IFWL_Widget* pOuter); |
- ~CFWL_ToolTipImp() override; |
+ // IFWL_DataProvider |
+ FWL_Error GetCaption(IFWL_Widget* pWidget, |
+ CFX_WideString& wsCaption) override = 0; |
+ |
+ virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0; |
+ virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0; |
+ virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0; |
+ virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0; |
+}; |
+ |
+class IFWL_ToolTip : public IFWL_Form { |
+ public: |
+ static IFWL_ToolTip* Create(const CFWL_WidgetImpProperties& properties, |
+ IFWL_Widget* pOuter); |
+ |
+ IFWL_ToolTip(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
+ ~IFWL_ToolTip() override; |
- // CFWL_WidgetImp |
+ // IFWL_Widget |
FWL_Error GetClassName(CFX_WideString& wsClass) const override; |
FWL_Type GetClassID() const override; |
FWL_Error Initialize() override; |
@@ -44,12 +64,12 @@ class CFWL_ToolTipImp : public CFWL_FormImp { |
class CFWL_ToolTipTimer : public IFWL_Timer { |
public: |
CFWL_ToolTipTimer() {} |
- explicit CFWL_ToolTipTimer(CFWL_ToolTipImp* pToolTip); |
+ explicit CFWL_ToolTipTimer(IFWL_ToolTip* pToolTip); |
~CFWL_ToolTipTimer() override {} |
void Run(IFWL_TimerInfo* pTimerInfo) override; |
- CFWL_ToolTipImp* m_pToolTip; |
+ IFWL_ToolTip* m_pToolTip; |
}; |
void DrawBkground(CFX_Graphics* pGraphics, |
@@ -75,7 +95,7 @@ class CFWL_ToolTipImp : public CFWL_FormImp { |
class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { |
public: |
- CFWL_ToolTipImpDelegate(CFWL_ToolTipImp* pOwner); |
+ CFWL_ToolTipImpDelegate(IFWL_ToolTip* pOwner); |
void OnProcessMessage(CFWL_Message* pMessage) override; |
void OnProcessEvent(CFWL_Event* pEvent) override; |
void OnDrawWidget(CFX_Graphics* pGraphics, |
@@ -88,7 +108,7 @@ class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { |
void OnMouseMove(CFWL_MsgMouse* pMsg); |
void OnMouseLeave(CFWL_MsgMouse* pMsg); |
void OnKeyDown(CFWL_MsgKey* pMsg); |
- CFWL_ToolTipImp* m_pOwner; |
+ IFWL_ToolTip* m_pOwner; |
}; |
-#endif // XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
+#endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ |