OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_EVENTS_EVENT_REWRITER_H_ | |
6 #define UI_EVENTS_EVENT_REWRITER_H_ | |
7 | |
8 #include "ui/events/events_export.h" | |
9 | |
10 namespace ui { | |
11 | |
12 class Event; | |
13 | |
14 enum EventRewriteStatus { | |
15 EVENT_REWRITE_CONTINUE, | |
16 EVENT_REWRITE_REWRITTEN, | |
17 EVENT_REWRITE_DISCARD, | |
18 EVENT_REWRITE_DISPATCH_ANOTHER, | |
sadrul
2014/03/24 21:15:38
Comments for each to explain what they mean.
| |
19 }; | |
20 | |
21 class EVENTS_EXPORT EventRewriter { | |
sadrul
2014/03/24 21:15:38
A brief class-level comment to give an overview of
| |
22 public: | |
23 virtual ~EventRewriter() {} | |
24 | |
25 // If the rewriter wants to rewrite an event, and dispatch | |
26 // another event once the rewritten event is dispatched, it | |
27 // should return EVENT_REWRITE_DISPATCH_ANOTHER, and return | |
28 // the next event to dispatch from |NextDispatchEvent()|. | |
29 virtual EventRewriteStatus RewriteEvent(const Event& event, | |
30 Event** rewritten_event) = 0; | |
31 | |
32 virtual EventRewriteStatus NextDispatchEvent(const Event& last_event, | |
33 Event** new_event) = 0; | |
34 }; | |
35 | |
36 } // namespace ui | |
37 | |
38 #endif // UI_EVENTS_EVENT_REWRITER_H_ | |
OLD | NEW |