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_BASEWIDGET_FWL_EDITIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 13 matching lines...) Expand all Loading... |
24 class CFWL_EditImp; | 24 class CFWL_EditImp; |
25 class CFWL_EditImpDelegate; | 25 class CFWL_EditImpDelegate; |
26 | 26 |
27 class CFWL_EditImp : public CFWL_WidgetImp, public IFDE_TxtEdtEventSink { | 27 class CFWL_EditImp : public CFWL_WidgetImp, public IFDE_TxtEdtEventSink { |
28 public: | 28 public: |
29 CFWL_EditImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); | 29 CFWL_EditImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
30 ~CFWL_EditImp() override; | 30 ~CFWL_EditImp() override; |
31 | 31 |
32 // CFWL_WidgetImp: | 32 // CFWL_WidgetImp: |
33 FWL_ERR GetClassName(CFX_WideString& wsClass) const override; | 33 FWL_ERR GetClassName(CFX_WideString& wsClass) const override; |
34 FX_DWORD GetClassID() const override; | 34 uint32_t GetClassID() const override; |
35 FWL_ERR Initialize() override; | 35 FWL_ERR Initialize() override; |
36 FWL_ERR Finalize() override; | 36 FWL_ERR Finalize() override; |
37 FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; | 37 FWL_ERR GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize = FALSE) override; |
38 FWL_ERR SetWidgetRect(const CFX_RectF& rect) override; | 38 FWL_ERR SetWidgetRect(const CFX_RectF& rect) override; |
39 FWL_ERR Update() override; | 39 FWL_ERR Update() override; |
40 FX_DWORD HitTest(FX_FLOAT fx, FX_FLOAT fy) override; | 40 uint32_t HitTest(FX_FLOAT fx, FX_FLOAT fy) override; |
41 FWL_ERR SetStates(FX_DWORD dwStates, FX_BOOL bSet = TRUE) override; | 41 FWL_ERR SetStates(uint32_t dwStates, FX_BOOL bSet = TRUE) override; |
42 FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 42 FWL_ERR DrawWidget(CFX_Graphics* pGraphics, |
43 const CFX_Matrix* pMatrix = NULL) override; | 43 const CFX_Matrix* pMatrix = NULL) override; |
44 FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; | 44 FWL_ERR SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) override; |
45 | 45 |
46 virtual FWL_ERR SetText(const CFX_WideString& wsText); | 46 virtual FWL_ERR SetText(const CFX_WideString& wsText); |
47 virtual int32_t GetTextLength() const; | 47 virtual int32_t GetTextLength() const; |
48 virtual FWL_ERR GetText(CFX_WideString& wsText, | 48 virtual FWL_ERR GetText(CFX_WideString& wsText, |
49 int32_t nStart = 0, | 49 int32_t nStart = 0, |
50 int32_t nCount = -1) const; | 50 int32_t nCount = -1) const; |
51 virtual FWL_ERR ClearText(); | 51 virtual FWL_ERR ClearText(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 int32_t nFieldIndex, | 102 int32_t nFieldIndex, |
103 const CFX_WideString& wsFieldText, | 103 const CFX_WideString& wsFieldText, |
104 int32_t nCharIndex) override; | 104 int32_t nCharIndex) override; |
105 FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine* pEdit, | 105 FX_BOOL On_ValidateBlock(IFDE_TxtEdtEngine* pEdit, |
106 int32_t nBlockIndex) override; | 106 int32_t nBlockIndex) override; |
107 FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine* pEdit, | 107 FX_BOOL On_GetBlockFormatText(IFDE_TxtEdtEngine* pEdit, |
108 int32_t nBlockIndex, | 108 int32_t nBlockIndex, |
109 CFX_WideString& wsBlockText) override; | 109 CFX_WideString& wsBlockText) override; |
110 FX_BOOL On_Validate(IFDE_TxtEdtEngine* pEdit, | 110 FX_BOOL On_Validate(IFDE_TxtEdtEngine* pEdit, |
111 CFX_WideString& wsText) override; | 111 CFX_WideString& wsText) override; |
112 virtual FWL_ERR SetBackgroundColor(FX_DWORD color); | 112 virtual FWL_ERR SetBackgroundColor(uint32_t color); |
113 virtual FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); | 113 virtual FWL_ERR SetFont(const CFX_WideString& wsFont, FX_FLOAT fSize); |
114 void SetScrollOffset(FX_FLOAT fScrollOffset); | 114 void SetScrollOffset(FX_FLOAT fScrollOffset); |
115 FX_BOOL GetSuggestWords(CFX_PointF pointf, | 115 FX_BOOL GetSuggestWords(CFX_PointF pointf, |
116 std::vector<CFX_ByteString>& sSuggest); | 116 std::vector<CFX_ByteString>& sSuggest); |
117 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, | 117 FX_BOOL ReplaceSpellCheckWord(CFX_PointF pointf, |
118 const CFX_ByteStringC& bsReplace); | 118 const CFX_ByteStringC& bsReplace); |
119 | 119 |
120 protected: | 120 protected: |
121 void DrawTextBk(CFX_Graphics* pGraphics, | 121 void DrawTextBk(CFX_Graphics* pGraphics, |
122 IFWL_ThemeProvider* pTheme, | 122 IFWL_ThemeProvider* pTheme, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 FX_ARGB m_argbSel; | 170 FX_ARGB m_argbSel; |
171 FX_BOOL m_bSetRange; | 171 FX_BOOL m_bSetRange; |
172 int32_t m_iMin; | 172 int32_t m_iMin; |
173 int32_t m_iMax; | 173 int32_t m_iMax; |
174 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; | 174 std::unique_ptr<IFWL_ScrollBar> m_pVertScrollBar; |
175 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; | 175 std::unique_ptr<IFWL_ScrollBar> m_pHorzScrollBar; |
176 std::unique_ptr<IFWL_Caret> m_pCaret; | 176 std::unique_ptr<IFWL_Caret> m_pCaret; |
177 CFX_WideString m_wsCache; | 177 CFX_WideString m_wsCache; |
178 friend class CFWL_TxtEdtEventSink; | 178 friend class CFWL_TxtEdtEventSink; |
179 friend class CFWL_EditImpDelegate; | 179 friend class CFWL_EditImpDelegate; |
180 FX_DWORD m_backColor; | 180 uint32_t m_backColor; |
181 FX_BOOL m_updateBackColor; | 181 FX_BOOL m_updateBackColor; |
182 CFX_WideString m_wsFont; | 182 CFX_WideString m_wsFont; |
183 CFX_ByteStringArray m_RecordArr; | 183 CFX_ByteStringArray m_RecordArr; |
184 int32_t m_iCurRecord; | 184 int32_t m_iCurRecord; |
185 int32_t m_iMaxRecord; | 185 int32_t m_iMaxRecord; |
186 }; | 186 }; |
187 | 187 |
188 class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { | 188 class CFWL_EditImpDelegate : public CFWL_WidgetImpDelegate { |
189 public: | 189 public: |
190 CFWL_EditImpDelegate(CFWL_EditImp* pOwner); | 190 CFWL_EditImpDelegate(CFWL_EditImp* pOwner); |
191 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 191 int32_t OnProcessMessage(CFWL_Message* pMessage) override; |
192 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; | 192 FWL_ERR OnProcessEvent(CFWL_Event* pEvent) override; |
193 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 193 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, |
194 const CFX_Matrix* pMatrix = NULL) override; | 194 const CFX_Matrix* pMatrix = NULL) override; |
195 | 195 |
196 protected: | 196 protected: |
197 void DoActivate(CFWL_MsgActivate* pMsg); | 197 void DoActivate(CFWL_MsgActivate* pMsg); |
198 void DoDeactivate(CFWL_MsgDeactivate* pMsg); | 198 void DoDeactivate(CFWL_MsgDeactivate* pMsg); |
199 void DoButtonDown(CFWL_MsgMouse* pMsg); | 199 void DoButtonDown(CFWL_MsgMouse* pMsg); |
200 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); | 200 void OnFocusChanged(CFWL_Message* pMsg, FX_BOOL bSet = TRUE); |
201 void OnLButtonDown(CFWL_MsgMouse* pMsg); | 201 void OnLButtonDown(CFWL_MsgMouse* pMsg); |
202 void OnLButtonUp(CFWL_MsgMouse* pMsg); | 202 void OnLButtonUp(CFWL_MsgMouse* pMsg); |
203 void OnButtonDblClk(CFWL_MsgMouse* pMsg); | 203 void OnButtonDblClk(CFWL_MsgMouse* pMsg); |
204 void OnMouseMove(CFWL_MsgMouse* pMsg); | 204 void OnMouseMove(CFWL_MsgMouse* pMsg); |
205 void OnKeyDown(CFWL_MsgKey* pMsg); | 205 void OnKeyDown(CFWL_MsgKey* pMsg); |
206 void OnChar(CFWL_MsgKey* pMsg); | 206 void OnChar(CFWL_MsgKey* pMsg); |
207 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, FX_DWORD dwCode, FX_FLOAT fPos); | 207 FX_BOOL OnScroll(IFWL_ScrollBar* pScrollBar, uint32_t dwCode, FX_FLOAT fPos); |
208 void DoCursor(CFWL_MsgMouse* pMsg); | 208 void DoCursor(CFWL_MsgMouse* pMsg); |
209 CFWL_EditImp* m_pOwner; | 209 CFWL_EditImp* m_pOwner; |
210 }; | 210 }; |
211 | 211 |
212 #endif // XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ | 212 #endif // XFA_FWL_BASEWIDGET_FWL_EDITIMP_H_ |
OLD | NEW |