Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: xfa/fwl/core/ifwl_checkbox.h

Issue 2469893004: Unify CFWL_WidgetProperties and CFWL_WidgetImpProperties. (Closed)
Patch Set: review cleanup Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/core/ifwl_caret.cpp ('k') | xfa/fwl/core/ifwl_checkbox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_widgetproperties.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_STYLEEXT_CKB_Left (0L << 0) 15 #define FWL_STYLEEXT_CKB_Left (0L << 0)
16 #define FWL_STYLEEXT_CKB_Center (1L << 0) 16 #define FWL_STYLEEXT_CKB_Center (1L << 0)
17 #define FWL_STYLEEXT_CKB_Right (2L << 0) 17 #define FWL_STYLEEXT_CKB_Right (2L << 0)
18 #define FWL_STYLEEXT_CKB_Top (0L << 2) 18 #define FWL_STYLEEXT_CKB_Top (0L << 2)
19 #define FWL_STYLEEXT_CKB_VCenter (1L << 2) 19 #define FWL_STYLEEXT_CKB_VCenter (1L << 2)
20 #define FWL_STYLEEXT_CKB_Bottom (2L << 2) 20 #define FWL_STYLEEXT_CKB_Bottom (2L << 2)
21 #define FWL_STYLEEXT_CKB_LeftText (1L << 4) 21 #define FWL_STYLEEXT_CKB_LeftText (1L << 4)
(...skipping 15 matching lines...) Expand all
37 #define FWL_STYLEEXT_CKB_ShapeMask (3L << 8) 37 #define FWL_STYLEEXT_CKB_ShapeMask (3L << 8)
38 #define FWL_STYLEEXT_CKB_SignShapeMask (7L << 10) 38 #define FWL_STYLEEXT_CKB_SignShapeMask (7L << 10)
39 #define FWL_STATE_CKB_Hovered (1 << FWL_WGTSTATE_MAX) 39 #define FWL_STATE_CKB_Hovered (1 << FWL_WGTSTATE_MAX)
40 #define FWL_STATE_CKB_Pressed (1 << (FWL_WGTSTATE_MAX + 1)) 40 #define FWL_STATE_CKB_Pressed (1 << (FWL_WGTSTATE_MAX + 1))
41 #define FWL_STATE_CKB_Unchecked (0 << (FWL_WGTSTATE_MAX + 2)) 41 #define FWL_STATE_CKB_Unchecked (0 << (FWL_WGTSTATE_MAX + 2))
42 #define FWL_STATE_CKB_Checked (1 << (FWL_WGTSTATE_MAX + 2)) 42 #define FWL_STATE_CKB_Checked (1 << (FWL_WGTSTATE_MAX + 2))
43 #define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2)) 43 #define FWL_STATE_CKB_Neutral (2 << (FWL_WGTSTATE_MAX + 2))
44 #define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2)) 44 #define FWL_STATE_CKB_CheckMask (3L << (FWL_WGTSTATE_MAX + 2))
45 45
46 class CFWL_MsgMouse; 46 class CFWL_MsgMouse;
47 class CFWL_WidgetImpProperties; 47 class CFWL_WidgetProperties;
48 class IFWL_Widget; 48 class IFWL_Widget;
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 explicit IFWL_CheckBox(const IFWL_App* app,
60 const CFWL_WidgetImpProperties& 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 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; 65 FWL_Error GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override;
66 FWL_Error Update() override; 66 FWL_Error Update() override;
67 FWL_Error DrawWidget(CFX_Graphics* pGraphics, 67 FWL_Error 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;
(...skipping 21 matching lines...) Expand all
92 void OnActivate(CFWL_Message* pMsg); 92 void OnActivate(CFWL_Message* pMsg);
93 void OnFocusChanged(CFWL_Message* pMsg, bool bSet); 93 void OnFocusChanged(CFWL_Message* pMsg, bool bSet);
94 void OnLButtonDown(CFWL_MsgMouse* pMsg); 94 void OnLButtonDown(CFWL_MsgMouse* pMsg);
95 void OnLButtonUp(CFWL_MsgMouse* pMsg); 95 void OnLButtonUp(CFWL_MsgMouse* pMsg);
96 void OnMouseMove(CFWL_MsgMouse* pMsg); 96 void OnMouseMove(CFWL_MsgMouse* pMsg);
97 void OnMouseLeave(CFWL_MsgMouse* pMsg); 97 void OnMouseLeave(CFWL_MsgMouse* pMsg);
98 void OnKeyDown(CFWL_MsgKey* pMsg); 98 void OnKeyDown(CFWL_MsgKey* pMsg);
99 }; 99 };
100 100
101 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_ 101 #endif // XFA_FWL_CORE_IFWL_CHECKBOX_H_
OLDNEW
« no previous file with comments | « xfa/fwl/core/ifwl_caret.cpp ('k') | xfa/fwl/core/ifwl_checkbox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698