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_CORE_IFWL_CARET_H_ | 7 #ifndef XFA_FWL_CORE_IFWL_CARET_H_ |
8 #define XFA_FWL_CORE_IFWL_CARET_H_ | 8 #define XFA_FWL_CORE_IFWL_CARET_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "xfa/fwl/core/ifwl_timer.h" | 12 #include "xfa/fwl/core/ifwl_timer.h" |
13 #include "xfa/fwl/core/ifwl_widget.h" | 13 #include "xfa/fwl/core/ifwl_widget.h" |
14 #include "xfa/fxgraphics/cfx_color.h" | 14 #include "xfa/fxgraphics/cfx_color.h" |
15 | 15 |
16 class CFWL_WidgetImpProperties; | 16 class CFWL_WidgetImpProperties; |
17 class IFWL_Widget; | 17 class IFWL_Widget; |
18 class CFWL_CaretImpDelegate; | 18 class CFWL_CaretImpDelegate; |
19 | 19 |
20 #define FWL_CLASS_Caret L"FWL_CARET" | |
21 #define FWL_STATE_CAT_HightLight 1 | 20 #define FWL_STATE_CAT_HightLight 1 |
22 | 21 |
23 class IFWL_Caret : public IFWL_Widget { | 22 class IFWL_Caret : public IFWL_Widget { |
24 public: | 23 public: |
25 IFWL_Caret(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); | 24 IFWL_Caret(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter); |
26 ~IFWL_Caret() override; | 25 ~IFWL_Caret() override; |
27 | 26 |
28 // IFWL_Widget | 27 // IFWL_Widget |
29 FWL_Error GetClassName(CFX_WideString& wsClass) const override; | |
30 FWL_Type GetClassID() const override; | 28 FWL_Type GetClassID() const override; |
31 FWL_Error Initialize() override; | 29 FWL_Error Initialize() override; |
32 FWL_Error Finalize() override; | 30 void Finalize() override; |
33 FWL_Error DrawWidget(CFX_Graphics* pGraphics, | 31 FWL_Error DrawWidget(CFX_Graphics* pGraphics, |
34 const CFX_Matrix* pMatrix = nullptr) override; | 32 const CFX_Matrix* pMatrix = nullptr) override; |
35 | 33 |
36 void ShowCaret(FX_BOOL bFlag = TRUE); | 34 void ShowCaret(FX_BOOL bFlag = TRUE); |
37 FWL_Error GetFrequency(uint32_t& elapse); | 35 FWL_Error GetFrequency(uint32_t& elapse); |
38 FWL_Error SetFrequency(uint32_t elapse); | 36 FWL_Error SetFrequency(uint32_t elapse); |
39 FWL_Error SetColor(CFX_Color crFill); | 37 FWL_Error SetColor(CFX_Color crFill); |
40 | 38 |
41 protected: | 39 protected: |
42 friend class CFWL_CaretImpDelegate; | 40 friend class CFWL_CaretImpDelegate; |
(...skipping 23 matching lines...) Expand all Loading... |
66 CFWL_CaretImpDelegate(IFWL_Caret* pOwner); | 64 CFWL_CaretImpDelegate(IFWL_Caret* pOwner); |
67 void OnProcessMessage(CFWL_Message* pMessage) override; | 65 void OnProcessMessage(CFWL_Message* pMessage) override; |
68 void OnDrawWidget(CFX_Graphics* pGraphics, | 66 void OnDrawWidget(CFX_Graphics* pGraphics, |
69 const CFX_Matrix* pMatrix = nullptr) override; | 67 const CFX_Matrix* pMatrix = nullptr) override; |
70 | 68 |
71 protected: | 69 protected: |
72 IFWL_Caret* m_pOwner; | 70 IFWL_Caret* m_pOwner; |
73 }; | 71 }; |
74 | 72 |
75 #endif // XFA_FWL_CORE_IFWL_CARET_H_ | 73 #endif // XFA_FWL_CORE_IFWL_CARET_H_ |
OLD | NEW |