Initial commit.
[pdfium.git] / fpdfsdk / include / pdfwindow / PWL_Caret.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4  \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _PWL_CARET_H_\r
8 #define _PWL_CARET_H_\r
9 \r
10 struct PWL_CARET_INFO\r
11 {\r
12 public:\r
13         PWL_CARET_INFO() : bVisible(FALSE), ptHead(0,0), ptFoot(0,0)\r
14         {               \r
15         }\r
16 \r
17         FX_BOOL                                         bVisible;\r
18         CPDF_Point                                      ptHead;\r
19         CPDF_Point                                      ptFoot;\r
20 };\r
21 \r
22 \r
23 class CPWL_Caret : public CPWL_Wnd  \r
24 {\r
25 public:\r
26         CPWL_Caret();\r
27         virtual ~CPWL_Caret();\r
28 public:\r
29         virtual CFX_ByteString          GetClassName() const;\r
30         virtual void                            GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream);\r
31         virtual void                            DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device);\r
32         virtual void                            InvalidateRect(CPDF_Rect * pRect = NULL);\r
33 \r
34         virtual void                            SetVisible(FX_BOOL bVisible) {}\r
35 \r
36         virtual void                            TimerProc();\r
37 \r
38         void                                            SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot);       \r
39         CFX_ByteString                          GetCaretAppearanceStream(const CPDF_Point & ptOffset);\r
40 \r
41 private:\r
42         void                                            GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset);\r
43         CPDF_Rect                                       GetCaretRect() const;\r
44 \r
45         FX_BOOL                                         m_bFlash;\r
46         CPDF_Point                                      m_ptHead;\r
47         CPDF_Point                                      m_ptFoot;\r
48         FX_FLOAT                                        m_fWidth;\r
49         FX_INT32                                                m_nDelay;\r
50 \r
51 public:\r
52         void                                            SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;}\r
53 private:\r
54         CPDF_Rect                                       m_rcInvalid;\r
55 };\r
56 \r
57 #endif // !defined(AFX_PWL_CARET_H__6A729612_4173_4B65_BCAB_7C6C850ECA47__INCLUDED_)\r
58 \r