| 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 FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ | 7 #ifndef FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ |
| 8 #define FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ | 8 #define FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ |
| 9 | 9 |
| 10 #include "fpdfsdk/fxedit/fx_edit.h" | 10 #include "fpdfsdk/fxedit/fx_edit.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 void IOnSetScrollInfoY(FX_FLOAT fPlateMin, | 26 void IOnSetScrollInfoY(FX_FLOAT fPlateMin, |
| 27 FX_FLOAT fPlateMax, | 27 FX_FLOAT fPlateMax, |
| 28 FX_FLOAT fContentMin, | 28 FX_FLOAT fContentMin, |
| 29 FX_FLOAT fContentMax, | 29 FX_FLOAT fContentMax, |
| 30 FX_FLOAT fSmallStep, | 30 FX_FLOAT fSmallStep, |
| 31 FX_FLOAT fBigStep); | 31 FX_FLOAT fBigStep); |
| 32 void IOnSetScrollPosY(FX_FLOAT fy); | 32 void IOnSetScrollPosY(FX_FLOAT fy); |
| 33 void IOnInvalidateRect(CFX_FloatRect* pRect); | 33 void IOnInvalidateRect(CFX_FloatRect* pRect); |
| 34 | 34 |
| 35 void IOnSetCaret(FX_BOOL bVisible, | 35 void IOnSetCaret(bool bVisible, |
| 36 const CFX_FloatPoint& ptHead, | 36 const CFX_FloatPoint& ptHead, |
| 37 const CFX_FloatPoint& ptFoot, | 37 const CFX_FloatPoint& ptFoot, |
| 38 const CPVT_WordPlace& place); | 38 const CPVT_WordPlace& place); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 CPWL_ListBox* m_pList; | 41 CPWL_ListBox* m_pList; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class CPWL_ListBox : public CPWL_Wnd { | 44 class CPWL_ListBox : public CPWL_Wnd { |
| 45 public: | 45 public: |
| 46 CPWL_ListBox(); | 46 CPWL_ListBox(); |
| 47 ~CPWL_ListBox() override; | 47 ~CPWL_ListBox() override; |
| 48 | 48 |
| 49 // CPWL_Wnd | 49 // CPWL_Wnd |
| 50 CFX_ByteString GetClassName() const override; | 50 CFX_ByteString GetClassName() const override; |
| 51 void OnCreated() override; | 51 void OnCreated() override; |
| 52 void OnDestroy() override; | 52 void OnDestroy() override; |
| 53 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; | 53 void GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) override; |
| 54 void DrawThisAppearance(CFX_RenderDevice* pDevice, | 54 void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 55 CFX_Matrix* pUser2Device) override; | 55 CFX_Matrix* pUser2Device) override; |
| 56 FX_BOOL OnKeyDown(uint16_t nChar, uint32_t nFlag) override; | 56 bool OnKeyDown(uint16_t nChar, uint32_t nFlag) override; |
| 57 FX_BOOL OnChar(uint16_t nChar, uint32_t nFlag) override; | 57 bool OnChar(uint16_t nChar, uint32_t nFlag) override; |
| 58 FX_BOOL OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override; | 58 bool OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) override; |
| 59 FX_BOOL OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override; | 59 bool OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) override; |
| 60 FX_BOOL OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override; | 60 bool OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) override; |
| 61 FX_BOOL OnMouseWheel(short zDelta, | 61 bool OnMouseWheel(short zDelta, |
| 62 const CFX_FloatPoint& point, | 62 const CFX_FloatPoint& point, |
| 63 uint32_t nFlag) override; | 63 uint32_t nFlag) override; |
| 64 void KillFocus() override; | 64 void KillFocus() override; |
| 65 void OnNotify(CPWL_Wnd* pWnd, | 65 void OnNotify(CPWL_Wnd* pWnd, |
| 66 uint32_t msg, | 66 uint32_t msg, |
| 67 intptr_t wParam = 0, | 67 intptr_t wParam = 0, |
| 68 intptr_t lParam = 0) override; | 68 intptr_t lParam = 0) override; |
| 69 void RePosChildWnd() override; | 69 void RePosChildWnd() override; |
| 70 CFX_FloatRect GetFocusRect() const override; | 70 CFX_FloatRect GetFocusRect() const override; |
| 71 void SetFontSize(FX_FLOAT fFontSize) override; | 71 void SetFontSize(FX_FLOAT fFontSize) override; |
| 72 FX_FLOAT GetFontSize() const override; | 72 FX_FLOAT GetFontSize() const override; |
| 73 | 73 |
| 74 virtual CFX_WideString GetText() const; | 74 virtual CFX_WideString GetText() const; |
| 75 | 75 |
| 76 void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL& bExit, uint32_t nFlag); | 76 void OnNotifySelChanged(bool bKeyDown, bool& bExit, uint32_t nFlag); |
| 77 | 77 |
| 78 void AddString(const CFX_WideString& str); | 78 void AddString(const CFX_WideString& str); |
| 79 void SetTopVisibleIndex(int32_t nItemIndex); | 79 void SetTopVisibleIndex(int32_t nItemIndex); |
| 80 void ScrollToListItem(int32_t nItemIndex); | 80 void ScrollToListItem(int32_t nItemIndex); |
| 81 void ResetContent(); | 81 void ResetContent(); |
| 82 void Reset(); | 82 void Reset(); |
| 83 void Select(int32_t nItemIndex); | 83 void Select(int32_t nItemIndex); |
| 84 void SetCaret(int32_t nItemIndex); | 84 void SetCaret(int32_t nItemIndex); |
| 85 void SetHoverSel(FX_BOOL bHoverSel); | 85 void SetHoverSel(bool bHoverSel); |
| 86 | 86 |
| 87 int32_t GetCount() const; | 87 int32_t GetCount() const; |
| 88 FX_BOOL IsMultipleSel() const; | 88 bool IsMultipleSel() const; |
| 89 int32_t GetCaretIndex() const; | 89 int32_t GetCaretIndex() const; |
| 90 int32_t GetCurSel() const; | 90 int32_t GetCurSel() const; |
| 91 FX_BOOL IsItemSelected(int32_t nItemIndex) const; | 91 bool IsItemSelected(int32_t nItemIndex) const; |
| 92 int32_t GetTopVisibleIndex() const; | 92 int32_t GetTopVisibleIndex() const; |
| 93 int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const; | 93 int32_t FindNext(int32_t nIndex, FX_WCHAR nChar) const; |
| 94 CFX_FloatRect GetContentRect() const; | 94 CFX_FloatRect GetContentRect() const; |
| 95 FX_FLOAT GetFirstHeight() const; | 95 FX_FLOAT GetFirstHeight() const; |
| 96 CFX_FloatRect GetListRect() const; | 96 CFX_FloatRect GetListRect() const; |
| 97 | 97 |
| 98 void SetFillerNotify(IPWL_Filler_Notify* pNotify) { | 98 void SetFillerNotify(IPWL_Filler_Notify* pNotify) { |
| 99 m_pFillerNotify = pNotify; | 99 m_pFillerNotify = pNotify; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; } | 102 void AttachFFLData(CFFL_FormFiller* pData) { m_pFormFiller = pData; } |
| 103 | 103 |
| 104 protected: | 104 protected: |
| 105 std::unique_ptr<CFX_ListCtrl> m_pList; | 105 std::unique_ptr<CFX_ListCtrl> m_pList; |
| 106 std::unique_ptr<CPWL_List_Notify> m_pListNotify; | 106 std::unique_ptr<CPWL_List_Notify> m_pListNotify; |
| 107 FX_BOOL m_bMouseDown; | 107 bool m_bMouseDown; |
| 108 FX_BOOL m_bHoverSel; | 108 bool m_bHoverSel; |
| 109 IPWL_Filler_Notify* m_pFillerNotify; | 109 IPWL_Filler_Notify* m_pFillerNotify; |
| 110 | 110 |
| 111 private: | 111 private: |
| 112 CFFL_FormFiller* m_pFormFiller; // Not owned. | 112 CFFL_FormFiller* m_pFormFiller; // Not owned. |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 #endif // FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ | 115 #endif // FPDFSDK_PDFWINDOW_PWL_LISTBOX_H_ |
| OLD | NEW |