#ifndef __USER_ITEM_H__
#define __USER_ITEM_H__

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

class UserItem : public Gtk::Box {
public:
	explicit UserItem(const Glib::ustring& name);
	UserItem();

    virtual ~UserItem();

	void setUserName(const Glib::ustring& name);
	Glib::ustring getUserName();

	void setLoggedIn(bool isLoggedIn);

	void resetFocus();

	void set_face_can_focus(bool canFocus = true);

	sigc::signal<void, Glib::ustring> signalUserItemPress();

protected:
	bool onUserFacePress(GdkEventButton* event);
	bool onUserFaceKeyPress(GdkEventKey* event);

private:
	void initialize();
	void onUserChanged();

private:
	Glib::ustring m_userName;
	Glib::ustring m_displayName;
	Gtk::Label m_userNameLabel;
	Gtk::Label m_loginStateLabel;
	Gtk::Box m_nameArea;

	UserFace m_userFace;

	uint32_t m_state;

	bool m_isLoggedIn;

	sigc::signal<void, Glib::ustring> m_pressSignal;
	sigc::connection m_sigUserPressIter;
	sigc::connection m_sigUserKeyPressIter;
};

#endif // __USER_ITEM_H__