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_CARET_H_ 8 #define _PWL_CARET_H_ 9 10 struct PWL_CARET_INFO 11 { 12 public: 13 PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0) 14 { 15 } 16 17 FX_BOOL bVisible; 18 CPDF_Point ptHead; 19 CPDF_Point ptFoot; 20 }; 21 22 23 class CPWL_Caret : public CPWL_Wnd 24 { 25 public: 26 CPWL_Caret(); 27 virtual ~CPWL_Caret(); 28 public: 29 virtual CFX_ByteString GetClassName() const; 30 virtual void GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream); 31 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); 32 virtual void InvalidateRect(CPDF_Rect * pRect = NULL); 33 34 virtual void SetVisible(FX_BOOL bVisible) {} 35 36 virtual void TimerProc(); 37 38 void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); 39 CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset); 40 41 private: 42 void GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset); 43 CPDF_Rect GetCaretRect() const; 44 45 FX_BOOL m_bFlash; 46 CPDF_Point m_ptHead; 47 CPDF_Point m_ptFoot; 48 FX_FLOAT m_fWidth; 49 FX_INT32 m_nDelay; 50 51 public: 52 void SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;} 53 private: 54 CPDF_Rect m_rcInvalid; 55 }; 56 57 #endif // !defined(AFX_PWL_CARET_H__6A729612_4173_4B65_BCAB_7C6C850ECA47__INCLUDED_) 58 59