1*fb35a325SMatt Spinler #pragma once 2*fb35a325SMatt Spinler 3*fb35a325SMatt Spinler #include <sdbusplus/bus.hpp> 4*fb35a325SMatt Spinler #include <sdbusplus/bus/match.hpp> 5*fb35a325SMatt Spinler 6*fb35a325SMatt Spinler namespace phosphor 7*fb35a325SMatt Spinler { 8*fb35a325SMatt Spinler namespace button 9*fb35a325SMatt Spinler { 10*fb35a325SMatt Spinler 11*fb35a325SMatt Spinler /** 12*fb35a325SMatt Spinler * @class Handler 13*fb35a325SMatt Spinler * 14*fb35a325SMatt Spinler * This class acts on the signals generated by the 15*fb35a325SMatt Spinler * xyz.openbmc_project.Chassis.Buttons code when 16*fb35a325SMatt Spinler * it detects button presses. 17*fb35a325SMatt Spinler * 18*fb35a325SMatt Spinler * There are 3 buttons supported - Power, ID, and Reset. 19*fb35a325SMatt Spinler * As not all systems may implement each button, this class will 20*fb35a325SMatt Spinler * check for that button on D-Bus before listening for its signals. 21*fb35a325SMatt Spinler */ 22*fb35a325SMatt Spinler class Handler 23*fb35a325SMatt Spinler { 24*fb35a325SMatt Spinler public: 25*fb35a325SMatt Spinler Handler() = delete; 26*fb35a325SMatt Spinler ~Handler() = default; 27*fb35a325SMatt Spinler Handler(const Handler&) = delete; 28*fb35a325SMatt Spinler Handler& operator=(const Handler&) = delete; 29*fb35a325SMatt Spinler Handler(Handler&&) = delete; 30*fb35a325SMatt Spinler Handler& operator=(Handler&&) = delete; 31*fb35a325SMatt Spinler 32*fb35a325SMatt Spinler /** 33*fb35a325SMatt Spinler * @brief Constructor 34*fb35a325SMatt Spinler * 35*fb35a325SMatt Spinler * @param[in] bus - sdbusplus connection object 36*fb35a325SMatt Spinler */ 37*fb35a325SMatt Spinler Handler(sdbusplus::bus::bus& bus); 38*fb35a325SMatt Spinler 39*fb35a325SMatt Spinler private: 40*fb35a325SMatt Spinler /** 41*fb35a325SMatt Spinler * @brief sdbusplus connection object 42*fb35a325SMatt Spinler */ 43*fb35a325SMatt Spinler sdbusplus::bus::bus& bus; 44*fb35a325SMatt Spinler }; 45*fb35a325SMatt Spinler 46*fb35a325SMatt Spinler } // namespace button 47*fb35a325SMatt Spinler } // namespace phosphor 48