| 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_FWL_WIDGETIMP_H_ | 7 #ifndef XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
| 8 #define XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 8 #define XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
| 9 | 9 |
| 10 #include "core/fxcrt/include/fx_coordinates.h" | 10 #include "core/fxcrt/include/fx_coordinates.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); | 30 virtual FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE); |
| 31 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); | 31 virtual FWL_ERR GetGlobalRect(CFX_RectF& rect); |
| 32 virtual FWL_ERR SetWidgetRect(const CFX_RectF& rect); | 32 virtual FWL_ERR SetWidgetRect(const CFX_RectF& rect); |
| 33 virtual FWL_ERR GetClientRect(CFX_RectF& rect); | 33 virtual FWL_ERR GetClientRect(CFX_RectF& rect); |
| 34 virtual IFWL_Widget* GetParent(); | 34 virtual IFWL_Widget* GetParent(); |
| 35 virtual FWL_ERR SetParent(IFWL_Widget* pParent); | 35 virtual FWL_ERR SetParent(IFWL_Widget* pParent); |
| 36 virtual IFWL_Widget* GetOwner(); | 36 virtual IFWL_Widget* GetOwner(); |
| 37 virtual FWL_ERR SetOwner(IFWL_Widget* pOwner); | 37 virtual FWL_ERR SetOwner(IFWL_Widget* pOwner); |
| 38 virtual IFWL_Widget* GetOuter(); | 38 virtual IFWL_Widget* GetOuter(); |
| 39 virtual FX_DWORD GetStyles(); | 39 virtual uint32_t GetStyles(); |
| 40 virtual FWL_ERR ModifyStyles(FX_DWORD dwStylesAdded, | 40 virtual FWL_ERR ModifyStyles(uint32_t dwStylesAdded, |
| 41 FX_DWORD dwStylesRemoved); | 41 uint32_t dwStylesRemoved); |
| 42 virtual FX_DWORD GetStylesEx(); | 42 virtual uint32_t GetStylesEx(); |
| 43 virtual FWL_ERR ModifyStylesEx(FX_DWORD dwStylesExAdded, | 43 virtual FWL_ERR ModifyStylesEx(uint32_t dwStylesExAdded, |
| 44 FX_DWORD dwStylesExRemoved); | 44 uint32_t dwStylesExRemoved); |
| 45 virtual FX_DWORD GetStates(); | 45 virtual uint32_t GetStates(); |
| 46 virtual FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE); | 46 virtual FWL_ERR SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE); |
| 47 virtual FWL_ERR SetPrivateData(void* module_id, | 47 virtual FWL_ERR SetPrivateData(void* module_id, |
| 48 void* pData, | 48 void* pData, |
| 49 PD_CALLBACK_FREEDATA callback); | 49 PD_CALLBACK_FREEDATA callback); |
| 50 virtual void* GetPrivateData(void* module_id); | 50 virtual void* GetPrivateData(void* module_id); |
| 51 virtual FWL_ERR Update(); | 51 virtual FWL_ERR Update(); |
| 52 virtual FWL_ERR LockUpdate(); | 52 virtual FWL_ERR LockUpdate(); |
| 53 virtual FWL_ERR UnlockUpdate(); | 53 virtual FWL_ERR UnlockUpdate(); |
| 54 virtual FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy); | 54 virtual uint32_t HitTest(FX_FLOAT fx, FX_FLOAT fy); |
| 55 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); | 55 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, FX_FLOAT& fx, FX_FLOAT& fy); |
| 56 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); | 56 virtual FWL_ERR TransformTo(IFWL_Widget* pWidget, CFX_RectF& rt); |
| 57 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); | 57 virtual FWL_ERR GetMatrix(CFX_Matrix& matrix, FX_BOOL bGlobal = FALSE); |
| 58 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); | 58 virtual FWL_ERR SetMatrix(const CFX_Matrix& matrix); |
| 59 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 59 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
| 60 const CFX_Matrix* pMatrix = NULL); | 60 const CFX_Matrix* pMatrix = NULL); |
| 61 virtual IFWL_ThemeProvider* GetThemeProvider(); | 61 virtual IFWL_ThemeProvider* GetThemeProvider(); |
| 62 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); | 62 virtual FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider); |
| 63 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); | 63 virtual FWL_ERR SetDataProvider(IFWL_DataProvider* pDataProvider); |
| 64 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); | 64 virtual IFWL_WidgetDelegate* SetDelegate(IFWL_WidgetDelegate* pDelegate); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 79 FX_BOOL IsPopup() const; | 79 FX_BOOL IsPopup() const; |
| 80 FX_BOOL IsChild() const; | 80 FX_BOOL IsChild() const; |
| 81 FX_BOOL IsLocked() const; | 81 FX_BOOL IsLocked() const; |
| 82 FX_BOOL IsOffscreen() const; | 82 FX_BOOL IsOffscreen() const; |
| 83 FX_BOOL HasBorder() const; | 83 FX_BOOL HasBorder() const; |
| 84 FX_BOOL HasEdge() const; | 84 FX_BOOL HasEdge() const; |
| 85 void GetEdgeRect(CFX_RectF& rtEdge); | 85 void GetEdgeRect(CFX_RectF& rtEdge); |
| 86 FX_FLOAT GetBorderSize(FX_BOOL bCX = TRUE); | 86 FX_FLOAT GetBorderSize(FX_BOOL bCX = TRUE); |
| 87 FX_FLOAT GetEdgeWidth(); | 87 FX_FLOAT GetEdgeWidth(); |
| 88 void GetRelativeRect(CFX_RectF& rect); | 88 void GetRelativeRect(CFX_RectF& rect); |
| 89 void* GetThemeCapacity(FX_DWORD dwCapacity); | 89 void* GetThemeCapacity(uint32_t dwCapacity); |
| 90 IFWL_ThemeProvider* GetAvailableTheme(); | 90 IFWL_ThemeProvider* GetAvailableTheme(); |
| 91 CFWL_WidgetImp* GetRootOuter(); | 91 CFWL_WidgetImp* GetRootOuter(); |
| 92 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, | 92 CFX_SizeF CalcTextSize(const CFX_WideString& wsText, |
| 93 IFWL_ThemeProvider* pTheme, | 93 IFWL_ThemeProvider* pTheme, |
| 94 FX_BOOL bMultiLine = FALSE, | 94 FX_BOOL bMultiLine = FALSE, |
| 95 int32_t iLineWidth = -1); | 95 int32_t iLineWidth = -1); |
| 96 void CalcTextRect(const CFX_WideString& wsText, | 96 void CalcTextRect(const CFX_WideString& wsText, |
| 97 IFWL_ThemeProvider* pTheme, | 97 IFWL_ThemeProvider* pTheme, |
| 98 FX_DWORD dwTTOStyles, | 98 uint32_t dwTTOStyles, |
| 99 int32_t iTTOAlign, | 99 int32_t iTTOAlign, |
| 100 CFX_RectF& rect); | 100 CFX_RectF& rect); |
| 101 void SetFocus(FX_BOOL bFocus); | 101 void SetFocus(FX_BOOL bFocus); |
| 102 void SetGrab(FX_BOOL bSet); | 102 void SetGrab(FX_BOOL bSet); |
| 103 FX_BOOL GetPopupPos(FX_FLOAT fMinHeight, | 103 FX_BOOL GetPopupPos(FX_FLOAT fMinHeight, |
| 104 FX_FLOAT fMaxHeight, | 104 FX_FLOAT fMaxHeight, |
| 105 const CFX_RectF& rtAnchor, | 105 const CFX_RectF& rtAnchor, |
| 106 CFX_RectF& rtPopup); | 106 CFX_RectF& rtPopup); |
| 107 FX_BOOL GetPopupPosMenu(FX_FLOAT fMinHeight, | 107 FX_BOOL GetPopupPosMenu(FX_FLOAT fMinHeight, |
| 108 FX_FLOAT fMaxHeight, | 108 FX_FLOAT fMaxHeight, |
| 109 const CFX_RectF& rtAnchor, | 109 const CFX_RectF& rtAnchor, |
| 110 CFX_RectF& rtPopup); | 110 CFX_RectF& rtPopup); |
| 111 FX_BOOL GetPopupPosComboBox(FX_FLOAT fMinHeight, | 111 FX_BOOL GetPopupPosComboBox(FX_FLOAT fMinHeight, |
| 112 FX_FLOAT fMaxHeight, | 112 FX_FLOAT fMaxHeight, |
| 113 const CFX_RectF& rtAnchor, | 113 const CFX_RectF& rtAnchor, |
| 114 CFX_RectF& rtPopup); | 114 CFX_RectF& rtPopup); |
| 115 FX_BOOL GetPopupPosGeneral(FX_FLOAT fMinHeight, | 115 FX_BOOL GetPopupPosGeneral(FX_FLOAT fMinHeight, |
| 116 FX_FLOAT fMaxHeight, | 116 FX_FLOAT fMaxHeight, |
| 117 const CFX_RectF& rtAnchor, | 117 const CFX_RectF& rtAnchor, |
| 118 CFX_RectF& rtPopup); | 118 CFX_RectF& rtPopup); |
| 119 FX_BOOL GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy); | 119 FX_BOOL GetScreenSize(FX_FLOAT& fx, FX_FLOAT& fy); |
| 120 void RegisterEventTarget(IFWL_Widget* pEventSource = NULL, | 120 void RegisterEventTarget(IFWL_Widget* pEventSource = NULL, |
| 121 FX_DWORD dwFilter = FWL_EVENT_ALL_MASK); | 121 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
| 122 void UnregisterEventTarget(); | 122 void UnregisterEventTarget(); |
| 123 void DispatchKeyEvent(CFWL_MsgKey* pNote); | 123 void DispatchKeyEvent(CFWL_MsgKey* pNote); |
| 124 void DispatchEvent(CFWL_Event* pEvent); | 124 void DispatchEvent(CFWL_Event* pEvent); |
| 125 void Repaint(const CFX_RectF* pRect = NULL); | 125 void Repaint(const CFX_RectF* pRect = NULL); |
| 126 void DrawBackground(CFX_Graphics* pGraphics, | 126 void DrawBackground(CFX_Graphics* pGraphics, |
| 127 int32_t iPartBk, | 127 int32_t iPartBk, |
| 128 IFWL_ThemeProvider* pTheme, | 128 IFWL_ThemeProvider* pTheme, |
| 129 const CFX_Matrix* pMatrix = NULL); | 129 const CFX_Matrix* pMatrix = NULL); |
| 130 void DrawBorder(CFX_Graphics* pGraphics, | 130 void DrawBorder(CFX_Graphics* pGraphics, |
| 131 int32_t iPartBorder, | 131 int32_t iPartBorder, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 142 CFWL_NoteThreadImp* m_pOwnerThread; | 142 CFWL_NoteThreadImp* m_pOwnerThread; |
| 143 CFWL_WidgetImpProperties* m_pProperties; | 143 CFWL_WidgetImpProperties* m_pProperties; |
| 144 CFX_PrivateData* m_pPrivateData; | 144 CFX_PrivateData* m_pPrivateData; |
| 145 IFWL_WidgetDelegate* m_pDelegate; | 145 IFWL_WidgetDelegate* m_pDelegate; |
| 146 IFWL_WidgetDelegate* m_pCurDelegate; | 146 IFWL_WidgetDelegate* m_pCurDelegate; |
| 147 IFWL_Widget* m_pOuter; | 147 IFWL_Widget* m_pOuter; |
| 148 IFWL_Widget* m_pInterface; | 148 IFWL_Widget* m_pInterface; |
| 149 int32_t m_iLock; | 149 int32_t m_iLock; |
| 150 friend class CFWL_WidgetImpDelegate; | 150 friend class CFWL_WidgetImpDelegate; |
| 151 friend void FWL_SetWidgetRect(IFWL_Widget* widget, const CFX_RectF& rect); | 151 friend void FWL_SetWidgetRect(IFWL_Widget* widget, const CFX_RectF& rect); |
| 152 friend void FWL_SetWidgetStates(IFWL_Widget* widget, FX_DWORD dwStates); | 152 friend void FWL_SetWidgetStates(IFWL_Widget* widget, uint32_t dwStates); |
| 153 friend void FWL_SetWidgetStyles(IFWL_Widget* widget, FX_DWORD dwStyles); | 153 friend void FWL_SetWidgetStyles(IFWL_Widget* widget, uint32_t dwStyles); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { | 156 class CFWL_WidgetImpDelegate : public IFWL_WidgetDelegate { |
| 157 public: | 157 public: |
| 158 CFWL_WidgetImpDelegate(); | 158 CFWL_WidgetImpDelegate(); |
| 159 ~CFWL_WidgetImpDelegate() override {} | 159 ~CFWL_WidgetImpDelegate() override {} |
| 160 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 160 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
| 161 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | 161 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; |
| 162 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 162 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
| 163 const CFX_Matrix* pMatrix = NULL) override; | 163 const CFX_Matrix* pMatrix = NULL) override; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ | 166 #endif // XFA_FWL_CORE_FWL_WIDGETIMP_H_ |
| OLD | NEW |