#ifndef ACCOUNTLOGOUT_H
#define ACCOUNTLOGOUT_H

#include <QObject>>
#include <QDebug>
#include <QtDBus>
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
#include <QtQml/qqml.h>
#endif
#include <unistd.h>

class AccountLogout : public QObject
{
    Q_OBJECT
#if QT_VERSION >= QT_VERSION_CHECK(5,15,0)
    QML_ELEMENT
#endif
public:
    //暴露给Qml属性的操作
    Q_PROPERTY(QString userName READ getUserName NOTIFY userInfoSignal)
    Q_PROPERTY(QString realName READ getRealName NOTIFY userInfoSignal)

    explicit AccountLogout(QObject *parent = nullptr);

    QString getUserName();

    QString getRealName();

signals:
    void userInfoSignal(QString realName, QString userName);

public slots:
    qlonglong logout();

    void getUserInfo();

private:
    QString myUserName;
    QString myRealName;
};

#endif // ACCOUNTLOGOUT_H
