OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_ | |
8 #define XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_ | |
9 | |
10 #include <memory> | |
11 | |
12 #include "xfa/fwl/core/cfwl_event.h" | |
13 #include "xfa/fwl/core/ifwl_widget.h" | |
14 #include "xfa/fwl/lightwidget/cfwl_widgetproperties.h" | |
15 | |
16 class CFWL_Event; | |
17 class CFWL_Message; | |
18 class CFWL_Widget; | |
19 class CFWL_WidgetDelegate; | |
20 class CFWL_WidgetMgr; | |
21 | |
22 class CFWL_Widget { | |
23 public: | |
24 CFWL_Widget(); | |
25 virtual ~CFWL_Widget(); | |
26 | |
27 virtual IFWL_Widget* GetWidget(); | |
28 virtual const IFWL_Widget* GetWidget() const; | |
29 | |
30 FWL_Error GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | |
31 FWL_Error SetWidgetRect(const CFX_RectF& rect); | |
32 FWL_Error GetGlobalRect(CFX_RectF& rect); | |
33 FWL_Error GetClientRect(CFX_RectF& rtClient); | |
34 | |
35 FWL_Error ModifyStyles(uint32_t dwStylesAdded, uint32_t dwStylesRemoved); | |
36 uint32_t GetStylesEx(); | |
37 FWL_Error ModifyStylesEx(uint32_t dwStylesExAdded, | |
38 uint32_t dwStylesExRemoved); | |
39 | |
40 uint32_t GetStates(); | |
41 void SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); | |
42 | |
43 void SetLayoutItem(void* pItem); | |
44 | |
45 void Update(); | |
46 void LockUpdate(); | |
47 void UnlockUpdate(); | |
48 | |
49 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy); | |
50 | |
51 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | |
52 const CFX_Matrix* pMatrix = nullptr); | |
53 | |
54 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | |
55 | |
56 protected: | |
57 FWL_Error Initialize(const CFWL_WidgetProperties* pProperties = nullptr); | |
58 | |
59 std::unique_ptr<IFWL_Widget> m_pIface; | |
60 IFWL_WidgetDelegate* m_pDelegate; | |
61 CFWL_WidgetMgr* const m_pWidgetMgr; | |
62 std::unique_ptr<CFWL_WidgetProperties> m_pProperties; | |
63 }; | |
64 | |
65 #endif // XFA_FWL_LIGHTWIDGET_CFWL_WIDGET_H_ | |
OLD | NEW |