Mir
fake_input_device.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 or 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_FRAMEWORK_FAKE_INPUT_DEVICE_H_
20 #define MIR_TEST_FRAMEWORK_FAKE_INPUT_DEVICE_H_
21 
23 #include "mir/test/event_factory.h"
24 #include <chrono>
25 #include <functional>
26 
27 namespace mir
28 {
29 namespace input
30 {
31 class InputDevice;
32 }
33 }
34 
35 namespace mir_test_framework
36 {
37 
39 {
40 public:
46  static const int maximum_touch_axis_value = 0xFFFF;
47  static const int minimum_touch_axis_value = 0;
49 
50  FakeInputDevice() = default;
51  virtual ~FakeInputDevice() = default;
52 
53 
54  virtual void emit_device_removal() = 0;
55  virtual void emit_runtime_error() = 0;
56  virtual void emit_event(mir::input::synthesis::KeyParameters const& key) = 0;
57  virtual void emit_event(mir::input::synthesis::ButtonParameters const& button) = 0;
58  virtual void emit_event(mir::input::synthesis::MotionParameters const& motion) = 0;
59  virtual void emit_event(mir::input::synthesis::TouchParameters const& touch) = 0;
60  virtual void emit_touch_sequence(std::function<mir::input::synthesis::TouchParameters(int)> const& generate_parameters,
61  int count,
62  std::chrono::duration<double> delay) = 0;
63  virtual void on_new_configuration_do(std::function<void(mir::input::InputDevice const& device)> callback) = 0;
64 
65  FakeInputDevice(FakeInputDevice const&) = delete;
66  FakeInputDevice& operator=(FakeInputDevice const&) = delete;
67 };
68 
69 }
70 
71 #endif
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Definition: event_factory.h:36
Definition: event_factory.h:52
Definition: event_factory.h:67
Definition: fake_input_device.h:38
Definition: event_factory.h:80
Definition: any_surface.h:25

Copyright © 2012-2017 Canonical Ltd.
Generated on Mon Oct 30 19:44:55 UTC 2017