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