OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
8 #define XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_ | 8 #define XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
9 | 9 |
10 #include "xfa/include/fwl/core/fwl_note.h" | 10 #include "xfa/fwl/core/ifwl_widget.h" |
11 #include "xfa/include/fwl/core/fwl_widget.h" | 11 #include "xfa/fwl/core/cfwl_event.h" |
| 12 #include "xfa/fwl/core/ifwl_dataprovider.h" |
| 13 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" |
12 | 14 |
13 #define FWL_CLASS_CheckBox L"FWL_CHECKBOX" | 15 #define FWL_CLASS_CheckBox L"FWL_CHECKBOX" |
14 #define FWL_CLASSHASH_CheckBox 4107183823 | 16 #define FWL_CLASSHASH_CheckBox 4107183823 |
15 #define FWL_STYLEEXT_CKB_Left (0L << 0) | 17 #define FWL_STYLEEXT_CKB_Left (0L << 0) |
16 #define FWL_STYLEEXT_CKB_Center (1L << 0) | 18 #define FWL_STYLEEXT_CKB_Center (1L << 0) |
17 #define FWL_STYLEEXT_CKB_Right (2L << 0) | 19 #define FWL_STYLEEXT_CKB_Right (2L << 0) |
18 #define FWL_STYLEEXT_CKB_Top (0L << 2) | 20 #define FWL_STYLEEXT_CKB_Top (0L << 2) |
19 #define FWL_STYLEEXT_CKB_VCenter (1L << 2) | 21 #define FWL_STYLEEXT_CKB_VCenter (1L << 2) |
20 #define FWL_STYLEEXT_CKB_Bottom (2L << 2) | 22 #define FWL_STYLEEXT_CKB_Bottom (2L << 2) |
21 #define FWL_STYLEEXT_CKB_LeftText (1L << 4) | 23 #define FWL_STYLEEXT_CKB_LeftText (1L << 4) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #define FWL_PARTSTATE_CKB_Neutral (2L << 2) | 58 #define FWL_PARTSTATE_CKB_Neutral (2L << 2) |
57 #define FWL_PARTSTATE_CKB_Focused (1L << 4) | 59 #define FWL_PARTSTATE_CKB_Focused (1L << 4) |
58 #define FWL_PARTSTATE_CKB_Mask1 (3L << 0) | 60 #define FWL_PARTSTATE_CKB_Mask1 (3L << 0) |
59 #define FWL_PARTSTATE_CKB_Mask2 (3L << 2) | 61 #define FWL_PARTSTATE_CKB_Mask2 (3L << 2) |
60 #define FWL_EVT_CKB_CheckStateChanged L"FWL_EVENT_CKB_CheckStateChanged" | 62 #define FWL_EVT_CKB_CheckStateChanged L"FWL_EVENT_CKB_CheckStateChanged" |
61 #define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 | 63 #define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 |
62 | 64 |
63 BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, | 65 BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, |
64 FWL_EVTHASH_CKB_CheckStateChanged) | 66 FWL_EVTHASH_CKB_CheckStateChanged) |
65 END_FWL_EVENT_DEF | 67 END_FWL_EVENT_DEF |
| 68 |
66 class IFWL_CheckBoxDP : public IFWL_DataProvider { | 69 class IFWL_CheckBoxDP : public IFWL_DataProvider { |
67 public: | 70 public: |
68 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; | 71 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; |
69 }; | 72 }; |
70 | 73 |
71 class IFWL_CheckBox : public IFWL_Widget { | 74 class IFWL_CheckBox : public IFWL_Widget { |
72 public: | 75 public: |
73 static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, | 76 static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, |
74 IFWL_Widget* pOuter); | 77 IFWL_Widget* pOuter); |
75 int32_t GetCheckState(); | 78 int32_t GetCheckState(); |
76 FWL_ERR SetCheckState(int32_t iCheck); | 79 FWL_ERR SetCheckState(int32_t iCheck); |
77 | 80 |
78 protected: | 81 protected: |
79 IFWL_CheckBox(); | 82 IFWL_CheckBox(); |
80 }; | 83 }; |
81 | 84 |
82 #endif // XFA_INCLUDE_FWL_BASEWIDGET_FWL_CHECKBOX_H_ | 85 #endif // XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
OLD | NEW |