Mir
default_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 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:
17  * Andreas Pokorny <andreas.pokorny@canonical.com>
18  */
19 
20 #ifndef MIR_INPUT_DEFAULT_DEVICE_H_
21 #define MIR_INPUT_DEFAULT_DEVICE_H_
22 
23 #include "mir_toolkit/event.h"
24 #include "mir/input/device.h"
29 #include "mir/optional_value.h"
30 
31 #include <memory>
32 
33 namespace mir
34 {
35 namespace dispatch
36 {
37 class ActionQueue;
38 }
39 namespace input
40 {
41 
42 class KeyMapper;
43 class InputDevice;
44 
45 class DefaultDevice : public Device
46 {
47 public:
48  DefaultDevice(MirInputDeviceId id, std::shared_ptr<dispatch::ActionQueue> const& actions,
49  InputDevice& device, std::shared_ptr<KeyMapper> const& key_mapper);
50  MirInputDeviceId id() const override;
51  DeviceCapabilities capabilities() const override;
52  std::string name() const override;
53  std::string unique_id() const override;
54 
55  optional_value<PointerConfiguration> pointer_configuration() const override;
56  void apply_pointer_configuration(PointerConfiguration const&) override;
57  optional_value<TouchpadConfiguration> touchpad_configuration() const override;
58  void apply_touchpad_configuration(TouchpadConfiguration const&) override;
59  optional_value<KeyboardConfiguration> keyboard_configuration() const override;
60  void apply_keyboard_configuration(KeyboardConfiguration const&) override;
61 private:
62  MirInputDeviceId const device_id;
63  InputDevice& device;
64  InputDeviceInfo const info;
68  std::shared_ptr<dispatch::ActionQueue> const actions;
69  std::shared_ptr<KeyMapper> const key_mapper;
70 };
71 
72 }
73 }
74 
75 #endif
Definition: pointer_configuration.h:32
All things Mir.
Definition: atomic_callback.h:25
Represents an input device.
Definition: input_device.h:46
Definition: keyboard_configuration.h:35
Definition: touchpad_configuration.h:31
int64_t MirInputDeviceId
Definition: input_event.h:35
Definition: optional_value.h:28
Definition: input_device_info.h:32
Definition: device.h:38
Definition: default_device.h:45

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016