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_COMBOBOX_H_ | 7 #ifndef FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ |
8 #define FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ | 8 #define FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ |
9 | 9 |
10 #include "core/fxcrt/include/fx_string.h" | 10 #include "core/fxcrt/include/fx_string.h" |
11 #include "fpdfsdk/formfiller/cffl_formfiller.h" | 11 #include "fpdfsdk/formfiller/cffl_formfiller.h" |
12 | 12 |
13 class CBA_FontMap; | 13 class CBA_FontMap; |
14 | 14 |
15 struct FFL_ComboBoxState { | 15 struct FFL_ComboBoxState { |
16 int nIndex; | 16 int nIndex; |
17 int nStart; | 17 int nStart; |
18 int nEnd; | 18 int nEnd; |
19 CFX_WideString sValue; | 19 CFX_WideString sValue; |
20 }; | 20 }; |
21 | 21 |
22 class CFFL_ComboBox : public CFFL_FormFiller, | 22 class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler { |
23 public IPWL_FocusHandler, | |
24 public IPWL_Edit_Notify { | |
25 public: | 23 public: |
26 CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); | 24 CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); |
27 ~CFFL_ComboBox() override; | 25 ~CFFL_ComboBox() override; |
28 | 26 |
29 // CFFL_FormFiller: | 27 // CFFL_FormFiller: |
30 PWL_CREATEPARAM GetCreateParam() override; | 28 PWL_CREATEPARAM GetCreateParam() override; |
31 CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, | 29 CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, |
32 CPDFSDK_PageView* pPageView) override; | 30 CPDFSDK_PageView* pPageView) override; |
33 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) override; | 31 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) override; |
34 FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override; | 32 FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override; |
35 void SaveData(CPDFSDK_PageView* pPageView) override; | 33 void SaveData(CPDFSDK_PageView* pPageView) override; |
36 void GetActionData(CPDFSDK_PageView* pPageView, | 34 void GetActionData(CPDFSDK_PageView* pPageView, |
37 CPDF_AAction::AActionType type, | 35 CPDF_AAction::AActionType type, |
38 PDFSDK_FieldAction& fa) override; | 36 PDFSDK_FieldAction& fa) override; |
39 void SetActionData(CPDFSDK_PageView* pPageView, | 37 void SetActionData(CPDFSDK_PageView* pPageView, |
40 CPDF_AAction::AActionType type, | 38 CPDF_AAction::AActionType type, |
41 const PDFSDK_FieldAction& fa) override; | 39 const PDFSDK_FieldAction& fa) override; |
42 FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, | 40 FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, |
43 const PDFSDK_FieldAction& faOld, | 41 const PDFSDK_FieldAction& faOld, |
44 const PDFSDK_FieldAction& faNew) override; | 42 const PDFSDK_FieldAction& faNew) override; |
45 void SaveState(CPDFSDK_PageView* pPageView) override; | 43 void SaveState(CPDFSDK_PageView* pPageView) override; |
46 void RestoreState(CPDFSDK_PageView* pPageView) override; | 44 void RestoreState(CPDFSDK_PageView* pPageView) override; |
47 CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, | 45 CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, |
48 FX_BOOL bRestoreValue) override; | 46 FX_BOOL bRestoreValue) override; |
49 | 47 |
50 // IPWL_FocusHandler: | 48 // IPWL_FocusHandler: |
51 void OnSetFocus(CPWL_Wnd* pWnd) override; | 49 void OnSetFocus(CPWL_Wnd* pWnd) override; |
52 void OnKillFocus(CPWL_Wnd* pWnd) override; | |
53 | |
54 // IPWL_Edit_Notify: | |
55 void OnAddUndo(CPWL_Edit* pEdit) override; | |
56 | 50 |
57 #ifdef PDF_ENABLE_XFA | 51 #ifdef PDF_ENABLE_XFA |
58 // CFFL_FormFiller: | 52 // CFFL_FormFiller: |
59 FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; | 53 FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; |
60 #endif // PDF_ENABLE_XFA | 54 #endif // PDF_ENABLE_XFA |
61 | 55 |
62 private: | 56 private: |
63 CFX_WideString GetSelectExportText(); | 57 CFX_WideString GetSelectExportText(); |
64 | 58 |
65 CBA_FontMap* m_pFontMap; | 59 CBA_FontMap* m_pFontMap; |
66 FFL_ComboBoxState m_State; | 60 FFL_ComboBoxState m_State; |
67 }; | 61 }; |
68 | 62 |
69 #endif // FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ | 63 #endif // FPDFSDK_FORMFILLER_CFFL_COMBOBOX_H_ |
OLD | NEW |