Chromium Code Reviews| 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_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ | 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ |
| 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ | 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ |
| 9 | 9 |
| 10 #include "../../../core/include/fxcrt/fx_string.h" | 10 #include "../../../core/include/fxcrt/fx_string.h" |
| 11 #include "FFL_FormFiller.h" | 11 #include "FFL_FormFiller.h" |
| 12 | 12 |
| 13 class CBA_FontMap; | 13 class CBA_FontMap; |
| 14 class CPDFSDK_Document; | 14 class CPDFSDK_Document; |
| 15 | 15 |
| 16 struct FFL_ComboBoxState { | 16 struct FFL_ComboBoxState { |
| 17 int nIndex; | 17 int nIndex; |
| 18 int nStart; | 18 int nStart; |
| 19 int nEnd; | 19 int nEnd; |
| 20 CFX_WideString sValue; | 20 CFX_WideString sValue; |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 class CFFL_ComboBox : public CFFL_FormFiller, | 23 class CFFL_ComboBox : public CFFL_FormFiller, |
| 24 public IPWL_FocusHandler, | 24 public IPWL_FocusHandler, |
| 25 public IPWL_Edit_Notify { | 25 public IPWL_Edit_Notify { |
| 26 public: | 26 public: |
| 27 CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); | 27 CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); |
| 28 virtual ~CFFL_ComboBox(); | 28 ~CFFL_ComboBox() override; |
| 29 | 29 |
| 30 virtual PWL_CREATEPARAM GetCreateParam(); | 30 // CFFL_FormFiller: |
| 31 virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, | 31 PWL_CREATEPARAM GetCreateParam() override; |
| 32 CPDFSDK_PageView* pPageView); | 32 CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, |
| 33 CPDFSDK_PageView* pPageView) override; | |
| 34 FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags) override; | |
| 35 FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView) override; | |
| 36 void SaveData(CPDFSDK_PageView* pPageView) override; | |
| 37 void GetActionData(CPDFSDK_PageView* pPageView, | |
| 38 CPDF_AAction::AActionType type, | |
| 39 PDFSDK_FieldAction& fa) override; | |
| 40 void SetActionData(CPDFSDK_PageView* pPageView, | |
| 41 CPDF_AAction::AActionType type, | |
| 42 const PDFSDK_FieldAction& fa) override; | |
| 43 FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, | |
| 44 const PDFSDK_FieldAction& faOld, | |
| 45 const PDFSDK_FieldAction& faNew) override; | |
| 46 void SaveState(CPDFSDK_PageView* pPageView) override; | |
| 47 void RestoreState(CPDFSDK_PageView* pPageView) override; | |
| 48 CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, | |
| 49 FX_BOOL bRestoreValue) override; | |
| 50 void OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) override; | |
| 33 | 51 |
| 34 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); | 52 // IPWL_FocusHandler: |
| 53 void OnSetFocus(CPWL_Wnd* pWnd) override; | |
| 54 void OnKillFocus(CPWL_Wnd* pWnd) override; | |
| 35 | 55 |
| 36 virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); | 56 // IPWL_Edit_Notify: |
| 37 virtual void SaveData(CPDFSDK_PageView* pPageView); | 57 void OnAddUndo(CPWL_Edit* pEdit) override; |
| 38 | |
| 39 virtual void GetActionData(CPDFSDK_PageView* pPageView, | |
| 40 CPDF_AAction::AActionType type, | |
| 41 PDFSDK_FieldAction& fa); | |
| 42 virtual void SetActionData(CPDFSDK_PageView* pPageView, | |
| 43 CPDF_AAction::AActionType type, | |
| 44 const PDFSDK_FieldAction& fa); | |
| 45 virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, | |
| 46 const PDFSDK_FieldAction& faOld, | |
| 47 const PDFSDK_FieldAction& faNew); | |
| 48 virtual void SaveState(CPDFSDK_PageView* pPageView); | |
| 49 virtual void RestoreState(CPDFSDK_PageView* pPageView); | |
| 50 | |
| 51 virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, | |
| 52 FX_BOOL bRestoreValue); | |
| 53 virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag); | |
| 54 | |
| 55 public: | |
| 56 virtual void OnSetFocus(CPWL_Wnd* pWnd); | |
| 57 virtual void OnKillFocus(CPWL_Wnd* pWnd); | |
| 58 | |
| 59 public: | |
| 60 virtual void OnAddUndo(CPWL_Edit* pEdit); | |
| 61 | |
| 62 public: | |
| 63 virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); | |
|
Nico
2015/08/08 23:47:40
where did this block go?
Lei Zhang
2015/08/10 07:03:22
CFFL_ComboBox::CanCopy() and friends are just no-o
| |
| 64 virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); | |
| 65 virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); | |
| 66 | 58 |
| 67 private: | 59 private: |
| 68 CFX_WideString GetSelectExportText(); | 60 CFX_WideString GetSelectExportText(); |
| 69 | 61 |
| 70 private: | |
| 71 CBA_FontMap* m_pFontMap; | 62 CBA_FontMap* m_pFontMap; |
| 72 FFL_ComboBoxState m_State; | 63 FFL_ComboBoxState m_State; |
| 73 }; | 64 }; |
| 74 | 65 |
| 75 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ | 66 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ |
| OLD | NEW |