Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxfa / src / app / xfa_ffchoicelist.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 _FXFA_FORMFILLER_CHOICELIST_IMP_H\r
8 #define _FXFA_FORMFILLER_CHOICELIST_IMP_H\r
9 class CXFA_FFListBox : public CXFA_FFField\r
10 {\r
11 public:\r
12     CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);\r
13     virtual ~CXFA_FFListBox();\r
14     virtual FX_BOOL             LoadWidget();\r
15     virtual FX_BOOL             OnKillFocus(CXFA_FFWidget* pNewWidget);\r
16 protected:\r
17     virtual FX_BOOL             CommitData();\r
18     virtual FX_BOOL             UpdateFWLData();\r
19     virtual FX_BOOL             IsDataChanged();\r
20     FX_DWORD                    GetAlignment();\r
21 public:\r
22     void                OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array &arrSels);\r
23     void                        SetItemState(FX_INT32 nIndex, FX_BOOL bSelected);\r
24     void                        InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1);\r
25     void                        DeleteItem(FX_INT32 nIndex);\r
26     virtual FX_INT32    OnProcessMessage(CFWL_Message *pMessage);\r
27     virtual FWL_ERR             OnProcessEvent(CFWL_Event *pEvent);\r
28     virtual FWL_ERR             OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
29 protected:\r
30     IFWL_WidgetDelegate*        m_pOldDelegate;\r
31 };\r
32 class CXFA_FFComboBox : public CXFA_FFField\r
33 {\r
34 public:\r
35     CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc);\r
36     virtual ~CXFA_FFComboBox();\r
37     virtual FX_BOOL             GetBBox(CFX_RectF &rtBox, FX_DWORD dwStatus, FX_BOOL bDrawFocus = FALSE);\r
38     virtual FX_BOOL             LoadWidget();\r
39     virtual void                UpdateWidgetProperty();\r
40     virtual FX_BOOL             OnRButtonUp(FX_DWORD dwFlags, FX_FLOAT fx, FX_FLOAT fy);\r
41     virtual FX_BOOL             OnKillFocus(CXFA_FFWidget* pNewWidget);\r
42     virtual FX_BOOL             CanUndo();\r
43     virtual FX_BOOL             CanRedo();\r
44     virtual FX_BOOL             Undo();\r
45     virtual FX_BOOL             Redo();\r
46 \r
47     virtual FX_BOOL             CanCopy();\r
48     virtual FX_BOOL             CanCut();\r
49     virtual FX_BOOL             CanPaste();\r
50     virtual FX_BOOL             CanSelectAll();\r
51     virtual FX_BOOL             Copy(CFX_WideString &wsCopy);\r
52     virtual FX_BOOL             Cut(CFX_WideString &wsCut);\r
53     virtual FX_BOOL             Paste(const CFX_WideString &wsPaste);\r
54     virtual FX_BOOL             SelectAll();\r
55     virtual FX_BOOL             Delete();\r
56     virtual FX_BOOL             DeSelect();\r
57     void        OpenDropDownList();\r
58 protected:\r
59     virtual     FX_BOOL         PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy);\r
60     virtual FX_BOOL             CommitData();\r
61     virtual FX_BOOL             UpdateFWLData();\r
62     virtual FX_BOOL             IsDataChanged();\r
63     FX_DWORD                    GetAlignment();\r
64     void                                FWLEventSelChange(CXFA_EventParam* pParam);\r
65 \r
66     CFX_WideString              m_wsNewValue;\r
67 public:\r
68     void        OnTextChanged(IFWL_Widget *pWidget, const CFX_WideString &wsChanged);\r
69     void        OnSelectChanged(IFWL_Widget *pWidget, const CFX_Int32Array &arrSels, FX_BOOL bLButtonUp);\r
70     void        OnPreOpen(IFWL_Widget *pWidget);\r
71     void        OnPostOpen(IFWL_Widget *pWidget);\r
72     void        OnAddDoRecord(IFWL_Widget *pWidget);\r
73     void                        SetItemState(FX_INT32 nIndex, FX_BOOL bSelected);\r
74     void                        InsertItem(FX_WSTR wsLabel, FX_INT32 nIndex = -1);\r
75     void                        DeleteItem(FX_INT32 nIndex);\r
76     virtual FX_INT32    OnProcessMessage(CFWL_Message *pMessage);\r
77     virtual FWL_ERR             OnProcessEvent(CFWL_Event *pEvent);\r
78     virtual FWL_ERR             OnDrawWidget(CFX_Graphics *pGraphics, const CFX_Matrix *pMatrix = NULL);\r
79 protected:\r
80     IFWL_WidgetDelegate*        m_pOldDelegate;\r
81 };\r
82 #endif\r