Merge to XFA: Use stdint.h types throughout PDFium.
[pdfium.git] / xfa / src / fwl / src / basewidget / include / fwl_spinbuttonimp.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_SPINBUTTON_IMP_H\r
8 #define _FWL_SPINBUTTON_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_SpinButtonImp;\r
15 class CFWL_SpinButtonImpDelegate;\r
16 class CFWL_SpinButtonImp : public CFWL_WidgetImp, public IFWL_Timer\r
17 {\r
18 public:\r
19     CFWL_SpinButtonImp(IFWL_Widget *pOuter = NULL);\r
20     CFWL_SpinButtonImp(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);\r
21     ~CFWL_SpinButtonImp();\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 FX_DWORD    HitTest(FX_FLOAT fx, FX_FLOAT fy);\r
29     virtual FWL_ERR             DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
30     virtual int32_t     Run(FWL_HTIMER hTimer);\r
31     FWL_ERR             EnableButton(FX_BOOL bEnable, FX_BOOL bUp = TRUE);\r
32     FX_BOOL             IsButtonEnable(FX_BOOL bUp = TRUE);\r
33 protected:\r
34     void        DrawUpButton(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);\r
35     void        DrawDownButton(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);\r
36     CFX_RectF   m_rtClient;\r
37     CFX_RectF   m_rtUpButton;\r
38     CFX_RectF   m_rtDnButton;\r
39     FX_DWORD    m_dwUpState;\r
40     FX_DWORD    m_dwDnState;\r
41     int32_t     m_iButtonIndex;\r
42     FX_BOOL     m_bLButtonDwn;\r
43     FWL_HTIMER  m_hTimer;\r
44     friend class CFWL_SpinButtonImpDelegate;\r
45 };\r
46 class CFWL_SpinButtonImpDelegate : public CFWL_WidgetImpDelegate\r
47 {\r
48 public:\r
49     CFWL_SpinButtonImpDelegate(CFWL_SpinButtonImp *pOwner);\r
50     virtual int32_t     OnProcessMessage(CFWL_Message *pMessage);\r
51     virtual FWL_ERR             OnProcessEvent(CFWL_Event *pEvent);\r
52     virtual FWL_ERR             OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
53 protected:\r
54     void        OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);\r
55     void        OnLButtonDown(CFWL_MsgMouse *pMsg);\r
56     void        OnLButtonUp(CFWL_MsgMouse *pMsg);\r
57     void        OnMouseMove(CFWL_MsgMouse *pMsg);\r
58     void        OnMouseLeave(CFWL_MsgMouse *pMsg);\r
59     void        OnKeyDown(CFWL_MsgKey *pMsg);\r
60     CFWL_SpinButtonImp *m_pOwner;\r
61 };\r
62 #endif\r