#ifndef ASH_KEYBOARD_VIRTUAL_KEYBOARD_CONTROLLER_H_
#define ASH_KEYBOARD_VIRTUAL_KEYBOARD_CONTROLLER_H_
#include <stdint.h>
#include <vector>
#include "ash/ash_export.h"
#include "ash/bluetooth_devices_observer.h"
#include "ash/public/cpp/keyboard/keyboard_controller_observer.h"
#include "ash/public/cpp/session/session_observer.h"
#include "ash/public/cpp/tablet_mode_observer.h"
#include "ui/base/ime/ash/ime_keyset.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/devices/input_device_event_observer.h"
#include "ui/events/devices/touchscreen_device.h"
namespace ash {
class ASH_EXPORT VirtualKeyboardController
: public TabletModeObserver,
public ui::InputDeviceEventObserver,
public KeyboardControllerObserver,
public SessionObserver {
public:
VirtualKeyboardController();
VirtualKeyboardController(const VirtualKeyboardController&) = delete;
VirtualKeyboardController& operator=(const VirtualKeyboardController&) =
delete;
~VirtualKeyboardController() override;
void ForceShowKeyboardWithKeyset(input_method::ImeKeyset keyset);
void ForceShowKeyboard();
void OnTabletModeEventsBlockingChanged() override;
void OnInputDeviceConfigurationChanged(uint8_t input_device_types) override;
void ToggleIgnoreExternalKeyboard();
void OnKeyboardHidden(bool is_temporary_hide) override;
void OnActiveUserSessionChanged(const AccountId& account_id) override;
const std::optional<std::string>& GetInternalKeyboardName() const;
const std::vector<ui::InputDevice>& GetExternalKeyboards() const;
const std::vector<ui::TouchscreenDevice>& GetTouchscreens() const;
bool IsInternalKeyboardIgnored() const;
bool IsExternalKeyboardIgnored() const;
private:
void UpdateDevices();
void UpdateKeyboardEnabled();
void OnBluetoothAdapterOrDeviceChanged(device::BluetoothDevice* device);
std::optional<std::string> internal_keyboard_name_;
std::vector<ui::InputDevice> external_keyboards_;
std::vector<ui::TouchscreenDevice> touchscreens_;
bool ignore_external_keyboard_;
bool ignore_internal_keyboard_;
std::unique_ptr<BluetoothDevicesObserver> bluetooth_devices_observer_;
};
}
#endif