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_CARET_H_
      8 #define FPDFSDK_INCLUDE_PDFWINDOW_PWL_CARET_H_
      9 
     10 #include "PWL_Wnd.h"
     11 
     12 struct PWL_CARET_INFO
     13 {
     14 public:
     15 	PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0)
     16 	{
     17 	}
     18 
     19 	FX_BOOL						bVisible;
     20 	CPDF_Point					ptHead;
     21 	CPDF_Point					ptFoot;
     22 };
     23 
     24 
     25 class CPWL_Caret : public CPWL_Wnd
     26 {
     27 public:
     28 	CPWL_Caret();
     29 	virtual ~CPWL_Caret();
     30 
     31 	virtual CFX_ByteString		GetClassName() const;
     32 	virtual void				GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);
     33 	virtual void				DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);
     34 	virtual void				InvalidateRect(CPDF_Rect * pRect = NULL);
     35 	virtual void				SetVisible(FX_BOOL bVisible) {}
     36 	virtual	void				TimerProc();
     37 	void						SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);
     38 	CFX_ByteString				GetCaretAppearanceStream(const CPDF_Point & ptOffset);
     39 	void						SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;}
     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 	CPDF_Rect					m_rcInvalid;
     51 };
     52 
     53 #endif  // FPDFSDK_INCLUDE_PDFWINDOW_PWL_CARET_H_
     54