Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fwl / src / basewidget / include / fwl_checkboximp.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_CHECKBOX_IMP_H\r
8 #define _FWL_CHECKBOX_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_CheckBoxImp;\r
14 class CFWL_CheckBoxImpDelegate;\r
15 class CFWL_CheckBoxImp : public CFWL_WidgetImp\r
16 {\r
17 public:\r
18     CFWL_CheckBoxImp(IFWL_Widget *pOuter = NULL);\r
19     CFWL_CheckBoxImp(const CFWL_WidgetImpProperties &properties, IFWL_Widget *pOuter = NULL);\r
20     ~CFWL_CheckBoxImp();\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         Update();\r
27     virtual FWL_ERR             DrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
28     virtual FX_INT32    GetCheckState();\r
29     virtual FWL_ERR             SetCheckState(FX_INT32 iCheck);\r
30 protected:\r
31     void                Layout();\r
32     FX_DWORD    GetPartStates();\r
33     void                UpdateTextOutStyles();\r
34     void                NextStates();\r
35     CFX_RectF   m_rtClient;\r
36     CFX_RectF   m_rtBox;\r
37     CFX_RectF   m_rtCaption;\r
38     CFX_RectF   m_rtFocus;\r
39     FX_DWORD    m_dwTTOStyles;\r
40     FX_INT32    m_iTTOAlign;\r
41     FX_BOOL             m_bBtnDown;\r
42     friend class CFWL_CheckBoxImpDelegate;\r
43 };\r
44 class CFWL_CheckBoxImpDelegate : public CFWL_WidgetImpDelegate\r
45 {\r
46 public:\r
47     CFWL_CheckBoxImpDelegate(CFWL_CheckBoxImp *pOwner);\r
48     virtual FX_INT32    OnProcessMessage(CFWL_Message *pMessage);\r
49     virtual FWL_ERR             OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
50 protected:\r
51     void        OnActivate(CFWL_Message *pMsg);\r
52     void        OnFocusChanged(CFWL_Message *pMsg, FX_BOOL bSet = TRUE);\r
53     void        OnLButtonDown(CFWL_MsgMouse *pMsg);\r
54     void        OnLButtonUp(CFWL_MsgMouse *pMsg);\r
55     void        OnMouseMove(CFWL_MsgMouse *pMsg);\r
56     void        OnMouseLeave(CFWL_MsgMouse *pMsg);\r
57     void        OnKeyDown(CFWL_MsgKey *pMsg);\r
58     CFWL_CheckBoxImp *m_pOwner;\r
59 };\r
60 #endif\r