blob: 41f885bc2ed9cb79fce4045a1dfa339f9fd897ea [file] [log] [blame]
// Copyright 2014 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef POWER_MANAGER_POWERD_SYSTEM_INPUT_WATCHER_INTERFACE_H_
#define POWER_MANAGER_POWERD_SYSTEM_INPUT_WATCHER_INTERFACE_H_
#include <base/macros.h>
#include "power_manager/common/power_constants.h"
namespace power_manager {
namespace system {
class InputObserver;
// An interface for querying vaguely-input-related state.
class InputWatcherInterface {
public:
InputWatcherInterface() {}
virtual ~InputWatcherInterface() {}
// Adds or removes an observer.
virtual void AddObserver(InputObserver* observer) = 0;
virtual void RemoveObserver(InputObserver* observer) = 0;
// Queries the system for the current lid state. LidState::NOT_PRESENT is
// returned on error.
virtual LidState QueryLidState() = 0;
// Returns the most-recently-observed state from the tablet mode switch (if
// any).
virtual TabletMode GetTabletMode() = 0;
// Checks if any USB input devices are connected.
virtual bool IsUSBInputDeviceConnected() const = 0;
// Should be called at the beginning of a new suspend request.
virtual void PrepareForSuspendRequest() = 0;
// Should be called at the end of a suspend request.
virtual void HandleResume() = 0;
// Returns true if any of the input devices' wakeup counts differed (compared
// to the pre-suspend wakeup counts).
virtual bool InputDeviceCausedLastWake() const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(InputWatcherInterface);
};
} // namespace system
} // namespace power_manager
#endif // POWER_MANAGER_POWERD_SYSTEM_INPUT_WATCHER_INTERFACE_H_