1 // Copyright 2014 PDFium Authors. All rights reserved.
\r
2 // Use of this source code is governed by a BSD-style license that can be
\r
3 // found in the LICENSE file.
\r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
\r
7 #ifndef _FWL_ToolTip_IMP_H
\r
8 #define _FWL_ToolTip_IMP_H
\r
9 class CFWL_WidgetImp;
\r
10 class CFWL_WidgetImpProperties;
\r
11 class CFWL_WidgetImpDelegate;
\r
14 class CFWL_ToolTipImp;
\r
15 class CFWL_ToolTipImpDelegate;
\r
16 class CFWL_ToolTipImp : public CFWL_FormImp
\r
19 CFWL_ToolTipImp(IFWL_Widget *pOuter = NULL);
\r
20 CFWL_ToolTipImp(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);
\r
21 virtual ~CFWL_ToolTipImp();
\r
22 virtual FWL_ERR GetClassName(CFX_WideString &wsClass) const;
\r
23 virtual FX_DWORD GetClassID() const;
\r
24 virtual FWL_ERR Initialize();
\r
25 virtual FWL_ERR Finalize();
\r
26 virtual FWL_ERR GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE);
\r
27 virtual FWL_ERR Update();
\r
28 virtual FWL_ERR DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
\r
29 virtual FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet );
\r
30 virtual FWL_ERR GetClientRect(CFX_RectF &rect);
\r
31 FWL_ERR SetAnchor(const CFX_RectF &rtAnchor);
\r
35 void DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);
\r
36 void DrawText(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);
\r
37 void UpdateTextOutStyles();
\r
38 void RefreshToolTipPos();
\r
39 class CFWL_ToolTipTimer : public IFWL_Timer
\r
42 CFWL_ToolTipTimer() {};
\r
43 ~CFWL_ToolTipTimer() {};
\r
44 CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip);
\r
45 virtual FX_INT32 Run(FWL_HTIMER hTimer);
\r
46 CFWL_ToolTipImp *m_pToolTip;
\r
48 CFX_RectF m_rtClient;
\r
49 CFX_RectF m_rtCaption;
\r
51 FX_DWORD m_dwTTOStyles;
\r
52 FX_INT32 m_iTTOAlign;
\r
53 CFX_RectF m_rtAnchor;
\r
54 FWL_HTIMER m_hTimerShow;
\r
55 FWL_HTIMER m_hTimerHide;
\r
56 CFWL_ToolTipTimer* m_pTimer;
\r
57 CFWL_ToolTipTimer m_TimerShow;
\r
58 CFWL_ToolTipTimer m_TimerHide;
\r
59 friend class CFWL_ToolTipImpDelegate;
\r
60 friend class CFWL_ToolTipTimer;
\r
62 class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate
\r
65 CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner);
\r
66 virtual FX_INT32 OnProcessMessage(CFWL_Message *pMessage);
\r
67 virtual FWL_ERR OnProcessEvent(CFWL_Event *pEvent);
\r
68 virtual FWL_ERR OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);
\r
70 void OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);
\r
71 void OnLButtonDown(CFWL_MsgMouse *pMsg);
\r
72 void OnLButtonUp(CFWL_MsgMouse *pMsg);
\r
73 void OnMouseMove(CFWL_MsgMouse *pMsg);
\r
74 void OnMouseLeave(CFWL_MsgMouse *pMsg);
\r
75 void OnKeyDown(CFWL_MsgKey *pMsg);
\r
76 CFWL_ToolTipImp *m_pOwner;
\r