#ifndef __LOGIN1_DBUS_H__
#define __LOGIN1_DBUS_H__
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusConnectionInterface>
#include <QtDBus/QDBusMessage>
#include <QtDBus/QDBusReply>
#include <QCoreApplication>
#include <QDBusInterface>
#include <QTime>
#include <QDBusUnixFileDescriptor>

enum INHIBIT_TYPE
{
    INHIBIT_SLEEP = 0,
    INHIBIT_SHUTDOWN = 1
};

class login1dbusManager: public QObject
{
    Q_OBJECT
public:

    login1dbusManager();
    bool inhibit(INHIBIT_TYPE type);
    void unInhibit();
    ~login1dbusManager();
signals:
    void goingToSleep(bool);
    void shuttingDown(bool);
    void locking();
    void changeUserLocking(bool);
private slots:
    void changeUserLock();
    void changeUserUnLock();
    void login1PrepareForSleep(bool);
    void login1PrepareForShutdown(bool);
    void screenSaverLocked();
    void logoutSig();
    void screenSaverUnlocked();
private:
    bool isLockFlag = false;
    QDBusUnixFileDescriptor m_inhibitShutdownFD;
    QDBusUnixFileDescriptor m_inhibitSleepFD;
};
#endif
