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