| 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_CFWL_WIDGET_H_ | 7 #ifndef XFA_FWL_CFWL_WIDGET_H_ |
| 8 #define XFA_FWL_CFWL_WIDGET_H_ | 8 #define XFA_FWL_CFWL_WIDGET_H_ |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 void Repaint(); | 114 void Repaint(); |
| 115 | 115 |
| 116 protected: | 116 protected: |
| 117 CFWL_Widget(const CFWL_App* app, | 117 CFWL_Widget(const CFWL_App* app, |
| 118 std::unique_ptr<CFWL_WidgetProperties> properties, | 118 std::unique_ptr<CFWL_WidgetProperties> properties, |
| 119 CFWL_Widget* pOuter); | 119 CFWL_Widget* pOuter); |
| 120 | 120 |
| 121 bool IsEnabled() const; | 121 bool IsEnabled() const; |
| 122 bool IsLocked() const { return m_iLock > 0; } | 122 bool IsLocked() const { return m_iLock > 0; } |
| 123 bool HasBorder() const; | 123 bool HasBorder() const; |
| 124 bool HasEdge() const; | |
| 125 CFX_RectF GetEdgeRect(); | 124 CFX_RectF GetEdgeRect(); |
| 126 FX_FLOAT GetBorderSize(bool bCX); | 125 FX_FLOAT GetBorderSize(bool bCX); |
| 127 FX_FLOAT GetEdgeWidth(); | |
| 128 CFX_RectF GetRelativeRect(); | 126 CFX_RectF GetRelativeRect(); |
| 129 void* GetThemeCapacity(CFWL_WidgetCapacity dwCapacity); | 127 void* GetThemeCapacity(CFWL_WidgetCapacity dwCapacity); |
| 130 IFWL_ThemeProvider* GetAvailableTheme(); | 128 IFWL_ThemeProvider* GetAvailableTheme(); |
| 131 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, | 129 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, |
| 132 IFWL_ThemeProvider* pTheme, | 130 IFWL_ThemeProvider* pTheme, |
| 133 bool bMultiLine); | 131 bool bMultiLine); |
| 134 void CalcTextRect(const CFX_WideString& wsText, | 132 void CalcTextRect(const CFX_WideString& wsText, |
| 135 IFWL_ThemeProvider* pTheme, | 133 IFWL_ThemeProvider* pTheme, |
| 136 uint32_t dwTTOStyles, | 134 uint32_t dwTTOStyles, |
| 137 int32_t iTTOAlign, | 135 int32_t iTTOAlign, |
| 138 CFX_RectF& rect); | 136 CFX_RectF& rect); |
| 139 void SetGrab(bool bSet); | 137 void SetGrab(bool bSet); |
| 140 void GetPopupPos(FX_FLOAT fMinHeight, | 138 void GetPopupPos(FX_FLOAT fMinHeight, |
| 141 FX_FLOAT fMaxHeight, | 139 FX_FLOAT fMaxHeight, |
| 142 const CFX_RectF& rtAnchor, | 140 const CFX_RectF& rtAnchor, |
| 143 CFX_RectF& rtPopup); | 141 CFX_RectF& rtPopup); |
| 144 void RegisterEventTarget(CFWL_Widget* pEventSource); | 142 void RegisterEventTarget(CFWL_Widget* pEventSource); |
| 145 void UnregisterEventTarget(); | 143 void UnregisterEventTarget(); |
| 146 void DispatchEvent(CFWL_Event* pEvent); | 144 void DispatchEvent(CFWL_Event* pEvent); |
| 147 void DrawBorder(CFX_Graphics* pGraphics, | 145 void DrawBorder(CFX_Graphics* pGraphics, |
| 148 CFWL_Part iPartBorder, | 146 CFWL_Part iPartBorder, |
| 149 IFWL_ThemeProvider* pTheme, | 147 IFWL_ThemeProvider* pTheme, |
| 150 const CFX_Matrix* pMatrix); | 148 const CFX_Matrix* pMatrix); |
| 151 void DrawEdge(CFX_Graphics* pGraphics, | |
| 152 CFWL_Part iPartEdge, | |
| 153 IFWL_ThemeProvider* pTheme, | |
| 154 const CFX_Matrix* pMatrix); | |
| 155 | 149 |
| 156 const CFWL_App* const m_pOwnerApp; | 150 const CFWL_App* const m_pOwnerApp; |
| 157 CFWL_WidgetMgr* const m_pWidgetMgr; | 151 CFWL_WidgetMgr* const m_pWidgetMgr; |
| 158 std::unique_ptr<CFWL_WidgetProperties> m_pProperties; | 152 std::unique_ptr<CFWL_WidgetProperties> m_pProperties; |
| 159 CFWL_Widget* m_pOuter; | 153 CFWL_Widget* m_pOuter; |
| 160 int32_t m_iLock; | 154 int32_t m_iLock; |
| 161 | 155 |
| 162 private: | 156 private: |
| 163 CFWL_Widget* GetParent() { return m_pWidgetMgr->GetParentWidget(this); } | 157 CFWL_Widget* GetParent() { return m_pWidgetMgr->GetParentWidget(this); } |
| 164 CFX_SizeF GetOffsetFromParent(CFWL_Widget* pParent); | 158 CFX_SizeF GetOffsetFromParent(CFWL_Widget* pParent); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 188 const CFX_Matrix* pMatrix); | 182 const CFX_Matrix* pMatrix); |
| 189 void NotifyDriver(); | 183 void NotifyDriver(); |
| 190 bool IsParent(CFWL_Widget* pParent); | 184 bool IsParent(CFWL_Widget* pParent); |
| 191 | 185 |
| 192 CXFA_FFWidget* m_pLayoutItem; | 186 CXFA_FFWidget* m_pLayoutItem; |
| 193 uint32_t m_nEventKey; | 187 uint32_t m_nEventKey; |
| 194 IFWL_WidgetDelegate* m_pDelegate; // Not owned. | 188 IFWL_WidgetDelegate* m_pDelegate; // Not owned. |
| 195 }; | 189 }; |
| 196 | 190 |
| 197 #endif // XFA_FWL_CFWL_WIDGET_H_ | 191 #endif // XFA_FWL_CFWL_WIDGET_H_ |
| OLD | NEW |