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 _PWL_LISTCTRL_H_ 8 #define _PWL_LISTCTRL_H_ 9 10 class CPWL_ListCtrl; 11 12 class CPWL_ListCtrl : public CPWL_Wnd 13 { 14 public: 15 CPWL_ListCtrl(); 16 virtual ~CPWL_ListCtrl(); 17 18 public: 19 void SetScrollPos(const CPDF_Point& point); 20 CPDF_Point GetScrollPos() const; 21 CPDF_Rect GetScrollArea() const; 22 23 void SetItemSpace(FX_FLOAT fSpace); 24 void SetTopSpace(FX_FLOAT fSpace); 25 void SetBottomSpace(FX_FLOAT fSpace); 26 void ResetFace(); 27 void ResetContent(FX_INT32 nStart); 28 FX_INT32 GetItemIndex(CPWL_Wnd* pItem); 29 FX_FLOAT GetContentsHeight(FX_FLOAT fLimitWidth); 30 31 protected: 32 virtual void RePosChildWnd(); 33 virtual void DrawChildAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); 34 35 public: 36 CPDF_Point InToOut(const CPDF_Point& point) const; 37 CPDF_Point OutToIn(const CPDF_Point& point) const; 38 CPDF_Rect InToOut(const CPDF_Rect& rect) const; 39 CPDF_Rect OutToIn(const CPDF_Rect& rect) const; 40 41 private: 42 void ResetAll(FX_BOOL bMove,FX_INT32 nStart); 43 44 private: 45 CPDF_Rect m_rcContent; 46 CPDF_Point m_ptScroll; 47 FX_FLOAT m_fItemSpace; 48 FX_FLOAT m_fTopSpace; 49 FX_FLOAT m_fBottomSpace; 50 }; 51 52 #endif 53 54