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 _FWL_WIDGET_LIGHT_H | 7 #ifndef _FWL_WIDGET_LIGHT_H |
8 #define _FWL_WIDGET_LIGHT_H | 8 #define _FWL_WIDGET_LIGHT_H |
9 | 9 |
10 #include "xfa/include/fwl/core/fwl_widget.h" | 10 #include "xfa/include/fwl/core/fwl_widget.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 CFX_RectF m_rtWidget; | 34 CFX_RectF m_rtWidget; |
35 FX_DWORD m_dwStyles; | 35 FX_DWORD m_dwStyles; |
36 FX_DWORD m_dwStyleExes; | 36 FX_DWORD m_dwStyleExes; |
37 FX_DWORD m_dwStates; | 37 FX_DWORD m_dwStates; |
38 CFWL_Widget* m_pParent; | 38 CFWL_Widget* m_pParent; |
39 CFWL_Widget* m_pOwner; | 39 CFWL_Widget* m_pOwner; |
40 }; | 40 }; |
41 | 41 |
42 class CFWL_Widget { | 42 class CFWL_Widget { |
43 public: | 43 public: |
| 44 virtual ~CFWL_Widget(); |
44 IFWL_Widget* GetWidget(); | 45 IFWL_Widget* GetWidget(); |
45 FX_DWORD Release(); | |
46 CFWL_Widget* Retain(); | |
47 FX_DWORD GetRefCount() const; | |
48 FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 46 FWL_ERR GetClassName(CFX_WideString& wsClass) const; |
49 FX_DWORD GetClassID() const; | 47 FX_DWORD GetClassID() const; |
50 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; | 48 virtual FX_BOOL IsInstance(const CFX_WideStringC& wsClass) const; |
51 | 49 |
52 protected: | 50 protected: |
53 FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); | 51 FWL_ERR Initialize(const CFWL_WidgetProperties* pProperties = NULL); |
54 | 52 |
55 public: | 53 public: |
56 FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 54 FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
57 FWL_ERR GetGlobalRect(CFX_RectF& rect); | 55 FWL_ERR GetGlobalRect(CFX_RectF& rect); |
(...skipping 20 matching lines...) Expand all Loading... |
78 FWL_ERR TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 76 FWL_ERR TransformTo(CFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); |
79 FWL_ERR TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt); | 77 FWL_ERR TransformTo(CFWL_Widget* pWidget, CFX_RectF& rt); |
80 FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 78 FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
81 FWL_ERR SetMatrix(const CFX_Matrix& matrix); | 79 FWL_ERR SetMatrix(const CFX_Matrix& matrix); |
82 FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); | 80 FWL_ERR DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix = NULL); |
83 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 81 IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
84 FWL_ERR Repaint(const CFX_RectF* pRect = NULL); | 82 FWL_ERR Repaint(const CFX_RectF* pRect = NULL); |
85 FWL_ERR SetFocus(FX_BOOL bFocus); | 83 FWL_ERR SetFocus(FX_BOOL bFocus); |
86 FWL_ERR SetGrab(FX_BOOL bSet); | 84 FWL_ERR SetGrab(FX_BOOL bSet); |
87 CFWL_Widget(); | 85 CFWL_Widget(); |
88 virtual ~CFWL_Widget(); | 86 |
89 void RegisterEventTarget(CFWL_Widget* pEventSource = NULL, | 87 void RegisterEventTarget(CFWL_Widget* pEventSource = NULL, |
90 FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); | 88 FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); |
91 void DispatchEvent(CFWL_Event* pEvent); | 89 void DispatchEvent(CFWL_Event* pEvent); |
92 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, | 90 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, |
93 FX_BOOL bMultiLine = FALSE, | 91 FX_BOOL bMultiLine = FALSE, |
94 int32_t iLineWidth = -1); | 92 int32_t iLineWidth = -1); |
95 IFWL_Widget* m_pIface; | 93 IFWL_Widget* m_pIface; |
96 IFWL_WidgetDelegate* m_pDelegate; | 94 IFWL_WidgetDelegate* m_pDelegate; |
97 CFWL_WidgetMgr* m_pWidgetMgr; | 95 CFWL_WidgetMgr* m_pWidgetMgr; |
98 CFWL_WidgetProperties* m_pProperties; | 96 CFWL_WidgetProperties* m_pProperties; |
99 }; | 97 }; |
100 class CFWL_WidgetDelegate { | 98 class CFWL_WidgetDelegate { |
101 public: | 99 public: |
102 CFWL_WidgetDelegate(); | 100 CFWL_WidgetDelegate(); |
103 virtual ~CFWL_WidgetDelegate(); | 101 virtual ~CFWL_WidgetDelegate(); |
104 virtual int32_t OnProcessMessage(CFWL_Message* pMessage); | 102 virtual int32_t OnProcessMessage(CFWL_Message* pMessage); |
105 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); | 103 virtual FWL_ERR OnProcessEvent(CFWL_Event* pEvent); |
106 virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 104 virtual FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
107 const CFX_Matrix* pMatrix = NULL); | 105 const CFX_Matrix* pMatrix = NULL); |
108 }; | 106 }; |
109 #endif | 107 #endif |
OLD | NEW |