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_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
8 #define XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ | 8 #define XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
9 | 9 |
10 #include "xfa/fwl/core/ifwl_widget.h" | 10 #include "xfa/fwl/core/ifwl_widget.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #define FWL_PARTSTATE_CKB_Normal (0L << 0) | 52 #define FWL_PARTSTATE_CKB_Normal (0L << 0) |
53 #define FWL_PARTSTATE_CKB_Pressed (1L << 0) | 53 #define FWL_PARTSTATE_CKB_Pressed (1L << 0) |
54 #define FWL_PARTSTATE_CKB_Hovered (2L << 0) | 54 #define FWL_PARTSTATE_CKB_Hovered (2L << 0) |
55 #define FWL_PARTSTATE_CKB_Disabled (3L << 0) | 55 #define FWL_PARTSTATE_CKB_Disabled (3L << 0) |
56 #define FWL_PARTSTATE_CKB_UnChecked (0L << 2) | 56 #define FWL_PARTSTATE_CKB_UnChecked (0L << 2) |
57 #define FWL_PARTSTATE_CKB_Checked (1L << 2) | 57 #define FWL_PARTSTATE_CKB_Checked (1L << 2) |
58 #define FWL_PARTSTATE_CKB_Neutral (2L << 2) | 58 #define FWL_PARTSTATE_CKB_Neutral (2L << 2) |
59 #define FWL_PARTSTATE_CKB_Focused (1L << 4) | 59 #define FWL_PARTSTATE_CKB_Focused (1L << 4) |
60 #define FWL_PARTSTATE_CKB_Mask1 (3L << 0) | 60 #define FWL_PARTSTATE_CKB_Mask1 (3L << 0) |
61 #define FWL_PARTSTATE_CKB_Mask2 (3L << 2) | 61 #define FWL_PARTSTATE_CKB_Mask2 (3L << 2) |
62 #define FWL_EVT_CKB_CheckStateChanged L"FWL_EVENT_CKB_CheckStateChanged" | 62 |
| 63 // TODO(dsinclair): Event hash is hash of string, cleanup. pdfium:474 |
63 #define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 | 64 #define FWL_EVTHASH_CKB_CheckStateChanged 2503252963 |
64 | 65 |
65 BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, | 66 BEGIN_FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, |
66 FWL_EVTHASH_CKB_CheckStateChanged) | 67 FWL_EVTHASH_CKB_CheckStateChanged) |
67 END_FWL_EVENT_DEF | 68 END_FWL_EVENT_DEF |
68 | 69 |
69 class IFWL_CheckBoxDP : public IFWL_DataProvider { | 70 class IFWL_CheckBoxDP : public IFWL_DataProvider { |
70 public: | 71 public: |
71 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; | 72 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; |
72 }; | 73 }; |
73 | 74 |
74 class IFWL_CheckBox : public IFWL_Widget { | 75 class IFWL_CheckBox : public IFWL_Widget { |
75 public: | 76 public: |
76 static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, | 77 static IFWL_CheckBox* Create(const CFWL_WidgetImpProperties& properties, |
77 IFWL_Widget* pOuter); | 78 IFWL_Widget* pOuter); |
78 int32_t GetCheckState(); | 79 int32_t GetCheckState(); |
79 FWL_ERR SetCheckState(int32_t iCheck); | 80 FWL_ERR SetCheckState(int32_t iCheck); |
80 | 81 |
81 protected: | 82 protected: |
82 IFWL_CheckBox(); | 83 IFWL_CheckBox(); |
83 }; | 84 }; |
84 | 85 |
85 #endif // XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ | 86 #endif // XFA_FWL_BASEWIDGET_IFWL_CHECKBOX_H_ |
OLD | NEW |