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