| 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_LIGHTWIDGET_CFWL_TOOLTIP_H_ | 7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_ |
| 8 #define XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_ | 8 #define XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" | 10 #include "xfa/fwl/basewidget/ifwl_tooltip.h" |
| 11 #include "xfa/fwl/lightwidget/cfwl_widget.h" | 11 #include "xfa/fwl/lightwidget/cfwl_widget.h" |
| 12 | 12 |
| 13 class CFWL_ToolTip : public CFWL_Widget { | 13 class CFWL_ToolTip : public CFWL_Widget { |
| 14 public: | 14 public: |
| 15 CFWL_ToolTip(); |
| 16 ~CFWL_ToolTip() override; |
| 17 |
| 15 static CFWL_ToolTip* Create(); | 18 static CFWL_ToolTip* Create(); |
| 16 | 19 |
| 17 CFWL_ToolTip(); | |
| 18 virtual ~CFWL_ToolTip(); | |
| 19 | |
| 20 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); | 20 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); |
| 21 | 21 |
| 22 void GetCaption(CFX_WideString& wsCaption); | 22 void GetCaption(CFX_WideString& wsCaption); |
| 23 void SetCaption(const CFX_WideStringC& wsCaption); | 23 void SetCaption(const CFX_WideStringC& wsCaption); |
| 24 | 24 |
| 25 int32_t GetInitialDelay(); | 25 int32_t GetInitialDelay(); |
| 26 void SetInitialDelay(int32_t nDelayTime); | 26 void SetInitialDelay(int32_t nDelayTime); |
| 27 | 27 |
| 28 int32_t GetAutoPopDelay(); | 28 int32_t GetAutoPopDelay(); |
| 29 void SetAutoPopDelay(int32_t nDelayTime); | 29 void SetAutoPopDelay(int32_t nDelayTime); |
| 30 | 30 |
| 31 CFX_DIBitmap* GetToolTipIcon(); | 31 CFX_DIBitmap* GetToolTipIcon(); |
| 32 void SetToolTipIcon(CFX_DIBitmap* pBitmap); | 32 void SetToolTipIcon(CFX_DIBitmap* pBitmap); |
| 33 CFX_SizeF GetToolTipIconSize(); | 33 CFX_SizeF GetToolTipIconSize(); |
| 34 void SetToolTipIconSize(CFX_SizeF fSize); | 34 void SetToolTipIconSize(CFX_SizeF fSize); |
| 35 | 35 |
| 36 void SetAnchor(const CFX_RectF& rtAnchor); | 36 void SetAnchor(const CFX_RectF& rtAnchor); |
| 37 void Show(); | 37 void Show(); |
| 38 void Hide(); | 38 void Hide(); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 class CFWL_ToolTipDP : public IFWL_ToolTipDP { | 41 class CFWL_ToolTipDP : public IFWL_ToolTipDP { |
| 42 public: | 42 public: |
| 43 CFWL_ToolTipDP(); | 43 CFWL_ToolTipDP(); |
| 44 FWL_Error GetCaption(IFWL_Widget* pWidget, CFX_WideString& wsCaption); | 44 ~CFWL_ToolTipDP() override; |
| 45 int32_t GetInitialDelay(IFWL_Widget* pWidget); | 45 |
| 46 int32_t GetAutoPopDelay(IFWL_Widget* pWidget); | 46 // IFWL_DataProvider |
| 47 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget); | 47 FWL_Error GetCaption(IFWL_Widget* pWidget, |
| 48 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget); | 48 CFX_WideString& wsCaption) override; |
| 49 |
| 50 // IFWL_ToolTipDP |
| 51 int32_t GetInitialDelay(IFWL_Widget* pWidget) override; |
| 52 int32_t GetAutoPopDelay(IFWL_Widget* pWidget) override; |
| 53 CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) override; |
| 54 CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) override; |
| 55 |
| 49 CFX_RectF GetAnchor(); | 56 CFX_RectF GetAnchor(); |
| 50 CFX_WideString m_wsCaption; | 57 CFX_WideString m_wsCaption; |
| 51 int32_t m_nInitDelayTime; | 58 int32_t m_nInitDelayTime; |
| 52 int32_t m_nAutoPopDelayTime; | 59 int32_t m_nAutoPopDelayTime; |
| 53 CFX_DIBitmap* m_pBitmap; | 60 CFX_DIBitmap* m_pBitmap; |
| 54 CFX_SizeF m_fIconSize; | 61 CFX_SizeF m_fIconSize; |
| 55 CFX_RectF m_fAnchor; | 62 CFX_RectF m_fAnchor; |
| 56 }; | 63 }; |
| 64 |
| 57 CFWL_ToolTipDP m_tooltipData; | 65 CFWL_ToolTipDP m_tooltipData; |
| 58 }; | 66 }; |
| 59 | 67 |
| 60 #endif // XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_ | 68 #endif // XFA_FWL_LIGHTWIDGET_CFWL_TOOLTIP_H_ |
| OLD | NEW |