Merge to XFA: Fix IWYU in formfiller/ directory.
[pdfium.git] / fpdfsdk / include / formfiller / FFL_TextField.h
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4  
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #if !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)
8 #define AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_
9
10 #include "FFL_FormFiller.h"
11
12 #define BF_ALIGN_LEFT                   0
13 #define BF_ALIGN_MIDDLE                 1
14 #define BF_ALIGN_RIGHT                  2
15
16 class CBA_FontMap;
17
18
19 class CFFL_EditUndoItem
20 {
21 public:
22         CFFL_EditUndoItem(CPWL_Edit* pEdit);
23         virtual ~CFFL_EditUndoItem();
24         
25         virtual void                                    Undo();
26         virtual void                                    Redo();
27         virtual CFX_WideString                  GetDescr();
28         virtual void                                    Release();
29 };
30
31 struct FFL_TextFieldState
32 {
33         int nStart;
34         int nEnd;
35         CFX_WideString sValue;
36 };
37
38 class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
39 {
40 public:
41         CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot);
42         virtual ~CFFL_TextField();
43         
44         virtual PWL_CREATEPARAM         GetCreateParam();
45         virtual CPWL_Wnd*                       NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
46
47         
48         virtual FX_BOOL                         OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
49         
50         virtual FX_BOOL                         IsDataChanged(CPDFSDK_PageView* pPageView);
51         virtual void                            SaveData(CPDFSDK_PageView* pPageView);
52         
53         virtual void                            GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type,
54                                                                                                 PDFSDK_FieldAction& fa);
55         virtual void                            SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, 
56                                                                         const PDFSDK_FieldAction& fa);
57         virtual FX_BOOL                         IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, 
58                                                                                                 const PDFSDK_FieldAction& faNew);
59         virtual void                            SaveState(CPDFSDK_PageView* pPageView);
60         virtual void                            RestoreState(CPDFSDK_PageView* pPageView);
61         
62         virtual CPWL_Wnd*                       ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
63         
64         virtual FX_BOOL                         IsFieldFull(CPDFSDK_PageView* pPageView);
65         
66 public:
67         virtual void                            OnSetFocus(CPWL_Wnd* pWnd);
68         virtual void                            OnKillFocus(CPWL_Wnd* pWnd);
69         
70 public:
71         virtual void                            OnAddUndo(CPWL_Edit* pEdit);
72         
73 public:
74         virtual FX_BOOL                         CanCopy(CPDFSDK_Document* pDocument); 
75         virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument); 
76         virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument); 
77         
78         virtual void                            DoCopy(CPDFSDK_Document* pDocument); 
79         virtual void                            DoCut(CPDFSDK_Document* pDocument); 
80         virtual void                            DoPaste(CPDFSDK_Document* pDocument); 
81         
82 private:
83         CBA_FontMap*                            m_pFontMap;
84 //      CBA_SpellCheck*                         m_pSpellCheck;
85         FFL_TextFieldState                      m_State;
86 //      CFFL_IM_BOX                                     m_IMBox;
87 };
88
89 #endif // !defined(AFX_FFL_EDIT_H__8E0C9456_CBA2_4EFB_9F31_53C6D8C1A8AC__INCLUDED_)