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_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_formimp.h" | 10 #include "xfa/fwl/core/fwl_formimp.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 void Show(); | 37 void Show(); |
38 void Hide(); | 38 void Hide(); |
39 | 39 |
40 protected: | 40 protected: |
41 friend class CFWL_ToolTipImpDelegate; | 41 friend class CFWL_ToolTipImpDelegate; |
42 friend class CFWL_ToolTipTimer; | 42 friend class CFWL_ToolTipTimer; |
43 | 43 |
44 class CFWL_ToolTipTimer : public IFWL_Timer { | 44 class CFWL_ToolTipTimer : public IFWL_Timer { |
45 public: | 45 public: |
46 CFWL_ToolTipTimer() {} | 46 CFWL_ToolTipTimer() {} |
47 ~CFWL_ToolTipTimer() {} | 47 explicit CFWL_ToolTipTimer(CFWL_ToolTipImp* pToolTip); |
| 48 ~CFWL_ToolTipTimer() override {} |
48 | 49 |
49 CFWL_ToolTipTimer(CFWL_ToolTipImp* pToolTip); | 50 void Run(IFWL_TimerInfo* pTimerInfo) override; |
50 virtual int32_t Run(FWL_HTIMER hTimer); | |
51 | 51 |
52 CFWL_ToolTipImp* m_pToolTip; | 52 CFWL_ToolTipImp* m_pToolTip; |
53 }; | 53 }; |
54 | 54 |
55 void DrawBkground(CFX_Graphics* pGraphics, | 55 void DrawBkground(CFX_Graphics* pGraphics, |
56 IFWL_ThemeProvider* pTheme, | 56 IFWL_ThemeProvider* pTheme, |
57 const CFX_Matrix* pMatrix); | 57 const CFX_Matrix* pMatrix); |
58 void DrawText(CFX_Graphics* pGraphics, | 58 void DrawText(CFX_Graphics* pGraphics, |
59 IFWL_ThemeProvider* pTheme, | 59 IFWL_ThemeProvider* pTheme, |
60 const CFX_Matrix* pMatrix); | 60 const CFX_Matrix* pMatrix); |
61 void UpdateTextOutStyles(); | 61 void UpdateTextOutStyles(); |
62 void RefreshToolTipPos(); | 62 void RefreshToolTipPos(); |
63 | 63 |
64 CFX_RectF m_rtClient; | 64 CFX_RectF m_rtClient; |
65 CFX_RectF m_rtCaption; | 65 CFX_RectF m_rtCaption; |
66 FX_BOOL m_bBtnDown; | 66 FX_BOOL m_bBtnDown; |
67 uint32_t m_dwTTOStyles; | 67 uint32_t m_dwTTOStyles; |
68 int32_t m_iTTOAlign; | 68 int32_t m_iTTOAlign; |
69 CFX_RectF m_rtAnchor; | 69 CFX_RectF m_rtAnchor; |
70 FWL_HTIMER m_hTimerShow; | 70 IFWL_TimerInfo* m_pTimerInfoShow; |
71 FWL_HTIMER m_hTimerHide; | 71 IFWL_TimerInfo* m_pTimerInfoHide; |
72 CFWL_ToolTipTimer* m_pTimer; | 72 CFWL_ToolTipTimer* m_pTimer; |
73 CFWL_ToolTipTimer m_TimerShow; | 73 CFWL_ToolTipTimer m_TimerShow; |
74 CFWL_ToolTipTimer m_TimerHide; | 74 CFWL_ToolTipTimer m_TimerHide; |
75 }; | 75 }; |
76 | 76 |
77 class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { | 77 class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate { |
78 public: | 78 public: |
79 CFWL_ToolTipImpDelegate(CFWL_ToolTipImp* pOwner); | 79 CFWL_ToolTipImpDelegate(CFWL_ToolTipImp* pOwner); |
80 void OnProcessMessage(CFWL_Message* pMessage) override; | 80 void OnProcessMessage(CFWL_Message* pMessage) override; |
81 void OnProcessEvent(CFWL_Event* pEvent) override; | 81 void OnProcessEvent(CFWL_Event* pEvent) override; |
82 void OnDrawWidget(CFX_Graphics* pGraphics, | 82 void OnDrawWidget(CFX_Graphics* pGraphics, |
83 const CFX_Matrix* pMatrix = NULL) override; | 83 const CFX_Matrix* pMatrix = NULL) override; |
84 | 84 |
85 protected: | 85 protected: |
86 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 86 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
87 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 87 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
88 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 88 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
89 void OnMouseMove(CFWL_MsgMouse* pMsg); | 89 void OnMouseMove(CFWL_MsgMouse* pMsg); |
90 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 90 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
91 void OnKeyDown(CFWL_MsgKey* pMsg); | 91 void OnKeyDown(CFWL_MsgKey* pMsg); |
92 CFWL_ToolTipImp* m_pOwner; | 92 CFWL_ToolTipImp* m_pOwner; |
93 }; | 93 }; |
94 | 94 |
95 #endif // XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ | 95 #endif // XFA_FWL_BASEWIDGET_FWL_TOOLTIPCTRLIMP_H_ |
OLD | NEW |