Merge to XFA: Fix IWYU in formfiller/ directory.
[pdfium.git] / fpdfsdk / include / formfiller / FFL_ComboBox.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 #ifndef _FFL_COMBOBOX_H_
8 #define _FFL_COMBOBOX_H_
9
10 #include "../../../core/include/fxcrt/fx_string.h"
11 #include "FFL_FormFiller.h"
12
13 class CBA_FontMap;
14 class CPDFSDK_Document;
15
16 struct FFL_ComboBoxState
17 {
18         int nIndex;
19         int nStart;
20         int nEnd;
21         CFX_WideString sValue;
22 };
23
24 class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify
25 {
26 public:
27         CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);
28         virtual ~CFFL_ComboBox();
29         
30         virtual PWL_CREATEPARAM         GetCreateParam();
31         virtual CPWL_Wnd*                       NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);
32
33         
34         virtual FX_BOOL                         OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);
35         
36         virtual FX_BOOL                         IsDataChanged(CPDFSDK_PageView* pPageView);
37         virtual void                            SaveData(CPDFSDK_PageView* pPageView);
38         
39         virtual void                            GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa);
40         virtual void                            SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa);
41         virtual FX_BOOL                         IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);
42         virtual void                            SaveState(CPDFSDK_PageView* pPageView);
43         virtual void                            RestoreState(CPDFSDK_PageView* pPageView);
44         
45         virtual CPWL_Wnd*                       ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);
46         virtual void                            OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);
47         
48         virtual FX_BOOL                         IsFieldFull(CPDFSDK_PageView* pPageView);
49         
50 public:
51         virtual void                            OnSetFocus(CPWL_Wnd* pWnd);
52         virtual void                            OnKillFocus(CPWL_Wnd* pWnd);
53         
54 public:
55         virtual void                            OnAddUndo(CPWL_Edit* pEdit);
56         
57 public:
58         virtual FX_BOOL                         CanCopy(CPDFSDK_Document* pDocument); 
59         virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument); 
60         virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument); 
61         
62         virtual void                            DoCopy(CPDFSDK_Document* pDocument); 
63         virtual void                            DoCut(CPDFSDK_Document* pDocument); 
64         virtual void                            DoPaste(CPDFSDK_Document* pDocument); 
65         
66 private:
67         CFX_WideString                          GetSelectExportText();
68
69 private:
70         CBA_FontMap*                            m_pFontMap;
71         FFL_ComboBoxState                               m_State;
72         //CFFL_IM_BOX                                   m_IMBox;
73 };
74
75 #endif //_FFL_COMBOBOX_H_
76