blob: 4bc6310845102d90911aba0ea94e5c4e41a2c43b [file] [log] [blame]
#pragma once
#include <sdbusplus/bus.hpp>
#include <sdbusplus/bus/match.hpp>
namespace phosphor
{
namespace button
{
/**
* @class Handler
*
* This class acts on the signals generated by the
* xyz.openbmc_project.Chassis.Buttons code when
* it detects button presses.
*
* There are 3 buttons supported - Power, ID, and Reset.
* As not all systems may implement each button, this class will
* check for that button on D-Bus before listening for its signals.
*/
class Handler
{
public:
Handler() = delete;
~Handler() = default;
Handler(const Handler&) = delete;
Handler& operator=(const Handler&) = delete;
Handler(Handler&&) = delete;
Handler& operator=(Handler&&) = delete;
/**
* @brief Constructor
*
* @param[in] bus - sdbusplus connection object
*/
Handler(sdbusplus::bus::bus& bus);
private:
/**
* @brief sdbusplus connection object
*/
sdbusplus::bus::bus& bus;
};
} // namespace button
} // namespace phosphor