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" |
(...skipping 29 matching lines...) Expand all Loading... |
40 ~IFWL_ToolTip() override; | 40 ~IFWL_ToolTip() override; |
41 | 41 |
42 // IFWL_Widget | 42 // IFWL_Widget |
43 FWL_Type GetClassID() const override; | 43 FWL_Type GetClassID() const override; |
44 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 44 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
45 FWL_Error Update() override; | 45 FWL_Error Update() override; |
46 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 46 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
47 const CFX_Matrix* pMatrix = nullptr) override; | 47 const CFX_Matrix* pMatrix = nullptr) override; |
48 void SetStates(uint32_t dwStates, FX_BOOL bSet) override; | 48 void SetStates(uint32_t dwStates, FX_BOOL bSet) override; |
49 FWL_Error GetClientRect(CFX_RectF& rect) override; | 49 FWL_Error GetClientRect(CFX_RectF& rect) override; |
| 50 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 51 const CFX_Matrix* pMatrix) override; |
50 | 52 |
51 void SetAnchor(const CFX_RectF& rtAnchor); | 53 void SetAnchor(const CFX_RectF& rtAnchor); |
52 void Show(); | 54 void Show(); |
53 void Hide(); | 55 void Hide(); |
54 | 56 |
55 protected: | 57 protected: |
56 friend class CFWL_ToolTipImpDelegate; | |
57 | |
58 class Timer : public IFWL_Timer { | 58 class Timer : public IFWL_Timer { |
59 public: | 59 public: |
60 explicit Timer(IFWL_ToolTip* pToolTip); | 60 explicit Timer(IFWL_ToolTip* pToolTip); |
61 ~Timer() override {} | 61 ~Timer() override {} |
62 | 62 |
63 void Run(IFWL_TimerInfo* pTimerInfo) override; | 63 void Run(IFWL_TimerInfo* pTimerInfo) override; |
64 }; | 64 }; |
65 friend class IFWL_ToolTip::Timer; | 65 friend class IFWL_ToolTip::Timer; |
66 | 66 |
67 void DrawBkground(CFX_Graphics* pGraphics, | 67 void DrawBkground(CFX_Graphics* pGraphics, |
68 IFWL_ThemeProvider* pTheme, | 68 IFWL_ThemeProvider* pTheme, |
69 const CFX_Matrix* pMatrix); | 69 const CFX_Matrix* pMatrix); |
70 void DrawText(CFX_Graphics* pGraphics, | 70 void DrawText(CFX_Graphics* pGraphics, |
71 IFWL_ThemeProvider* pTheme, | 71 IFWL_ThemeProvider* pTheme, |
72 const CFX_Matrix* pMatrix); | 72 const CFX_Matrix* pMatrix); |
73 void UpdateTextOutStyles(); | 73 void UpdateTextOutStyles(); |
74 void RefreshToolTipPos(); | 74 void RefreshToolTipPos(); |
75 | 75 |
76 CFX_RectF m_rtClient; | 76 CFX_RectF m_rtClient; |
77 CFX_RectF m_rtCaption; | 77 CFX_RectF m_rtCaption; |
78 FX_BOOL m_bBtnDown; | 78 FX_BOOL m_bBtnDown; |
79 uint32_t m_dwTTOStyles; | 79 uint32_t m_dwTTOStyles; |
80 int32_t m_iTTOAlign; | 80 int32_t m_iTTOAlign; |
81 CFX_RectF m_rtAnchor; | 81 CFX_RectF m_rtAnchor; |
82 IFWL_TimerInfo* m_pTimerInfoShow; | 82 IFWL_TimerInfo* m_pTimerInfoShow; |
83 IFWL_TimerInfo* m_pTimerInfoHide; | 83 IFWL_TimerInfo* m_pTimerInfoHide; |
84 IFWL_ToolTip::Timer m_TimerShow; | 84 IFWL_ToolTip::Timer m_TimerShow; |
85 IFWL_ToolTip::Timer m_TimerHide; | 85 IFWL_ToolTip::Timer m_TimerHide; |
86 }; | |
87 | 86 |
88 class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { | 87 private: |
89 public: | 88 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet); |
90 CFWL_ToolTipImpDelegate(IFWL_ToolTip* pOwner); | |
91 void OnProcessMessage(CFWL_Message* pMessage) override; | |
92 void OnProcessEvent(CFWL_Event* pEvent) override; | |
93 void OnDrawWidget(CFX_Graphics* pGraphics, | |
94 const CFX_Matrix* pMatrix = nullptr) override; | |
95 | |
96 protected: | |
97 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | |
98 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 89 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
99 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 90 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
100 void OnMouseMove(CFWL_MsgMouse* pMsg); | 91 void OnMouseMove(CFWL_MsgMouse* pMsg); |
101 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 92 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
102 void OnKeyDown(CFWL_MsgKey* pMsg); | 93 void OnKeyDown(CFWL_MsgKey* pMsg); |
103 IFWL_ToolTip* m_pOwner; | |
104 }; | 94 }; |
105 | 95 |
106 #endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ | 96 #endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ |
OLD | NEW |