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_IFWL_TOOLTIP_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
8 #define XFA_FWL_CORE_IFWL_TOOLTIP_H_ | 8 #define XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/ifwl_form.h" | 10 #include "xfa/fwl/core/ifwl_form.h" |
11 #include "xfa/fwl/core/ifwl_timer.h" | 11 #include "xfa/fwl/core/ifwl_timer.h" |
12 | 12 |
13 class CFWL_WidgetImpProperties; | 13 class CFWL_WidgetImpProperties; |
14 class IFWL_Widget; | 14 class IFWL_Widget; |
15 class CFWL_ToolTipImpDelegate; | 15 class CFWL_ToolTipImpDelegate; |
16 | 16 |
17 #define FWL_CLASS_ToolTip L"FWL_TOOLTIP" | |
18 #define FWL_STYLEEXT_TTP_Rectangle (0L << 3) | 17 #define FWL_STYLEEXT_TTP_Rectangle (0L << 3) |
19 #define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) | 18 #define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) |
20 #define FWL_STYLEEXT_TTP_Balloon (1L << 4) | 19 #define FWL_STYLEEXT_TTP_Balloon (1L << 4) |
21 #define FWL_STYLEEXT_TTP_Multiline (1L << 5) | 20 #define FWL_STYLEEXT_TTP_Multiline (1L << 5) |
22 #define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) | 21 #define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) |
23 | 22 |
24 class IFWL_ToolTipDP : public IFWL_DataProvider { | 23 class IFWL_ToolTipDP : public IFWL_DataProvider { |
25 public: | 24 public: |
26 // IFWL_DataProvider | 25 // IFWL_DataProvider |
27 FWL_Error GetCaption(IFWL_Widget* pWidget, | 26 FWL_Error GetCaption(IFWL_Widget* pWidget, |
28 CFX_WideString& wsCaption) override = 0; | 27 CFX_WideString& wsCaption) override = 0; |
29 | 28 |
30 virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0; | 29 virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0; |
31 virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0; | 30 virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0; |
32 virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0; | 31 virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0; |
33 virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0; | 32 virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0; |
34 }; | 33 }; |
35 | 34 |
36 class IFWL_ToolTip : public IFWL_Form { | 35 class IFWL_ToolTip : public IFWL_Form { |
37 public: | 36 public: |
38 IFWL_ToolTip(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); | 37 IFWL_ToolTip(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
39 ~IFWL_ToolTip() override; | 38 ~IFWL_ToolTip() override; |
40 | 39 |
41 // IFWL_Widget | 40 // IFWL_Widget |
42 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
43 FWL_Type GetClassID() const override; | 41 FWL_Type GetClassID() const override; |
44 FWL_Error Initialize() override; | 42 FWL_Error Initialize() override; |
45 FWL_Error Finalize() override; | 43 void Finalize() override; |
46 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 44 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
47 FWL_Error Update() override; | 45 FWL_Error Update() override; |
48 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 46 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
49 const CFX_Matrix* pMatrix = nullptr) override; | 47 const CFX_Matrix* pMatrix = nullptr) override; |
50 void SetStates(uint32_t dwStates, FX_BOOL bSet) override; | 48 void SetStates(uint32_t dwStates, FX_BOOL bSet) override; |
51 FWL_Error GetClientRect(CFX_RectF& rect) override; | 49 FWL_Error GetClientRect(CFX_RectF& rect) override; |
52 | 50 |
53 void SetAnchor(const CFX_RectF& rtAnchor); | 51 void SetAnchor(const CFX_RectF& rtAnchor); |
54 void Show(); | 52 void Show(); |
55 void Hide(); | 53 void Hide(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 100 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
103 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 101 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
104 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 102 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
105 void OnMouseMove(CFWL_MsgMouse* pMsg); | 103 void OnMouseMove(CFWL_MsgMouse* pMsg); |
106 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 104 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
107 void OnKeyDown(CFWL_MsgKey* pMsg); | 105 void OnKeyDown(CFWL_MsgKey* pMsg); |
108 IFWL_ToolTip* m_pOwner; | 106 IFWL_ToolTip* m_pOwner; |
109 }; | 107 }; |
110 | 108 |
111 #endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ | 109 #endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
OLD | NEW |