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