| 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 FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ | 7 #ifndef FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ |
| 8 #define FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ | 8 #define FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #include "fpdfsdk/formfiller/cffl_formfiller.h" | 12 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
| 11 | 13 |
| 12 #define BF_ALIGN_LEFT 0 | 14 #define BF_ALIGN_LEFT 0 |
| 13 #define BF_ALIGN_MIDDLE 1 | 15 #define BF_ALIGN_MIDDLE 1 |
| 14 #define BF_ALIGN_RIGHT 2 | 16 #define BF_ALIGN_RIGHT 2 |
| 15 | 17 |
| 16 class CBA_FontMap; | 18 class CBA_FontMap; |
| 17 | 19 |
| 18 struct FFL_TextFieldState { | 20 struct FFL_TextFieldState { |
| 21 FFL_TextFieldState() : nStart(0), nEnd(0) {} |
| 22 |
| 19 int nStart; | 23 int nStart; |
| 20 int nEnd; | 24 int nEnd; |
| 21 CFX_WideString sValue; | 25 CFX_WideString sValue; |
| 22 }; | 26 }; |
| 23 | 27 |
| 24 class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler { | 28 class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler { |
| 25 public: | 29 public: |
| 26 CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); | 30 CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); |
| 27 ~CFFL_TextField() override; | 31 ~CFFL_TextField() override; |
| 28 | 32 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 49 | 53 |
| 50 // IPWL_FocusHandler: | 54 // IPWL_FocusHandler: |
| 51 void OnSetFocus(CPWL_Wnd* pWnd) override; | 55 void OnSetFocus(CPWL_Wnd* pWnd) override; |
| 52 | 56 |
| 53 #ifdef PDF_ENABLE_XFA | 57 #ifdef PDF_ENABLE_XFA |
| 54 // CFFL_FormFiller: | 58 // CFFL_FormFiller: |
| 55 FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; | 59 FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; |
| 56 #endif // PDF_ENABLE_XFA | 60 #endif // PDF_ENABLE_XFA |
| 57 | 61 |
| 58 private: | 62 private: |
| 59 CBA_FontMap* m_pFontMap; | 63 std::unique_ptr<CBA_FontMap> m_pFontMap; |
| 60 FFL_TextFieldState m_State; | 64 FFL_TextFieldState m_State; |
| 61 }; | 65 }; |
| 62 | 66 |
| 63 #endif // FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ | 67 #endif // FPDFSDK_FORMFILLER_CFFL_TEXTFIELD_H_ |
| OLD | NEW |