| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef XFA_FXFA_APP_XFA_FFCHOICELIST_H_ | 7 #ifndef XFA_FXFA_APP_XFA_FFCHOICELIST_H_ |
| 8 #define XFA_FXFA_APP_XFA_FFCHOICELIST_H_ | 8 #define XFA_FXFA_APP_XFA_FFCHOICELIST_H_ |
| 9 | 9 |
| 10 #include "xfa/fxfa/app/xfa_fffield.h" | 10 #include "xfa/fxfa/app/xfa_fffield.h" |
| 11 #include "xfa/fxfa/include/xfa_ffpageview.h" | 11 #include "xfa/fxfa/include/xfa_ffpageview.h" |
| 12 | 12 |
| 13 class CXFA_FFListBox : public CXFA_FFField { | 13 class CXFA_FFListBox : public CXFA_FFField { |
| 14 public: | 14 public: |
| 15 CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 15 CXFA_FFListBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
| 16 virtual ~CXFA_FFListBox(); | 16 ~CXFA_FFListBox() override; |
| 17 virtual FX_BOOL LoadWidget(); | |
| 18 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); | |
| 19 | 17 |
| 20 protected: | 18 // CXFA_FFField |
| 21 virtual FX_BOOL CommitData(); | 19 FX_BOOL LoadWidget() override; |
| 22 virtual FX_BOOL UpdateFWLData(); | 20 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; |
| 23 virtual FX_BOOL IsDataChanged(); | 21 void OnProcessMessage(CFWL_Message* pMessage) override; |
| 24 uint32_t GetAlignment(); | 22 void OnProcessEvent(CFWL_Event* pEvent) override; |
| 23 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 24 const CFX_Matrix* pMatrix = NULL) override; |
| 25 | 25 |
| 26 public: | |
| 27 void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels); | 26 void OnSelectChanged(IFWL_Widget* pWidget, const CFX_Int32Array& arrSels); |
| 28 void SetItemState(int32_t nIndex, FX_BOOL bSelected); | 27 void SetItemState(int32_t nIndex, FX_BOOL bSelected); |
| 29 void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); | 28 void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); |
| 30 void DeleteItem(int32_t nIndex); | 29 void DeleteItem(int32_t nIndex); |
| 31 virtual void OnProcessMessage(CFWL_Message* pMessage); | |
| 32 virtual void OnProcessEvent(CFWL_Event* pEvent); | |
| 33 virtual void OnDrawWidget(CFX_Graphics* pGraphics, | |
| 34 const CFX_Matrix* pMatrix = NULL); | |
| 35 | 30 |
| 36 protected: | 31 protected: |
| 32 FX_BOOL CommitData() override; |
| 33 FX_BOOL UpdateFWLData() override; |
| 34 FX_BOOL IsDataChanged() override; |
| 35 |
| 36 uint32_t GetAlignment(); |
| 37 |
| 37 IFWL_WidgetDelegate* m_pOldDelegate; | 38 IFWL_WidgetDelegate* m_pOldDelegate; |
| 38 }; | 39 }; |
| 40 |
| 39 class CXFA_FFComboBox : public CXFA_FFField { | 41 class CXFA_FFComboBox : public CXFA_FFField { |
| 40 public: | 42 public: |
| 41 CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); | 43 CXFA_FFComboBox(CXFA_FFPageView* pPageView, CXFA_WidgetAcc* pDataAcc); |
| 42 virtual ~CXFA_FFComboBox(); | 44 ~CXFA_FFComboBox() override; |
| 43 virtual FX_BOOL GetBBox(CFX_RectF& rtBox, | |
| 44 uint32_t dwStatus, | |
| 45 FX_BOOL bDrawFocus = FALSE); | |
| 46 virtual FX_BOOL LoadWidget(); | |
| 47 virtual void UpdateWidgetProperty(); | |
| 48 virtual FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy); | |
| 49 virtual FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget); | |
| 50 virtual FX_BOOL CanUndo(); | |
| 51 virtual FX_BOOL CanRedo(); | |
| 52 virtual FX_BOOL Undo(); | |
| 53 virtual FX_BOOL Redo(); | |
| 54 | 45 |
| 55 virtual FX_BOOL CanCopy(); | 46 // CXFA_FFField |
| 56 virtual FX_BOOL CanCut(); | 47 FX_BOOL GetBBox(CFX_RectF& rtBox, |
| 57 virtual FX_BOOL CanPaste(); | 48 uint32_t dwStatus, |
| 58 virtual FX_BOOL CanSelectAll(); | 49 FX_BOOL bDrawFocus = FALSE) override; |
| 59 virtual FX_BOOL Copy(CFX_WideString& wsCopy); | 50 FX_BOOL LoadWidget() override; |
| 60 virtual FX_BOOL Cut(CFX_WideString& wsCut); | 51 void UpdateWidgetProperty() override; |
| 61 virtual FX_BOOL Paste(const CFX_WideString& wsPaste); | 52 FX_BOOL OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; |
| 62 virtual FX_BOOL SelectAll(); | 53 FX_BOOL OnKillFocus(CXFA_FFWidget* pNewWidget) override; |
| 63 virtual FX_BOOL Delete(); | 54 FX_BOOL CanUndo() override; |
| 64 virtual FX_BOOL DeSelect(); | 55 FX_BOOL CanRedo() override; |
| 65 void OpenDropDownList(); | 56 FX_BOOL Undo() override; |
| 57 FX_BOOL Redo() override; |
| 66 | 58 |
| 67 protected: | 59 FX_BOOL CanCopy() override; |
| 68 virtual FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy); | 60 FX_BOOL CanCut() override; |
| 69 virtual FX_BOOL CommitData(); | 61 FX_BOOL CanPaste() override; |
| 70 virtual FX_BOOL UpdateFWLData(); | 62 FX_BOOL CanSelectAll() override; |
| 71 virtual FX_BOOL IsDataChanged(); | 63 FX_BOOL Copy(CFX_WideString& wsCopy) override; |
| 72 uint32_t GetAlignment(); | 64 FX_BOOL Cut(CFX_WideString& wsCut) override; |
| 73 void FWLEventSelChange(CXFA_EventParam* pParam); | 65 FX_BOOL Paste(const CFX_WideString& wsPaste) override; |
| 66 FX_BOOL SelectAll() override; |
| 67 FX_BOOL Delete() override; |
| 68 FX_BOOL DeSelect() override; |
| 74 | 69 |
| 75 CFX_WideString m_wsNewValue; | 70 // IFWL_WidgetDelegate |
| 71 void OnProcessMessage(CFWL_Message* pMessage) override; |
| 72 void OnProcessEvent(CFWL_Event* pEvent) override; |
| 73 void OnDrawWidget(CFX_Graphics* pGraphics, |
| 74 const CFX_Matrix* pMatrix = NULL) override; |
| 76 | 75 |
| 77 public: | 76 virtual void OpenDropDownList(); |
| 77 |
| 78 void OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged); | 78 void OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged); |
| 79 void OnSelectChanged(IFWL_Widget* pWidget, | 79 void OnSelectChanged(IFWL_Widget* pWidget, |
| 80 const CFX_Int32Array& arrSels, | 80 const CFX_Int32Array& arrSels, |
| 81 FX_BOOL bLButtonUp); | 81 FX_BOOL bLButtonUp); |
| 82 void OnPreOpen(IFWL_Widget* pWidget); | 82 void OnPreOpen(IFWL_Widget* pWidget); |
| 83 void OnPostOpen(IFWL_Widget* pWidget); | 83 void OnPostOpen(IFWL_Widget* pWidget); |
| 84 void SetItemState(int32_t nIndex, FX_BOOL bSelected); | 84 void SetItemState(int32_t nIndex, FX_BOOL bSelected); |
| 85 void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); | 85 void InsertItem(const CFX_WideStringC& wsLabel, int32_t nIndex = -1); |
| 86 void DeleteItem(int32_t nIndex); | 86 void DeleteItem(int32_t nIndex); |
| 87 virtual void OnProcessMessage(CFWL_Message* pMessage); | |
| 88 virtual void OnProcessEvent(CFWL_Event* pEvent); | |
| 89 virtual void OnDrawWidget(CFX_Graphics* pGraphics, | |
| 90 const CFX_Matrix* pMatrix = NULL); | |
| 91 | 87 |
| 92 protected: | 88 protected: |
| 89 // CXFA_FFField |
| 90 FX_BOOL PtInActiveRect(FX_FLOAT fx, FX_FLOAT fy) override; |
| 91 FX_BOOL CommitData() override; |
| 92 FX_BOOL UpdateFWLData() override; |
| 93 FX_BOOL IsDataChanged() override; |
| 94 |
| 95 uint32_t GetAlignment(); |
| 96 void FWLEventSelChange(CXFA_EventParam* pParam); |
| 97 |
| 98 CFX_WideString m_wsNewValue; |
| 93 IFWL_WidgetDelegate* m_pOldDelegate; | 99 IFWL_WidgetDelegate* m_pOldDelegate; |
| 94 }; | 100 }; |
| 95 | 101 |
| 96 #endif // XFA_FXFA_APP_XFA_FFCHOICELIST_H_ | 102 #endif // XFA_FXFA_APP_XFA_FFCHOICELIST_H_ |
| OLD | NEW |