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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, CFWL_EventType::CheckStateChanged) | 50 FWL_EVENT_DEF(CFWL_EvtCkbCheckStateChanged, CFWL_EventType::CheckStateChanged) |
51 | 51 |
52 class IFWL_CheckBoxDP : public IFWL_DataProvider { | 52 class IFWL_CheckBoxDP : public IFWL_DataProvider { |
53 public: | 53 public: |
54 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; | 54 virtual FX_FLOAT GetBoxSize(IFWL_Widget* pWidget) = 0; |
55 }; | 55 }; |
56 | 56 |
57 class IFWL_CheckBox : public IFWL_Widget { | 57 class IFWL_CheckBox : public IFWL_Widget { |
58 public: | 58 public: |
59 explicit IFWL_CheckBox(const IFWL_App* app, | 59 IFWL_CheckBox(const IFWL_App* app, |
60 std::unique_ptr<CFWL_WidgetProperties> properties); | 60 std::unique_ptr<CFWL_WidgetProperties> properties); |
61 ~IFWL_CheckBox() override; | 61 ~IFWL_CheckBox() override; |
62 | 62 |
63 // IFWL_Widget | 63 // IFWL_Widget |
64 FWL_Type GetClassID() const override; | 64 FWL_Type GetClassID() const override; |
65 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 65 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
66 void Update() override; | 66 void Update() override; |
67 void DrawWidget(CFX_Graphics* pGraphics, | 67 void DrawWidget(CFX_Graphics* pGraphics, |
68 const CFX_Matrix* pMatrix = nullptr) override; | 68 const CFX_Matrix* pMatrix = nullptr) override; |
69 | 69 |
70 void OnProcessMessage(CFWL_Message* pMessage) override; | 70 void OnProcessMessage(CFWL_Message* pMessage) override; |
71 void OnDrawWidget(CFX_Graphics* pGraphics, | 71 void OnDrawWidget(CFX_Graphics* pGraphics, |
72 const CFX_Matrix* pMatrix) override; | 72 const CFX_Matrix* pMatrix) override; |
73 | 73 |
74 int32_t GetCheckState(); | 74 private: |
75 FWL_Error SetCheckState(int32_t iCheck); | 75 void SetCheckState(int32_t iCheck); |
76 | |
77 protected: | |
78 void Layout(); | 76 void Layout(); |
79 uint32_t GetPartStates(); | 77 uint32_t GetPartStates(); |
80 void UpdateTextOutStyles(); | 78 void UpdateTextOutStyles(); |
81 void NextStates(); | 79 void NextStates(); |
| 80 void OnActivate(CFWL_Message* pMsg); |
| 81 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); |
| 82 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
| 83 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
| 84 void OnMouseMove(CFWL_MsgMouse* pMsg); |
| 85 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
| 86 void OnKeyDown(CFWL_MsgKey* pMsg); |
82 | 87 |
83 CFX_RectF m_rtClient; | 88 CFX_RectF m_rtClient; |
84 CFX_RectF m_rtBox; | 89 CFX_RectF m_rtBox; |
85 CFX_RectF m_rtCaption; | 90 CFX_RectF m_rtCaption; |
86 CFX_RectF m_rtFocus; | 91 CFX_RectF m_rtFocus; |
87 uint32_t m_dwTTOStyles; | 92 uint32_t m_dwTTOStyles; |
88 int32_t m_iTTOAlign; | 93 int32_t m_iTTOAlign; |
89 bool m_bBtnDown; | 94 bool m_bBtnDown; |
90 | |
91 private: | |
92 void OnActivate(CFWL_Message* pMsg); | |
93 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); | |
94 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
95 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
96 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
97 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
98 void OnKeyDown(CFWL_MsgKey* pMsg); | |
99 }; | 95 }; |
100 | 96 |
101 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_ | 97 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_ |
OLD | NEW |