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_IFWL_FORM_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_FORM_H_ |
8 #define XFA_FWL_CORE_IFWL_FORM_H_ | 8 #define XFA_FWL_CORE_IFWL_FORM_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; | 94 void GetWidgetRect(CFX_RectF& rect, bool bAutoSize = false) override; |
95 void GetClientRect(CFX_RectF& rect) override; | 95 void GetClientRect(CFX_RectF& rect) override; |
96 void Update() override; | 96 void Update() override; |
97 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 97 FWL_WidgetHit HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
98 void DrawWidget(CFX_Graphics* pGraphics, | 98 void DrawWidget(CFX_Graphics* pGraphics, |
99 const CFX_Matrix* pMatrix = nullptr) override; | 99 const CFX_Matrix* pMatrix = nullptr) override; |
100 void OnProcessMessage(CFWL_Message* pMessage) override; | 100 void OnProcessMessage(CFWL_Message* pMessage) override; |
101 void OnDrawWidget(CFX_Graphics* pGraphics, | 101 void OnDrawWidget(CFX_Graphics* pGraphics, |
102 const CFX_Matrix* pMatrix) override; | 102 const CFX_Matrix* pMatrix) override; |
103 | 103 |
104 FWL_FORMSIZE GetFormSize(); | |
105 FWL_Error SetFormSize(FWL_FORMSIZE eFormSize); | |
106 IFWL_Widget* DoModal(); | 104 IFWL_Widget* DoModal(); |
107 IFWL_Widget* DoModal(uint32_t& dwCommandID); | 105 void EndDoModal(); |
108 FWL_Error EndDoModal(); | 106 |
109 FWL_Error SetBorderRegion(CFX_Path* pPath); | 107 IFWL_Widget* GetSubFocus() const { return m_pSubFocus; } |
| 108 void SetSubFocus(IFWL_Widget* pWidget) { m_pSubFocus = pWidget; } |
| 109 |
| 110 private: |
110 void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); | 111 void DrawBackground(CFX_Graphics* pGraphics, IFWL_ThemeProvider* pTheme); |
111 IFWL_Widget* GetSubFocus(); | |
112 void SetSubFocus(IFWL_Widget* pWidget); | |
113 | |
114 protected: | |
115 friend class CFWL_FormImpDelegate; | |
116 | |
117 void ShowChildWidget(IFWL_Widget* pParent); | |
118 void RemoveSysButtons(); | 112 void RemoveSysButtons(); |
119 void CalcContentRect(CFX_RectF& rtContent); | |
120 CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy); | 113 CFWL_SysBtn* GetSysBtnAtPoint(FX_FLOAT fx, FX_FLOAT fy); |
121 CFWL_SysBtn* GetSysBtnByState(uint32_t dwState); | 114 CFWL_SysBtn* GetSysBtnByState(uint32_t dwState); |
122 CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex); | 115 CFWL_SysBtn* GetSysBtnByIndex(int32_t nIndex); |
123 int32_t GetSysBtnIndex(CFWL_SysBtn* pBtn); | 116 int32_t GetSysBtnIndex(CFWL_SysBtn* pBtn); |
124 FX_FLOAT GetCaptionHeight(); | 117 FX_FLOAT GetCaptionHeight(); |
125 void DrawCaptionText(CFX_Graphics* pGs, | 118 void DrawCaptionText(CFX_Graphics* pGs, |
126 IFWL_ThemeProvider* pTheme, | 119 IFWL_ThemeProvider* pTheme, |
127 const CFX_Matrix* pMatrix = nullptr); | 120 const CFX_Matrix* pMatrix = nullptr); |
128 void DrawIconImage(CFX_Graphics* pGs, | 121 void DrawIconImage(CFX_Graphics* pGs, |
129 IFWL_ThemeProvider* pTheme, | 122 IFWL_ThemeProvider* pTheme, |
130 const CFX_Matrix* pMatrix = nullptr); | 123 const CFX_Matrix* pMatrix = nullptr); |
131 void GetEdgeRect(CFX_RectF& rtEdge); | 124 void GetEdgeRect(CFX_RectF& rtEdge); |
132 void SetWorkAreaRect(); | 125 void SetWorkAreaRect(); |
133 void SetCursor(FX_FLOAT fx, FX_FLOAT fy); | |
134 void Layout(); | 126 void Layout(); |
135 void ReSetSysBtn(); | 127 void ResetSysBtn(); |
136 void RegisterForm(); | 128 void RegisterForm(); |
137 void UnRegisterForm(); | 129 void UnRegisterForm(); |
138 bool IsDoModal(); | |
139 void SetThemeData(); | 130 void SetThemeData(); |
140 bool HasIcon(); | 131 bool HasIcon(); |
141 void UpdateIcon(); | 132 void UpdateIcon(); |
142 void UpdateCaption(); | 133 void UpdateCaption(); |
143 void DoWidthLimit(FX_FLOAT& fLeft, | 134 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
144 FX_FLOAT& fWidth, | 135 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
145 FX_FLOAT fCurX, | 136 void OnMouseMove(CFWL_MsgMouse* pMsg); |
146 FX_FLOAT fSpace, | 137 void OnMouseLeave(CFWL_MsgMouse* pMsg); |
147 FX_FLOAT fLimitMin, | 138 void OnLButtonDblClk(CFWL_MsgMouse* pMsg); |
148 FX_FLOAT fLimitMax, | 139 void OnWindowMove(CFWL_MsgWindowMove* pMsg); |
149 bool bLeft); | 140 void OnClose(CFWL_MsgClose* pMsg); |
150 void DoHeightLimit(FX_FLOAT& fTop, | |
151 FX_FLOAT& fHeight, | |
152 FX_FLOAT fCurY, | |
153 FX_FLOAT fSpace, | |
154 FX_FLOAT fLimitMin, | |
155 FX_FLOAT fLimitMax, | |
156 bool bTop); | |
157 | 141 |
| 142 #if (_FX_OS_ == _FX_MACOSX_) |
| 143 bool m_bMouseIn; |
| 144 #endif |
158 CFX_RectF m_rtRestore; | 145 CFX_RectF m_rtRestore; |
159 CFX_RectF m_rtCaptionText; | 146 CFX_RectF m_rtCaptionText; |
160 CFX_RectF m_rtRelative; | 147 CFX_RectF m_rtRelative; |
161 CFX_RectF m_rtCaption; | 148 CFX_RectF m_rtCaption; |
162 CFX_RectF m_rtIcon; | 149 CFX_RectF m_rtIcon; |
163 CFWL_SysBtn* m_pCloseBox; | 150 CFWL_SysBtn* m_pCloseBox; |
164 CFWL_SysBtn* m_pMinBox; | 151 CFWL_SysBtn* m_pMinBox; |
165 CFWL_SysBtn* m_pMaxBox; | 152 CFWL_SysBtn* m_pMaxBox; |
166 CFWL_SysBtn* m_pCaptionBox; | 153 CFWL_SysBtn* m_pCaptionBox; |
167 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; | 154 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; |
168 IFWL_Widget* m_pSubFocus; | 155 IFWL_Widget* m_pSubFocus; |
169 RestoreInfo m_InfoStart; | 156 RestoreInfo m_InfoStart; |
170 FX_FLOAT m_fCXBorder; | 157 FX_FLOAT m_fCXBorder; |
171 FX_FLOAT m_fCYBorder; | 158 FX_FLOAT m_fCYBorder; |
172 int32_t m_iCaptureBtn; | 159 int32_t m_iCaptureBtn; |
173 int32_t m_iSysBox; | 160 int32_t m_iSysBox; |
174 int32_t m_eResizeType; | 161 int32_t m_eResizeType; |
175 bool m_bLButtonDown; | 162 bool m_bLButtonDown; |
176 bool m_bMaximized; | 163 bool m_bMaximized; |
177 bool m_bSetMaximize; | 164 bool m_bSetMaximize; |
178 bool m_bCustomizeLayout; | 165 bool m_bCustomizeLayout; |
179 FWL_FORMSIZE m_eFormSize; | |
180 bool m_bDoModalFlag; | 166 bool m_bDoModalFlag; |
181 FX_FLOAT m_fSmallIconSz; | 167 FX_FLOAT m_fSmallIconSz; |
182 FX_FLOAT m_fBigIconSz; | 168 FX_FLOAT m_fBigIconSz; |
183 CFX_DIBitmap* m_pBigIcon; | 169 CFX_DIBitmap* m_pBigIcon; |
184 CFX_DIBitmap* m_pSmallIcon; | 170 CFX_DIBitmap* m_pSmallIcon; |
185 bool m_bMouseIn; | |
186 | |
187 private: | |
188 void OnLButtonDown(CFWL_MsgMouse* pMsg); | |
189 void OnLButtonUp(CFWL_MsgMouse* pMsg); | |
190 void OnMouseMove(CFWL_MsgMouse* pMsg); | |
191 void OnMouseHover(CFWL_MsgMouse* pMsg); | |
192 void OnMouseLeave(CFWL_MsgMouse* pMsg); | |
193 void OnLButtonDblClk(CFWL_MsgMouse* pMsg); | |
194 void OnWindowMove(CFWL_MsgWindowMove* pMsg); | |
195 void OnClose(CFWL_MsgClose* pMsg); | |
196 }; | 171 }; |
197 | 172 |
198 #endif // XFA_FWL_CORE_IFWL_FORM_H_ | 173 #endif // XFA_FWL_CORE_IFWL_FORM_H_ |
OLD | NEW |