Mir
mir_input_config.h
Go to the documentation of this file.
1 
19 #ifndef MIR_INPUT_INPUT_CONFIGURATION_H
20 #define MIR_INPUT_INPUT_CONFIGURATION_H
21 
24 
25 #include <memory>
26 #include <vector>
27 #include <string>
28 #include <iosfwd>
29 #include <functional>
30 
31 struct MirPointerConfig;
32 struct MirTouchpadConfig;
33 struct MirKeyboardConfig;
35 
37 {
38 public:
40  MirInputDevice(MirInputDeviceId id, mir::input::DeviceCapabilities caps, std::string const& name, std::string const& unique_id);
42  MirInputDevice(MirInputDevice const& conf);
45 
46  MirInputDeviceId id() const;
48  std::string const& name() const;
49  std::string const& unique_id() const;
50 
51  bool has_touchpad_config() const;
53  MirTouchpadConfig const& touchpad_config() const;
54  void set_touchpad_config(MirTouchpadConfig const& conf);
55 
56  bool has_keyboard_config() const;
58  MirKeyboardConfig const& keyboard_config() const;
59  void set_keyboard_config(MirKeyboardConfig const& conf);
60 
61  bool has_pointer_config() const;
63  MirPointerConfig const& pointer_config() const;
64  void set_pointer_config(MirPointerConfig const& conf);
65 
66  bool has_touchscreen_config() const;
70 
71  bool operator==(MirInputDevice const& rhs) const;
72  bool operator!=(MirInputDevice const& rhs) const;
73 private:
74  struct Implementation;
75  std::unique_ptr<Implementation> impl;
76 };
77 
78 // We use "struct", not "class" for consistency with mirclient/mir_toolkit/client_types.h:395
79 // (To be nice to downstreams that use clang with its pointless warnings about this.)
81 {
82 public:
85  MirInputConfig(MirInputConfig const& conf);
87  ~MirInputConfig();
88 
89  void add_device_config(MirInputDevice const& conf);
90  MirInputDevice* get_device_config_by_id(MirInputDeviceId id);
91  MirInputDevice const* get_device_config_by_id(MirInputDeviceId id) const;
92  MirInputDevice& get_device_config_by_index(size_t pos);
93  MirInputDevice const& get_device_config_by_index(size_t pos) const;
94  void remove_device_by_id(MirInputDeviceId id);
95  size_t size() const;
96 
97  void for_each(std::function<void(MirInputDevice const&)> const& visitor) const;
98  void for_each(std::function<void(MirInputDevice &)> const& visitor);
99  bool operator==(MirInputConfig const& rhs) const;
100  bool operator!=(MirInputConfig const& rhs) const;
102 private:
103  struct Implementation;
104  std::unique_ptr<Implementation> impl;
105 };
106 
107 std::ostream& operator<<(std::ostream&, MirInputDevice const&);
108 std::ostream& operator<<(std::ostream&, MirInputConfig const&);
109 
110 #endif
MirPointerConfig & pointer_config()
bool operator==(MirInputDevice const &rhs) const
MirInputDeviceId id() const
bool has_pointer_config() const
Definition: mir_keyboard_config.h:33
Definition: mir_touchscreen_config.h:28
bool has_keyboard_config() const
MirTouchscreenConfig & touchscreen_config()
std::ostream & operator<<(std::ostream &, MirInputDevice const &)
void set_keyboard_config(MirKeyboardConfig const &conf)
MirInputDevice & operator=(MirInputDevice const &conf)
bool has_touchpad_config() const
std::string const & name() const
void set_pointer_config(MirPointerConfig const &conf)
int64_t MirInputDeviceId
Definition: mir_input_device_types.h:31
mir::input::DeviceCapabilities capabilities() const
void set_touchscreen_config(MirTouchscreenConfig const &conf)
MirKeyboardConfig & keyboard_config()
Definition: mir_pointer_config.h:29
void set_touchpad_config(MirTouchpadConfig const &conf)
MirTouchpadConfig & touchpad_config()
Definition: mir_touchpad_config.h:29
bool operator!=(MirInputDevice const &rhs) const
struct MirInputConfig MirInputConfig
Definition: client_types.h:406
std::string const & unique_id() const
Definition: mir_input_config.h:36
bool has_touchscreen_config() const
Definition: mir_input_config.h:80

Copyright © 2012-2018 Canonical Ltd.
Generated on Tue Feb 20 03:16:44 UTC 2018