summaryrefslogtreecommitdiffstats
path: root/ui/base/events/event_handler.h
blob: 3e2e9c52405dcc8bbb3d6128f9af6fb7eb3768d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_BASE_EVENTS_EVENT_HANDLER_H_
#define UI_BASE_EVENTS_EVENT_HANDLER_H_

#include <vector>

#include "ui/base/events/event_constants.h"
#include "ui/base/ui_export.h"

namespace ui {

class GestureEvent;
class KeyEvent;
class MouseEvent;
class ScrollEvent;
class TouchEvent;

class EventTarget;

// Dispatches events to appropriate targets.
class UI_EXPORT EventHandler {
 public:
  EventHandler() {}
  virtual ~EventHandler() {}

  virtual EventResult OnKeyEvent(KeyEvent* event) = 0;

  virtual EventResult OnMouseEvent(MouseEvent* event) = 0;

  virtual EventResult OnScrollEvent(ScrollEvent* event) = 0;

  virtual TouchStatus OnTouchEvent(TouchEvent* event) = 0;

  virtual EventResult OnGestureEvent(GestureEvent* event) = 0;
};

typedef std::vector<EventHandler*> EventHandlerList;

}  // namespace ui

#endif  // UI_BASE_EVENTS_EVENT_HANDLER_H_