| 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_CORE_IFWL_CHECKBOX_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_CHECKBOX_H_ |
| 8 #define XFA_FWL_CORE_IFWL_CHECKBOX_H_ | 8 #define XFA_FWL_CORE_IFWL_CHECKBOX_H_ |
| 9 | 9 |
| 10 #include "xfa/fwl/core/cfwl_event.h" | 10 #include "xfa/fwl/core/cfwl_event.h" |
| 11 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" | 11 #include "xfa/fwl/core/cfwl_widgetimpproperties.h" |
| 12 #include "xfa/fwl/core/ifwl_dataprovider.h" | 12 #include "xfa/fwl/core/ifwl_dataprovider.h" |
| 13 #include "xfa/fwl/core/ifwl_widget.h" | 13 #include "xfa/fwl/core/ifwl_widget.h" |
| 14 | 14 |
| 15 #define FWL_CLASS_CheckBox L"FWL_CHECKBOX" | |
| 16 #define FWL_STYLEEXT_CKB_Left (0L << 0) | 15 #define FWL_STYLEEXT_CKB_Left (0L << 0) |
| 17 #define FWL_STYLEEXT_CKB_Center (1L << 0) | 16 #define FWL_STYLEEXT_CKB_Center (1L << 0) |
| 18 #define FWL_STYLEEXT_CKB_Right (2L << 0) | 17 #define FWL_STYLEEXT_CKB_Right (2L << 0) |
| 19 #define FWL_STYLEEXT_CKB_Top (0L << 2) | 18 #define FWL_STYLEEXT_CKB_Top (0L << 2) |
| 20 #define FWL_STYLEEXT_CKB_VCenter (1L << 2) | 19 #define FWL_STYLEEXT_CKB_VCenter (1L << 2) |
| 21 #define FWL_STYLEEXT_CKB_Bottom (2L << 2) | 20 #define FWL_STYLEEXT_CKB_Bottom (2L << 2) |
| 22 #define FWL_STYLEEXT_CKB_LeftText (1L << 4) | 21 #define FWL_STYLEEXT_CKB_LeftText (1L << 4) |
| 23 #define FWL_STYLEEXT_CKB_MultiLine (1L << 5) | 22 #define FWL_STYLEEXT_CKB_MultiLine (1L << 5) |
| 24 #define FWL_STYLEEXT_CKB_3State (1L << 6) | 23 #define FWL_STYLEEXT_CKB_3State (1L << 6) |
| 25 #define FWL_STYLEEXT_CKB_RadioButton (1L << 7) | 24 #define FWL_STYLEEXT_CKB_RadioButton (1L << 7) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 public: | 54 public: |
| 56 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; | 55 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; |
| 57 }; | 56 }; |
| 58 | 57 |
| 59 class IFWL_CheckBox : public IFWL_Widget { | 58 class IFWL_CheckBox : public IFWL_Widget { |
| 60 public: | 59 public: |
| 61 explicit IFWL_CheckBox(const CFWL_WidgetImpProperties& properties); | 60 explicit IFWL_CheckBox(const CFWL_WidgetImpProperties& properties); |
| 62 ~IFWL_CheckBox() override; | 61 ~IFWL_CheckBox() override; |
| 63 | 62 |
| 64 // IFWL_Widget | 63 // IFWL_Widget |
| 65 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
| 66 FWL_Type GetClassID() const override; | 64 FWL_Type GetClassID() const override; |
| 67 FWL_Error Initialize() override; | 65 FWL_Error Initialize() override; |
| 68 FWL_Error Finalize() override; | 66 void Finalize() override; |
| 69 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 67 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
| 70 FWL_Error Update() override; | 68 FWL_Error Update() override; |
| 71 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 69 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
| 72 const CFX_Matrix* pMatrix = nullptr) override; | 70 const CFX_Matrix* pMatrix = nullptr) override; |
| 73 int32_t GetCheckState(); | 71 int32_t GetCheckState(); |
| 74 FWL_Error SetCheckState(int32_t iCheck); | 72 FWL_Error SetCheckState(int32_t iCheck); |
| 75 | 73 |
| 76 protected: | 74 protected: |
| 77 friend class CFWL_CheckBoxImpDelegate; | 75 friend class CFWL_CheckBoxImpDelegate; |
| 78 | 76 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 104 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 102 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 105 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 103 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 106 void OnMouseMove(CFWL_MsgMouse* pMsg); | 104 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 107 void OnMouseLeave(CFWL_MsgMouse* pMsg); | 105 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
| 108 void OnKeyDown(CFWL_MsgKey* pMsg); | 106 void OnKeyDown(CFWL_MsgKey* pMsg); |
| 109 | 107 |
| 110 IFWL_CheckBox* m_pOwner; | 108 IFWL_CheckBox* m_pOwner; |
| 111 }; | 109 }; |
| 112 | 110 |
| 113 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_ | 111 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_ |
| OLD | NEW |