Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fwl / src / basewidget / include / fwl_pushbuttonimp.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_PUSHBUTTON_IMP_H\r
8 #define _FWL_PUSHBUTTON_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 CFWL_PushButtonImp;\r
14 class CFWL_PushButtonImpDelegate;\r
15 class CFWL_PushButtonImp : public CFWL_WidgetImp\r
16 {\r
17 public:\r
18     CFWL_PushButtonImp(IFWL_Widget *pOuter = NULL);\r
19     CFWL_PushButtonImp(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);\r
20     virtual ~CFWL_PushButtonImp();\r
21     virtual FWL_ERR             GetClassName(CFX_WideString &wsClass) const;\r
22     virtual FX_DWORD    GetClassID() const;\r
23     virtual FWL_ERR             Initialize();\r
24     virtual FWL_ERR             Finalize();\r
25     virtual FWL_ERR             GetWidgetRect(CFX_RectF &rect, FX_BOOL bAutoSize = FALSE);\r
26     virtual FWL_ERR             SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE);\r
27     virtual     FWL_ERR         Update();\r
28     virtual FWL_ERR             DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
29 protected:\r
30     void                DrawBkground(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);\r
31     void                DrawText(CFX_Graphics *pGraphics, IFWL_ThemeProvider *pTheme, const CFX_Matrix *pMatrix);\r
32     FX_DWORD    GetPartStates();\r
33     void                UpdateTextOutStyles();\r
34     CFX_RectF   m_rtClient;\r
35     CFX_RectF   m_rtCaption;\r
36     FX_BOOL             m_bBtnDown;\r
37     FX_DWORD    m_dwTTOStyles;\r
38     FX_INT32    m_iTTOAlign;\r
39     friend class CFWL_PushButtonImpDelegate;\r
40 };\r
41 class CFWL_PushButtonImpDelegate : public CFWL_WidgetImpDelegate\r
42 {\r
43 public:\r
44     CFWL_PushButtonImpDelegate(CFWL_PushButtonImp *pOwner);\r
45     virtual FX_INT32    OnProcessMessage(CFWL_Message *pMessage);\r
46     virtual FWL_ERR             OnProcessEvent(CFWL_Event *pEvent);\r
47     virtual FWL_ERR             OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
48 protected:\r
49     void        OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);\r
50     void        OnLButtonDown(CFWL_MsgMouse *pMsg);\r
51     void        OnLButtonUp(CFWL_MsgMouse *pMsg);\r
52     void        OnMouseMove(CFWL_MsgMouse *pMsg);\r
53     void        OnMouseLeave(CFWL_MsgMouse *pMsg);\r
54     void        OnKeyDown(CFWL_MsgKey *pMsg);\r
55     CFWL_PushButtonImp *m_pOwner;\r
56 };\r
57 #endif\r