1// Copyright 2013 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H 6#define ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H 7 8#include "ash/ash_export.h" 9 10namespace ash { 11 12// Controls the autoclick a11y feature in ash. 13// If enabled, we will automatically send a click event a short time after 14// the mouse had been at rest. 15class ASH_EXPORT AutoclickController { 16 public: 17 virtual ~AutoclickController() {} 18 19 // Set whether autoclicking is enabled. 20 virtual void SetEnabled(bool enabled) = 0; 21 22 // Returns true if autoclicking is enabled. 23 virtual bool IsEnabled() const = 0; 24 25 // Set the time to wait in milliseconds from when the mouse stops moving 26 // to when the autoclick event is sent. 27 virtual void SetAutoclickDelay(int delay_ms) = 0; 28 29 // Returns the autoclick delay in milliseconds. 30 virtual int GetAutoclickDelay() const = 0; 31 32 static AutoclickController* CreateInstance(); 33 34 // The default wait time between last mouse movement and sending 35 // the autoclick. 36 static const int kDefaultAutoclickDelayMs; 37 38 protected: 39 AutoclickController() {} 40}; 41 42} // namespace ash 43 44#endif // ASH_AUTOCLICK_AUTOCLICK_CONTROLLER_H 45