#ifndef __POWER_BUTTON_H__
#define __POWER_BUTTON_H__

#include <gtkmm.h>
#include "ImageButton.h"

class PowerButton : public ImageButton {
public:
    PowerButton();
    virtual ~PowerButton();

    void requestPopover();

    sigc::signal<void> signalPoweroffClicked();
    sigc::signal<void> signalRebootClicked();
    sigc::signal<void> signalSuspendClicked();

private:
	void onPowerOffClicked();
	void onRebootClicked();
	void onSuspendClicked();
	bool onButtonEvent(GdkEventButton* event);
    bool onKeyEvent(GdkEventKey* event);

private:
    Gtk::Popover m_popover;
    Gtk::Box m_popMainLyt;

    Gtk::Label m_powerLbl;
    Gtk::Label m_rebootLbl;
    Gtk::Label m_suspendLbl;

    Gtk::Button m_powerOff;
    Gtk::Button m_reboot;
    Gtk::Button m_suspend;

    sigc::signal<void> m_signalPoweroff;
    sigc::signal<void> m_signalReboot;
    sigc::signal<void> m_signalSuspend;

    sigc::connection m_sigPoweroffIter;
    sigc::connection m_sigRebootIter;
    sigc::connection m_sigSuspIter;
    sigc::connection m_sigBtnPressIter;
    sigc::connection m_sigBtnKeyPressIter;
};

#endif // __POWER_BUTTON_H__