Initial commit.
[pdfium.git] / fpdfsdk / include / formfiller / FFL_ComboBox.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _FFL_COMBOBOX_H_\r
8  #define _FFL_COMBOBOX_H_\r
9 \r
10 struct FFL_ComboBoxState\r
11 {\r
12         int nIndex;\r
13         int nStart;\r
14         int nEnd;\r
15         CFX_WideString sValue;\r
16 };\r
17 class CBA_FontMap;\r
18 \r
19 class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler, public IPWL_Edit_Notify\r
20 {\r
21 public:\r
22         CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget);\r
23         virtual ~CFFL_ComboBox();\r
24         \r
25         virtual PWL_CREATEPARAM         GetCreateParam();\r
26         virtual CPWL_Wnd*                       NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView);\r
27 \r
28         \r
29         virtual FX_BOOL                         OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags);\r
30         \r
31         virtual FX_BOOL                         IsDataChanged(CPDFSDK_PageView* pPageView);\r
32         virtual void                            SaveData(CPDFSDK_PageView* pPageView);\r
33         \r
34         virtual void                            GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa);\r
35         virtual void                            SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa);\r
36         virtual FX_BOOL                         IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew);\r
37         virtual void                            SaveState(CPDFSDK_PageView* pPageView);\r
38         virtual void                            RestoreState(CPDFSDK_PageView* pPageView);\r
39         \r
40         virtual CPWL_Wnd*                       ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue);\r
41         virtual void                            OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);\r
42         \r
43 public:\r
44         virtual void                            OnSetFocus(CPWL_Wnd* pWnd);\r
45         virtual void                            OnKillFocus(CPWL_Wnd* pWnd);\r
46         \r
47 public:\r
48         virtual void                            OnAddUndo(CPWL_Edit* pEdit);\r
49         \r
50 public:\r
51         virtual FX_BOOL                         CanCopy(CPDFSDK_Document* pDocument); \r
52         virtual FX_BOOL                         CanCut(CPDFSDK_Document* pDocument); \r
53         virtual FX_BOOL                         CanPaste(CPDFSDK_Document* pDocument); \r
54         \r
55         virtual void                            DoCopy(CPDFSDK_Document* pDocument); \r
56         virtual void                            DoCut(CPDFSDK_Document* pDocument); \r
57         virtual void                            DoPaste(CPDFSDK_Document* pDocument); \r
58         \r
59 private:\r
60         CFX_WideString                          GetSelectExportText();\r
61 \r
62 private:\r
63         CBA_FontMap*                            m_pFontMap;\r
64         FFL_ComboBoxState                               m_State;\r
65         //CFFL_IM_BOX                                   m_IMBox;\r
66 };\r
67 \r
68 #endif //_FFL_COMBOBOX_H_\r
69 \r