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_TEXTFIELD_H_ | 7 #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ |
8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ | 8 #define FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ |
9 | 9 |
10 #include "FFL_FormFiller.h" | 10 #include "FFL_FormFiller.h" |
11 | 11 |
12 #define BF_ALIGN_LEFT» » » 0 | 12 #define BF_ALIGN_LEFT 0 |
13 #define BF_ALIGN_MIDDLE»» » 1 | 13 #define BF_ALIGN_MIDDLE 1 |
14 #define BF_ALIGN_RIGHT» » » 2 | 14 #define BF_ALIGN_RIGHT 2 |
15 | 15 |
16 class CBA_FontMap; | 16 class CBA_FontMap; |
17 | 17 |
18 struct FFL_TextFieldState | 18 struct FFL_TextFieldState { |
19 { | 19 int nStart; |
20 » int nStart; | 20 int nEnd; |
21 » int nEnd; | 21 CFX_WideString sValue; |
22 » CFX_WideString sValue; | |
23 }; | 22 }; |
24 | 23 |
25 class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler, public
IPWL_Edit_Notify | 24 class CFFL_TextField : public CFFL_FormFiller, |
26 { | 25 public IPWL_FocusHandler, |
27 public: | 26 public IPWL_Edit_Notify { |
28 » CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); | 27 public: |
29 » virtual ~CFFL_TextField(); | 28 CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); |
| 29 virtual ~CFFL_TextField(); |
30 | 30 |
31 » virtual»PWL_CREATEPARAM»» GetCreateParam(); | 31 virtual PWL_CREATEPARAM GetCreateParam(); |
32 » virtual CPWL_Wnd*» » » NewPDFWindow(const PWL_CREATEPAR
AM& cp, CPDFSDK_PageView* pPageView); | 32 virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, |
| 33 CPDFSDK_PageView* pPageView); |
33 | 34 |
| 35 virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); |
34 | 36 |
35 » virtual FX_BOOL»» » » OnChar(CPDFSDK_Annot* pAnnot, FX
_UINT nChar, FX_UINT nFlags); | 37 virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); |
| 38 virtual void SaveData(CPDFSDK_PageView* pPageView); |
36 | 39 |
37 » virtual FX_BOOL»» » » IsDataChanged(CPDFSDK_PageView*
pPageView); | 40 virtual void GetActionData(CPDFSDK_PageView* pPageView, |
38 » virtual void» » » » SaveData(CPDFSDK_PageView* pPage
View); | 41 CPDF_AAction::AActionType type, |
| 42 PDFSDK_FieldAction& fa); |
| 43 virtual void SetActionData(CPDFSDK_PageView* pPageView, |
| 44 CPDF_AAction::AActionType type, |
| 45 const PDFSDK_FieldAction& fa); |
| 46 virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, |
| 47 const PDFSDK_FieldAction& faOld, |
| 48 const PDFSDK_FieldAction& faNew); |
| 49 virtual void SaveState(CPDFSDK_PageView* pPageView); |
| 50 virtual void RestoreState(CPDFSDK_PageView* pPageView); |
39 | 51 |
40 » virtual void» » » » GetActionData(CPDFSDK_PageView*
pPageView, CPDF_AAction::AActionType type, | 52 virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, |
41 » » » » » » » » » »
» » PDFSDK_FieldAction& fa); | 53 FX_BOOL bRestoreValue); |
42 » virtual void» » » » SetActionData(CPDFSDK_PageView*
pPageView, CPDF_AAction::AActionType type, | |
43 » » » » » » » » » const PD
FSDK_FieldAction& fa); | |
44 » virtual FX_BOOL»» » » IsActionDataChanged(CPDF_AAction
::AActionType type, const PDFSDK_FieldAction& faOld, | |
45 » » » » » » » » » »
» » const PDFSDK_FieldAction& faNew); | |
46 » virtual void» » » » SaveState(CPDFSDK_PageView* pPag
eView); | |
47 » virtual void» » » » RestoreState(CPDFSDK_PageView* p
PageView); | |
48 | 54 |
49 » virtual CPWL_Wnd*» » » ResetPDFWindow(CPDFSDK_PageView*
pPageView, FX_BOOL bRestoreValue); | 55 public: |
| 56 virtual void OnSetFocus(CPWL_Wnd* pWnd); |
| 57 virtual void OnKillFocus(CPWL_Wnd* pWnd); |
50 | 58 |
51 public: | 59 public: |
52 » virtual void» » » » OnSetFocus(CPWL_Wnd* pWnd); | 60 virtual void OnAddUndo(CPWL_Edit* pEdit); |
53 » virtual void» » » » OnKillFocus(CPWL_Wnd* pWnd); | |
54 | 61 |
55 public: | 62 public: |
56 » virtual void» » » » OnAddUndo(CPWL_Edit* pEdit); | 63 virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); |
| 64 virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); |
| 65 virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); |
57 | 66 |
58 public: | 67 private: |
59 » virtual FX_BOOL»» » » CanCopy(CPDFSDK_Document* pDocum
ent); | 68 CBA_FontMap* m_pFontMap; |
60 » virtual FX_BOOL»» » » CanCut(CPDFSDK_Document* pDocume
nt); | 69 FFL_TextFieldState m_State; |
61 » virtual FX_BOOL»» » » CanPaste(CPDFSDK_Document* pDocu
ment); | |
62 | |
63 private: | |
64 » CBA_FontMap*» » » » m_pFontMap; | |
65 » FFL_TextFieldState» » » m_State; | |
66 | |
67 }; | 70 }; |
68 | 71 |
69 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ | 72 #endif // FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ |
OLD | NEW |