#ifndef ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_TEST_API_H_
#define ASH_WM_TABLET_MODE_TABLET_MODE_CONTROLLER_TEST_API_H_
#include <memory>
#include "ash/wm/tablet_mode/internal_input_devices_event_blocker.h"
#include "ash/wm/tablet_mode/tablet_mode_controller.h"
#include "base/memory/raw_ptr.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
namespace ash {
class InternalInputDevicesEventBlocker;
class TabletModeController;
class TabletModeWindowManager;
class TabletModeControllerTestApi {
public:
static constexpr float kDegreesToRadians = 3.1415926f / 180.0f;
TabletModeControllerTestApi();
TabletModeControllerTestApi(const TabletModeControllerTestApi&) = delete;
TabletModeControllerTestApi& operator=(const TabletModeControllerTestApi&) =
delete;
~TabletModeControllerTestApi();
void EnterTabletMode();
void LeaveTabletMode();
void AttachExternalMouse();
void AttachBluetoothMouse(device::MockBluetoothAdapter* bluetooth_adapter);
void AttachExternalTouchpad();
void DetachAllMice();
void DetachAllTouchpads();
void TriggerLidUpdate(const gfx::Vector3dF& lid);
void TriggerBaseAndLidUpdate(const gfx::Vector3dF& base,
const gfx::Vector3dF& lid);
void OpenLidToAngle(float degrees);
void HoldDeviceVertical();
void OpenLid();
void CloseLid();
void SetTabletMode(bool on);
void SuspendImminent();
void SuspendDone(base::TimeDelta sleep_duration);
void set_event_blocker(
std::unique_ptr<InternalInputDevicesEventBlocker> blocker) {
tablet_mode_controller_->event_blocker_ = std::move(blocker);
}
TabletModeWindowManager* tablet_mode_window_manager() {
return tablet_mode_controller_->tablet_mode_window_manager_.get();
}
void set_tick_clock(const base::TickClock* tick_clock) {
DCHECK(tick_clock);
tablet_mode_controller_->tick_clock_ = tick_clock;
}
const base::TickClock* tick_clock() {
return tablet_mode_controller_->tick_clock_;
}
bool CanUseUnstableLidAngle() const {
return tablet_mode_controller_->CanUseUnstableLidAngle();
}
bool AreEventsBlocked() const {
return tablet_mode_controller_->AreInternalInputDeviceEventsBlocked();
}
bool IsScreenshotShown() const {
return !!tablet_mode_controller_->screenshot_layer_;
}
bool IsInPhysicalTabletState() const {
return tablet_mode_controller_->is_in_tablet_physical_state();
}
float GetLidAngle() const { return tablet_mode_controller_->lid_angle(); }
private:
raw_ptr<TabletModeController> tablet_mode_controller_;
};
}
#endif