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_PWL_CPWL_CARET_H_ 8 #define FPDFSDK_PWL_CPWL_CARET_H_ 9 10 #include "fpdfsdk/pwl/cpwl_wnd.h" 11 12 class CPWL_Caret : public CPWL_Wnd { 13 public: 14 CPWL_Caret(); 15 ~CPWL_Caret() override; 16 17 // CPWL_Wnd 18 ByteString GetClassName() const override; 19 void DrawThisAppearance(CFX_RenderDevice* pDevice, 20 const CFX_Matrix& mtUser2Device) override; 21 bool InvalidateRect(CFX_FloatRect* pRect) override; 22 bool SetVisible(bool bVisible) override; 23 void TimerProc() override; 24 25 void SetCaret(bool bVisible, 26 const CFX_PointF& ptHead, 27 const CFX_PointF& ptFoot); SetInvalidRect(CFX_FloatRect rc)28 void SetInvalidRect(CFX_FloatRect rc) { m_rcInvalid = rc; } 29 30 private: 31 CFX_FloatRect GetCaretRect() const; 32 33 bool m_bFlash; 34 CFX_PointF m_ptHead; 35 CFX_PointF m_ptFoot; 36 float m_fWidth; 37 int32_t m_nDelay; 38 CFX_FloatRect m_rcInvalid; 39 }; 40 41 #endif // FPDFSDK_PWL_CPWL_CARET_H_ 42