Android-cuttlefish cvd tool
input_connections_provider.h
Go to the documentation of this file.
1//
2// Copyright (C) 2024 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#pragma once
17
18#include <vector>
19
24
25namespace cuttlefish {
26
27// Feature that provides access to the connections to the input devices.
28// Such connections are file descriptors over which (virtio_) input events can
29// be written to inject them to the VM and (virtio_) status updates can be read.
30class InputConnectionsProvider : public virtual SetupFeature {
31 public:
32 virtual ~InputConnectionsProvider() = default;
33
34 virtual SharedFD RotaryDeviceConnection() const = 0;
35 virtual SharedFD MouseConnection() const = 0;
36 virtual SharedFD GamepadConnection() const = 0;
37 virtual SharedFD KeyboardConnection() const = 0;
38 virtual SharedFD SwitchesConnection() const = 0;
39 virtual std::vector<SharedFD> TouchscreenConnections() const = 0;
40 virtual std::vector<SharedFD> TouchpadConnections() const = 0;
41};
42
43fruit::Component<fruit::Required<const CuttlefishConfig::InstanceSpecific>,
46
47} // namespace cuttlefish
48
Definition: input_connections_provider.h:30
virtual SharedFD MouseConnection() const =0
virtual std::vector< SharedFD > TouchpadConnections() const =0
virtual std::vector< SharedFD > TouchscreenConnections() const =0
virtual SharedFD KeyboardConnection() const =0
virtual SharedFD RotaryDeviceConnection() const =0
virtual SharedFD GamepadConnection() const =0
virtual SharedFD SwitchesConnection() const =0
virtual ~InputConnectionsProvider()=default
Definition: log_tee_creator.h:28
Definition: feature.h:48
Definition: shared_fd.h:129
Definition: alloc_utils.cpp:23
fruit::Component< fruit::Required< const CuttlefishConfig::InstanceSpecific >, InputConnectionsProvider, LogTeeCreator > VhostInputDevicesComponent()
Definition: vhost_input_devices.cpp:332