Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fwl / src / basewidget / include / fwl_tooltipctrlimp.h
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
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \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
12 class IFWL_Widget;\r
13 class IFWL_Timer;\r
14 class CFWL_ToolTipImp;\r
15 class CFWL_ToolTipImpDelegate;\r
16 class CFWL_ToolTipImp : public CFWL_FormImp\r
17 {\r
18 public:\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
32     FWL_ERR             Show();\r
33     FWL_ERR             Hide();\r
34 protected:\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
40     {\r
41     public:\r
42         CFWL_ToolTipTimer() {};\r
43         ~CFWL_ToolTipTimer() {};\r
44         CFWL_ToolTipTimer(CFWL_ToolTipImp * pToolTip);\r
45         virtual int32_t Run(FWL_HTIMER hTimer);\r
46         CFWL_ToolTipImp *m_pToolTip;\r
47     };\r
48     CFX_RectF   m_rtClient;\r
49     CFX_RectF   m_rtCaption;\r
50     FX_BOOL             m_bBtnDown;\r
51     FX_DWORD    m_dwTTOStyles;\r
52     int32_t     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
61 };\r
62 class CFWL_ToolTipImpDelegate : public CFWL_WidgetImpDelegate\r
63 {\r
64 public:\r
65     CFWL_ToolTipImpDelegate(CFWL_ToolTipImp *pOwner);\r
66     virtual int32_t     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
69 protected:\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
77 };\r
78 #endif\r