#ifndef ASH_SYSTEM_INPUT_DEVICE_SETTINGS_INPUT_DEVICE_SETTINGS_METADATA_H_
#define ASH_SYSTEM_INPUT_DEVICE_SETTINGS_INPUT_DEVICE_SETTINGS_METADATA_H_
#include "ash/ash_export.h"
#include "ash/public/mojom/input_device_settings.mojom-shared.h"
#include "ash/public/mojom/input_device_settings.mojom.h"
#include "ash/system/input_device_settings/input_device_settings_utils.h"
#include "base/containers/flat_map.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/devices/keyboard_device.h"
namespace ash {
enum class DeviceType {
kUnknown = 0,
kKeyboard = 1,
kKeyboardMouseCombo = 2,
kMouse = 3,
};
enum class MetadataTier {
kNoMetadata = 0,
kClassificationOnly = 1,
kHasButtonConfig = 2,
kMaxValue = kHasButtonConfig,
};
enum class DeviceImageDestination {
kNotification = 0,
kSettings = 1,
};
struct ASH_EXPORT MouseMetadata {
MouseMetadata();
MouseMetadata(mojom::CustomizationRestriction customization_restriction,
mojom::MouseButtonConfig config,
std::optional<std::string> name = std::nullopt);
~MouseMetadata();
MouseMetadata(const MouseMetadata& other);
mojom::CustomizationRestriction customization_restriction;
mojom::MouseButtonConfig mouse_button_config;
std::optional<std::string> name = std::nullopt;
bool operator==(const MouseMetadata& other) const;
};
struct ASH_EXPORT GraphicsTabletMetadata {
GraphicsTabletMetadata();
GraphicsTabletMetadata(
mojom::CustomizationRestriction customization_restriction,
mojom::GraphicsTabletButtonConfig config,
std::optional<std::string> name = std::nullopt);
~GraphicsTabletMetadata();
GraphicsTabletMetadata(const GraphicsTabletMetadata& other);
mojom::CustomizationRestriction customization_restriction;
mojom::GraphicsTabletButtonConfig graphics_tablet_button_config;
std::optional<std::string> name = std::nullopt;
bool operator==(const GraphicsTabletMetadata& other) const;
};
struct ASH_EXPORT KeyboardMetadata {};
struct ASH_EXPORT KeyboardMouseComboMetadata {
mojom::CustomizationRestriction customization_restriction;
bool operator==(const KeyboardMouseComboMetadata& other) const;
};
ASH_EXPORT const MouseMetadata* GetMouseMetadata(const ui::InputDevice& device);
ASH_EXPORT const GraphicsTabletMetadata* GetGraphicsTabletMetadata(
const ui::InputDevice& device);
ASH_EXPORT const KeyboardMetadata* GetKeyboardMetadata(
const ui::InputDevice& device);
ASH_EXPORT const KeyboardMouseComboMetadata* GetKeyboardMouseComboMetadata(
const ui::InputDevice& device);
ASH_EXPORT DeviceType GetDeviceType(const ui::InputDevice& device);
ASH_EXPORT const base::flat_map<VendorProductId, MouseMetadata>&
GetMouseMetadataList();
ASH_EXPORT const base::flat_map<VendorProductId, GraphicsTabletMetadata>&
GetGraphicsTabletMetadataList();
ASH_EXPORT const base::flat_map<VendorProductId, KeyboardMouseComboMetadata>&
GetKeyboardMouseComboMetadataList();
ASH_EXPORT const base::flat_map<VendorProductId, KeyboardMetadata>&
GetKeyboardMetadataList();
ASH_EXPORT std::vector<mojom::ButtonRemappingPtr>
GetButtonRemappingListForConfig(mojom::MouseButtonConfig mouse_button_config);
ASH_EXPORT std::vector<mojom::ButtonRemappingPtr>
GetPenButtonRemappingListForConfig(
mojom::GraphicsTabletButtonConfig graphics_tablet_button_config);
ASH_EXPORT std::vector<mojom::ButtonRemappingPtr>
GetTabletButtonRemappingListForConfig(
mojom::GraphicsTabletButtonConfig graphics_tablet_button_config);
ASH_EXPORT const base::flat_map<VendorProductId, VendorProductId>&
GetVidPidAliasList();
ASH_EXPORT bool DeviceHasCompanionAppAvailable(const std::string& device_key);
}
#endif