Android-cuttlefish cvd tool
custom_actions.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 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 <optional>
19#include <string>
20#include <vector>
21
22#include <fruit/fruit.h>
23
27
28namespace cuttlefish {
29
31 std::string command;
32 std::string title;
33 std::string icon_name;
34};
35
37 std::optional<bool> lid_switch_open;
38 std::optional<int> hinge_angle_value;
39};
40
42 std::string instance_id;
43};
44
47 std::string shell_command;
48};
49
51 std::string server;
52 std::vector<ControlPanelButton> buttons;
53};
54
57 std::vector<DeviceState> device_states;
58};
59
61 public:
62 virtual const std::vector<CustomShellActionConfig> CustomShellActions(
63 const std::string& id_str = std::string()) const = 0;
64 virtual const std::vector<CustomActionServerConfig> CustomActionServers(
65 const std::string& id_str = std::string()) const = 0;
66 virtual const std::vector<CustomDeviceStateActionConfig>
67 CustomDeviceStateActions(const std::string& id_str = std::string()) const = 0;
68};
69
70fruit::Component<fruit::Required<ConfigFlag>, CustomActionConfigProvider>
72
73} // namespace cuttlefish
Definition: config_fragment.h:24
Definition: custom_actions.h:60
virtual const std::vector< CustomActionServerConfig > CustomActionServers(const std::string &id_str=std::string()) const =0
virtual const std::vector< CustomDeviceStateActionConfig > CustomDeviceStateActions(const std::string &id_str=std::string()) const =0
virtual const std::vector< CustomShellActionConfig > CustomShellActions(const std::string &id_str=std::string()) const =0
Definition: feature.h:114
Definition: alloc_utils.cpp:23
fruit::Component< fruit::Required< ConfigFlag >, CustomActionConfigProvider > CustomActionsComponent()
Definition: custom_actions.cpp:447
Definition: custom_actions.h:30
std::string command
Definition: custom_actions.h:31
std::string title
Definition: custom_actions.h:32
std::string icon_name
Definition: custom_actions.h:33
Definition: custom_actions.h:41
std::string instance_id
Definition: custom_actions.h:42
Definition: custom_actions.h:50
std::string server
Definition: custom_actions.h:51
std::vector< ControlPanelButton > buttons
Definition: custom_actions.h:52
Definition: custom_actions.h:55
ControlPanelButton button
Definition: custom_actions.h:56
std::vector< DeviceState > device_states
Definition: custom_actions.h:57
Definition: custom_actions.h:45
ControlPanelButton button
Definition: custom_actions.h:46
std::string shell_command
Definition: custom_actions.h:47
Definition: custom_actions.h:36
std::optional< bool > lid_switch_open
Definition: custom_actions.h:37
std::optional< int > hinge_angle_value
Definition: custom_actions.h:38