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 _FWL_TOOLTIP_H
8 #define _FWL_TOOLTIP_H
9 class CFWL_WidgetImpProperties;
10 class IFWL_Form;
11 class IFWL_ToolTipDP;
12 class IFWL_ToolTip;
13 #define FWL_CLASS_ToolTip L"FWL_TOOLTIP"
14 #define FWL_CLASSHASH_ToolTip 1111984755
15 #define FWL_STYLEEXT_TTP_Rectangle (0L << 3)
16 #define FWL_STYLEEXT_TTP_RoundCorner (1L << 3)
17 #define FWL_STYLEEXT_TTP_Balloon (1L << 4)
18 #define FWL_STYLEEXT_TTP_Multiline (1L << 5)
19 #define FWL_STYLEEXT_TTP_NoAnchor (1L << 6)
20 #define FWL_PART_TTP_Border 1
21 #define FWL_PART_TTP_Background 2
22 #define FWL_PART_TTP_Caption 3
23 class IFWL_ToolTipDP : public IFWL_DataProvider {
24  public:
25   virtual FWL_ERR GetCaption(IFWL_Widget* pWidget,
26                              CFX_WideString& wsCaption) = 0;
27   virtual int32_t GetInitialDelay(IFWL_Widget* pWidget) = 0;
28   virtual int32_t GetAutoPopDelay(IFWL_Widget* pWidget) = 0;
29   virtual CFX_DIBitmap* GetToolTipIcon(IFWL_Widget* pWidget) = 0;
30   virtual CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) = 0;
31 };
32 class IFWL_ToolTip : public IFWL_Form {
33  public:
34   static IFWL_ToolTip* Create(const CFWL_WidgetImpProperties& properties,
35                               IFWL_Widget* pOuter);
36 
37   FWL_ERR SetAnchor(const CFX_RectF& rtAnchor);
38   FWL_ERR Show();
39   FWL_ERR Hide();
40 
41  protected:
42   IFWL_ToolTip();
43 };
44 #endif
45