| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
| 6 | |
| 7 #ifndef XFA_FWL_CORE_IFWL_TOOLTIP_H_ | |
| 8 #define XFA_FWL_CORE_IFWL_TOOLTIP_H_ | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "xfa/fwl/core/ifwl_form.h" | |
| 13 #include "xfa/fwl/core/ifwl_timer.h" | |
| 14 | |
| 15 class CFWL_WidgetProperties; | |
| 16 class IFWL_Widget; | |
| 17 | |
| 18 #define FWL_STYLEEXT_TTP_Rectangle (0L << 3) | |
| 19 #define FWL_STYLEEXT_TTP_RoundCorner (1L << 3) | |
| 20 #define FWL_STYLEEXT_TTP_Balloon (1L << 4) | |
| 21 #define FWL_STYLEEXT_TTP_Multiline (1L << 5) | |
| 22 #define FWL_STYLEEXT_TTP_NoAnchor (1L << 6) | |
| 23 | |
| 24 class IFWL_ToolTip : public IFWL_Form { | |
| 25 public: | |
| 26 IFWL_ToolTip(const IFWL_App* app, | |
| 27 std::unique_ptr<CFWL_WidgetProperties> properties, | |
| 28 IFWL_Widget* pOuter); | |
| 29 ~IFWL_ToolTip() override; | |
| 30 | |
| 31 // IFWL_Widget | |
| 32 FWL_Type GetClassID() const override; | |
| 33 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | |
| 34 void Update() override; | |
| 35 void DrawWidget(CFX_Graphics* pGraphics, | |
| 36 const CFX_Matrix* pMatrix = nullptr) override; | |
| 37 void SetStates(uint32_t dwStates, bool bSet) override; | |
| 38 void GetClientRect(CFX_RectF& rect) override; | |
| 39 void OnDrawWidget(CFX_Graphics* pGraphics, | |
| 40 const CFX_Matrix* pMatrix) override; | |
| 41 | |
| 42 private: | |
| 43 class Timer : public IFWL_Timer { | |
| 44 public: | |
| 45 explicit Timer(IFWL_ToolTip* pToolTip); | |
| 46 ~Timer() override {} | |
| 47 | |
| 48 void Run(IFWL_TimerInfo* pTimerInfo) override; | |
| 49 }; | |
| 50 friend class IFWL_ToolTip::Timer; | |
| 51 | |
| 52 void DrawBkground(CFX_Graphics* pGraphics, | |
| 53 IFWL_ThemeProvider* pTheme, | |
| 54 const CFX_Matrix* pMatrix); | |
| 55 void DrawText(CFX_Graphics* pGraphics, | |
| 56 IFWL_ThemeProvider* pTheme, | |
| 57 const CFX_Matrix* pMatrix); | |
| 58 void UpdateTextOutStyles(); | |
| 59 void RefreshToolTipPos(); | |
| 60 | |
| 61 CFX_RectF m_rtClient; | |
| 62 CFX_RectF m_rtCaption; | |
| 63 uint32_t m_dwTTOStyles; | |
| 64 int32_t m_iTTOAlign; | |
| 65 CFX_RectF m_rtAnchor; | |
| 66 IFWL_TimerInfo* m_pTimerInfoShow; | |
| 67 IFWL_TimerInfo* m_pTimerInfoHide; | |
| 68 IFWL_ToolTip::Timer m_TimerShow; | |
| 69 IFWL_ToolTip::Timer m_TimerHide; | |
| 70 }; | |
| 71 | |
| 72 #endif // XFA_FWL_CORE_IFWL_TOOLTIP_H_ | |
| OLD | NEW |