#ifndef __DM_GREETER_HELPER_H__
#define __DM_GREETER_HELPER_H__

#include <sigc++/sigc++.h>
#include <vector>
#include <glibmm/ustring.h>

class DmGreeterHelperPrivate;

class DmGreeterHelper {
public:
    static DmGreeterHelper* inst();

    bool connectSyncDm();

    int getUserCount();
    std::vector<Glib::ustring> getUserNameList();
    Glib::ustring getUserImagePath(const Glib::ustring& userName);

    bool isUserLoggedIn(const Glib::ustring& userName);

    bool isInAuthentication();
    bool isAuthenticated();

    void startAuthentication (const Glib::ustring& username);

    void requestStartSession();

    void respondPwd(const Glib::ustring& passwd);
    void cancelAuthentication();

    bool canSuspend();
    bool requestSuspend(GError **error);

    bool canReboot();
    bool requestReboot(GError **error);

    bool canShutdown();
    bool requestShutdown(GError **error);

    bool isLoginLocked();
    void setLoginLock(bool isLocked);

    sigc::signal<void> signalAuthFailed();

    sigc::signal<void> signalSessionFailed();
    sigc::signal<void, Glib::ustring, int> signalPrompt();
    sigc::signal<void, Glib::ustring, int> signalMessage();
    sigc::signal<void> signalAuthComplete();
    sigc::signal<void> signalAutoLoginTimeout();

private:
    DmGreeterHelper();
    DmGreeterHelper(const DmGreeterHelper& other) {}

private:
    static DmGreeterHelper* s_inst;

    DmGreeterHelperPrivate* m_priv;
    bool m_isLoginLocked;

    sigc::signal<void> m_authFailed;
    sigc::signal<void> m_sessionFailed;
    sigc::signal<void, Glib::ustring, int> m_signalPrompt;
    sigc::signal<void, Glib::ustring, int> m_signalMessage;
    sigc::signal<void> m_signalAuthComplete;
    sigc::signal<void> m_signalAutoLoginTimeout;
};

#endif // __DM_GREETER_HELPER_H__
