#ifndef __MAIN_OVERLAY_H__
#define __MAIN_OVERLAY_H__

#include <gtkmm.h>
#include "UserItem.h"
#include "PowerButton.h"
#include "UserLoginView.h"
#include "UserSelectView.h"

class MainOverLay {
public:
	explicit MainOverLay(Gtk::Overlay* parent);
    virtual ~MainOverLay();

    bool doKeyPressed(GdkEventKey* event);

private:
	bool reloadDateTime();
	void initShutdownBtn();
    void initNecessaryLayout();
    void initDatetimeArea();
    void packLayouts();

    void onUserSelected(Glib::ustring name);
    void onSwitchUser();

    void onRestartClicked();
    void onPoweroffClicked();
    void onSuspendClicked();

private:
	Gtk::Stack m_userStack;

	Gtk::Overlay* m_mainlyt;

    UserLoginView m_loginView;
    UserSelectView m_selectView;

    Gtk::Box m_toolsLayout;

    Gtk::Label m_dateTimeLabel;

    PowerButton m_shutDownButton;

    Glib::RefPtr<Glib::TimeoutSource> m_reloadTimeHdl;

    sigc::connection m_reloadTimeIter;
    sigc::connection m_rebootOptIter;
    sigc::connection m_powerOptIter;
    sigc::connection m_suspOptIter;
    sigc::connection m_switchIter;
    sigc::connection m_userSelIter;

    double m_scaleX;
    double m_scaleY;
};

#endif // __MAIN_OVERLAY_H__