OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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_CFWL_MESSAGE_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_MESSAGE_H_ |
8 #define XFA_FWL_CORE_CFWL_MESSAGE_H_ | 8 #define XFA_FWL_CORE_CFWL_MESSAGE_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "core/fxcrt/fx_basic.h" | 12 #include "core/fxcrt/fx_basic.h" |
13 #include "core/fxcrt/fx_string.h" | 13 #include "core/fxcrt/fx_string.h" |
14 #include "core/fxcrt/fx_system.h" | 14 #include "core/fxcrt/fx_system.h" |
15 #include "xfa/fwl/core/fwl_error.h" | 15 #include "xfa/fwl/core/fwl_error.h" |
16 | 16 |
17 enum class CFWL_MessageType { | |
18 None = 0, | |
19 Key, | |
20 KillFocus, | |
21 Mouse, | |
22 MouseWheel, | |
23 SetFocus | |
24 }; | |
25 | |
26 class CFWL_Widget; | 17 class CFWL_Widget; |
27 | 18 |
28 class CFWL_Message { | 19 class CFWL_Message { |
29 public: | 20 public: |
30 CFWL_Message(); | 21 enum class Type { Key, KillFocus, Mouse, MouseWheel, SetFocus }; |
| 22 |
| 23 explicit CFWL_Message(Type type); |
| 24 CFWL_Message(Type type, CFWL_Widget* pSrcTarget); |
| 25 CFWL_Message(Type type, CFWL_Widget* pSrcTarget, CFWL_Widget* pDstTarget); |
31 virtual ~CFWL_Message(); | 26 virtual ~CFWL_Message(); |
32 | 27 |
33 virtual std::unique_ptr<CFWL_Message> Clone(); | 28 virtual std::unique_ptr<CFWL_Message> Clone(); |
34 virtual CFWL_MessageType GetClassID() const; | 29 Type GetType() const { return m_type; } |
35 | 30 |
36 CFWL_Widget* m_pSrcTarget; | 31 CFWL_Widget* m_pSrcTarget; |
37 CFWL_Widget* m_pDstTarget; | 32 CFWL_Widget* m_pDstTarget; |
38 uint32_t m_dwExtend; | 33 uint32_t m_dwExtend; |
| 34 |
| 35 private: |
| 36 Type m_type; |
39 }; | 37 }; |
40 | 38 |
41 | 39 |
42 #endif // XFA_FWL_CORE_CFWL_MESSAGE_H_ | 40 #endif // XFA_FWL_CORE_CFWL_MESSAGE_H_ |
OLD | NEW |