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