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_FWL_NOTEIMP_H_ | 7 #ifndef XFA_FWL_CORE_CFWL_NOTEDRIVER_H_ |
8 #define XFA_FWL_CORE_FWL_NOTEIMP_H_ | 8 #define XFA_FWL_CORE_CFWL_NOTEDRIVER_H_ |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
11 #include <memory> | 11 #include <memory> |
12 #include <unordered_map> | 12 #include <unordered_map> |
13 | 13 |
14 #include "xfa/fwl/core/cfwl_event.h" | 14 #include "xfa/fwl/core/cfwl_event.h" |
15 #include "xfa/fwl/core/ifwl_tooltip.h" | 15 #include "xfa/fwl/core/ifwl_tooltip.h" |
16 #include "xfa/fwl/core/ifwl_widget.h" | 16 #include "xfa/fwl/core/ifwl_widget.h" |
17 #include "xfa/fxgraphics/cfx_graphics.h" | 17 #include "xfa/fxgraphics/cfx_graphics.h" |
18 | 18 |
19 class CFWL_EventTarget; | 19 class CFWL_EventTarget; |
| 20 class CFWL_NoteLoop; |
20 class CFWL_TargetImp; | 21 class CFWL_TargetImp; |
21 class IFWL_ToolTip; | 22 class IFWL_ToolTip; |
22 class IFWL_Widget; | 23 class IFWL_Widget; |
23 | 24 |
24 class CFWL_NoteLoop { | |
25 public: | |
26 CFWL_NoteLoop(); | |
27 ~CFWL_NoteLoop() {} | |
28 | |
29 IFWL_Widget* GetForm() const { return m_pForm; } | |
30 bool ContinueModal() const { return m_bContinueModal; } | |
31 void EndModalLoop() { m_bContinueModal = false; } | |
32 void SetMainForm(IFWL_Widget* pForm) { m_pForm = pForm; } | |
33 | |
34 private: | |
35 IFWL_Widget* m_pForm; | |
36 bool m_bContinueModal; | |
37 }; | |
38 | |
39 class CFWL_NoteDriver { | 25 class CFWL_NoteDriver { |
40 public: | 26 public: |
41 CFWL_NoteDriver(); | 27 CFWL_NoteDriver(); |
42 ~CFWL_NoteDriver(); | 28 ~CFWL_NoteDriver(); |
43 | 29 |
44 void SendEvent(CFWL_Event* pNote); | 30 void SendEvent(CFWL_Event* pNote); |
45 | 31 |
46 void RegisterEventTarget(IFWL_Widget* pListener, | 32 void RegisterEventTarget(IFWL_Widget* pListener, |
47 IFWL_Widget* pEventSource = nullptr, | 33 IFWL_Widget* pEventSource = nullptr, |
48 uint32_t dwFilter = FWL_EVENT_ALL_MASK); | 34 uint32_t dwFilter = FWL_EVENT_ALL_MASK); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 CFX_ArrayTemplate<IFWL_Widget*> m_forms; | 72 CFX_ArrayTemplate<IFWL_Widget*> m_forms; |
87 std::deque<std::unique_ptr<CFWL_Message>> m_noteQueue; | 73 std::deque<std::unique_ptr<CFWL_Message>> m_noteQueue; |
88 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; | 74 CFX_ArrayTemplate<CFWL_NoteLoop*> m_noteLoopQueue; |
89 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; | 75 std::unordered_map<uint32_t, CFWL_EventTarget*> m_eventTargets; |
90 IFWL_Widget* m_pHover; | 76 IFWL_Widget* m_pHover; |
91 IFWL_Widget* m_pFocus; | 77 IFWL_Widget* m_pFocus; |
92 IFWL_Widget* m_pGrab; | 78 IFWL_Widget* m_pGrab; |
93 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; | 79 std::unique_ptr<CFWL_NoteLoop> m_pNoteLoop; |
94 }; | 80 }; |
95 | 81 |
96 class CFWL_EventTarget { | 82 #endif // XFA_FWL_CORE_CFWL_NOTEDRIVER_H_ |
97 public: | |
98 explicit CFWL_EventTarget(IFWL_Widget* pListener); | |
99 ~CFWL_EventTarget(); | |
100 | |
101 int32_t SetEventSource(IFWL_Widget* pSource, | |
102 uint32_t dwFilter = FWL_EVENT_ALL_MASK); | |
103 bool ProcessEvent(CFWL_Event* pEvent); | |
104 | |
105 bool IsInvalid() const { return m_bInvalid; } | |
106 void FlagInvalid() { m_bInvalid = true; } | |
107 | |
108 private: | |
109 bool IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) const; | |
110 | |
111 CFX_MapPtrTemplate<void*, uint32_t> m_eventSources; | |
112 IFWL_Widget* m_pListener; | |
113 bool m_bInvalid; | |
114 }; | |
115 | |
116 #endif // XFA_FWL_CORE_FWL_NOTEIMP_H_ | |
OLD | NEW |