OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 7 #ifndef XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
8 #define XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 8 #define XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
9 | 9 |
10 #include "xfa/fwl/core/fwl_widgetimp.h" | 10 #include "xfa/fwl/core/fwl_widgetimp.h" |
11 #include "xfa/fwl/core/ifwl_timer.h" | 11 #include "xfa/fwl/core/ifwl_timer.h" |
12 #include "xfa/fxgraphics/cfx_color.h" | 12 #include "xfa/fxgraphics/cfx_color.h" |
13 | 13 |
14 class CFWL_WidgetImpProperties; | 14 class CFWL_WidgetImpProperties; |
15 class IFWL_Widget; | 15 class IFWL_Widget; |
16 class CFWL_CaretImpDelegate; | 16 class CFWL_CaretImpDelegate; |
17 | 17 |
18 class CFWL_CaretImp : public CFWL_WidgetImp { | 18 class CFWL_CaretImp : public CFWL_WidgetImp { |
19 public: | 19 public: |
20 CFWL_CaretImp(const CFWL_WidgetImpProperties& properties, | 20 CFWL_CaretImp(const CFWL_WidgetImpProperties& properties, |
21 IFWL_Widget* pOuter); | 21 IFWL_Widget* pOuter); |
22 virtual ~CFWL_CaretImp(); | 22 virtual ~CFWL_CaretImp(); |
23 | 23 |
24 virtual FWL_ERR GetClassName(CFX_WideString& wsClass) const; | 24 virtual FWL_Error GetClassName(CFX_WideString& wsClass) const; |
25 virtual uint32_t GetClassID() const; | 25 virtual uint32_t GetClassID() const; |
26 | 26 |
27 virtual FWL_ERR Initialize(); | 27 virtual FWL_Error Initialize(); |
28 virtual FWL_ERR Finalize(); | 28 virtual FWL_Error Finalize(); |
29 | 29 |
30 virtual FWL_ERR DrawWidget(CFX_Graphics* pGraphics, | 30 virtual FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
31 const CFX_Matrix* pMatrix = NULL); | 31 const CFX_Matrix* pMatrix = NULL); |
32 | 32 |
33 virtual FWL_ERR ShowCaret(FX_BOOL bFlag = TRUE); | 33 virtual FWL_Error ShowCaret(FX_BOOL bFlag = TRUE); |
34 virtual FWL_ERR GetFrequency(uint32_t& elapse); | 34 virtual FWL_Error GetFrequency(uint32_t& elapse); |
35 virtual FWL_ERR SetFrequency(uint32_t elapse); | 35 virtual FWL_Error SetFrequency(uint32_t elapse); |
36 virtual FWL_ERR SetColor(CFX_Color crFill); | 36 virtual FWL_Error SetColor(CFX_Color crFill); |
37 | 37 |
38 protected: | 38 protected: |
39 FX_BOOL DrawCaretBK(CFX_Graphics* pGraphics, | 39 void DrawCaretBK(CFX_Graphics* pGraphics, |
40 IFWL_ThemeProvider* pTheme, | 40 IFWL_ThemeProvider* pTheme, |
41 const CFX_Matrix* pMatrix); | 41 const CFX_Matrix* pMatrix); |
42 class CFWL_CaretTimer : public IFWL_Timer { | 42 class CFWL_CaretTimer : public IFWL_Timer { |
43 public: | 43 public: |
44 explicit CFWL_CaretTimer(CFWL_CaretImp* pCaret); | 44 explicit CFWL_CaretTimer(CFWL_CaretImp* pCaret); |
45 ~CFWL_CaretTimer() override {} | 45 ~CFWL_CaretTimer() override {} |
46 int32_t Run(FWL_HTIMER hTimer) override; | 46 int32_t Run(FWL_HTIMER hTimer) override; |
47 CFWL_CaretImp* const m_pCaret; | 47 CFWL_CaretImp* const m_pCaret; |
48 }; | 48 }; |
49 CFWL_CaretTimer* m_pTimer; | 49 CFWL_CaretTimer* m_pTimer; |
50 FWL_HTIMER m_hTimer; | 50 FWL_HTIMER m_hTimer; |
51 uint32_t m_dwElapse; | 51 uint32_t m_dwElapse; |
52 CFX_Color m_crFill; | 52 CFX_Color m_crFill; |
53 FX_BOOL m_bSetColor; | 53 FX_BOOL m_bSetColor; |
54 friend class CFWL_CaretImpDelegate; | 54 friend class CFWL_CaretImpDelegate; |
55 friend class CFWL_CaretTimer; | 55 friend class CFWL_CaretTimer; |
56 }; | 56 }; |
57 class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { | 57 class CFWL_CaretImpDelegate : public CFWL_WidgetImpDelegate { |
58 public: | 58 public: |
59 CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner); | 59 CFWL_CaretImpDelegate(CFWL_CaretImp* pOwner); |
60 int32_t OnProcessMessage(CFWL_Message* pMessage) override; | 60 void OnProcessMessage(CFWL_Message* pMessage) override; |
61 FWL_ERR OnDrawWidget(CFX_Graphics* pGraphics, | 61 void OnDrawWidget(CFX_Graphics* pGraphics, |
62 const CFX_Matrix* pMatrix = NULL) override; | 62 const CFX_Matrix* pMatrix = NULL) override; |
63 | 63 |
64 protected: | 64 protected: |
65 CFWL_CaretImp* m_pOwner; | 65 CFWL_CaretImp* m_pOwner; |
66 }; | 66 }; |
67 | 67 |
68 #endif // XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ | 68 #endif // XFA_FWL_BASEWIDGET_FWL_CARETIMP_H_ |
OLD | NEW |