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 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" | 7 #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" |
8 #include "fpdfsdk/include/formfiller/FFL_TextField.h" | 8 #include "fpdfsdk/include/formfiller/FFL_TextField.h" |
9 | 9 |
10 /* ------------------------------- CFFL_TextField | 10 /* ------------------------------- CFFL_TextField |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 RestoreState(pPageView); | 261 RestoreState(pPageView); |
262 pRet = GetPDFWindow(pPageView, FALSE); | 262 pRet = GetPDFWindow(pPageView, FALSE); |
263 } else | 263 } else |
264 pRet = GetPDFWindow(pPageView, TRUE); | 264 pRet = GetPDFWindow(pPageView, TRUE); |
265 | 265 |
266 m_pWidget->UpdateField(); | 266 m_pWidget->UpdateField(); |
267 | 267 |
268 return pRet; | 268 return pRet; |
269 } | 269 } |
270 | 270 |
| 271 #ifdef PDF_ENABLE_XFA |
| 272 FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { |
| 273 if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) { |
| 274 return pWnd->IsTextFull(); |
| 275 } |
| 276 |
| 277 return FALSE; |
| 278 } |
| 279 |
| 280 #endif |
271 void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { | 281 void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { |
272 ASSERT(m_pApp != NULL); | 282 ASSERT(m_pApp != NULL); |
273 | 283 |
274 ASSERT(pWnd != NULL); | 284 ASSERT(pWnd != NULL); |
275 | 285 |
276 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { | 286 if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { |
277 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; | 287 CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; |
278 pEdit->SetCharSet(134); | 288 pEdit->SetCharSet(134); |
279 pEdit->SetCodePage(936); | 289 pEdit->SetCodePage(936); |
280 | 290 |
281 pEdit->SetReadyToInput(); | 291 pEdit->SetReadyToInput(); |
282 CFX_WideString wsText = pEdit->GetText(); | 292 CFX_WideString wsText = pEdit->GetText(); |
283 int nCharacters = wsText.GetLength(); | 293 int nCharacters = wsText.GetLength(); |
284 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); | 294 CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); |
285 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); | 295 unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); |
286 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, | 296 m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, |
287 nCharacters, TRUE); | 297 nCharacters, TRUE); |
288 | 298 |
289 pEdit->SetEditNotify(this); | 299 pEdit->SetEditNotify(this); |
290 } | 300 } |
291 } | 301 } |
292 | 302 |
293 void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) {} | 303 void CFFL_TextField::OnKillFocus(CPWL_Wnd* pWnd) {} |
294 | 304 |
295 void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) {} | 305 void CFFL_TextField::OnAddUndo(CPWL_Edit* pEdit) {} |
OLD | NEW |