/*
 * This file was generated by qdbusxml2cpp-fix version 0.8
 * Command line was: qdbusxml2cpp-fix -p /build/deepin-session-shell/src/dde-session-shell-snipe/src/global_util/dbus/userinterface /build/deepin-session-shell/src/dde-session-shell-snipe/xml/snipe/org.deepin.dde.Accounts1.User.xml
 *
 * qdbusxml2cpp-fix is Copyright (C) 2016 Deepin Technology Co., Ltd.
 *
 * This is an auto-generated file.
 * This file may have been hand-edited. Look for HAND-EDIT comments
 * before re-generating it.
 */

#include "/build/deepin-session-shell/src/dde-session-shell-snipe/src/global_util/dbus/userinterface.h"

DCORE_USE_NAMESPACE
/*
 * Implementation of interface class __OrgDeepinDdeAccounts1UserInterface
 */

class __OrgDeepinDdeAccounts1UserInterfacePrivate
{
public:
   __OrgDeepinDdeAccounts1UserInterfacePrivate() = default;

    // begin member variables
    int AccountType;
    bool AutomaticLogin;
    qulonglong CreatedTime;
    QStringList DesktopBackgrounds;
    QString FullName;
    QString Gid;
    QString GreeterBackground;
    QStringList Groups;
    QStringList HistoryLayout;
    QString HomeDir;
    QString IconFile;
    QStringList IconList;
    QString Layout;
    QString Locale;
    bool Locked;
    qulonglong LoginTime;
    int LongDateFormat;
    int LongTimeFormat;
    int MaxPasswordAge;
    bool NoPasswdLogin;
    QString PasswordHint;
    int PasswordLastChange;
    QString PasswordStatus;
    QString Shell;
    int ShortDateFormat;
    int ShortTimeFormat;
    bool SystemAccount;
    QString Uid;
    bool Use24HourFormat;
    QString UserName;
    int WeekBegins;
    int WeekdayFormat;
    QString XSession;

public:
    QMap<QString, QDBusPendingCallWatcher *> m_processingCalls;
    QMap<QString, QList<QVariant>> m_waittingCalls;
};

__OrgDeepinDdeAccounts1UserInterface::__OrgDeepinDdeAccounts1UserInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
    : DDBusExtendedAbstractInterface(service, path, staticInterfaceName(), connection, parent)
    , d_ptr(new __OrgDeepinDdeAccounts1UserInterfacePrivate)
{
    connect(this, &__OrgDeepinDdeAccounts1UserInterface::propertyChanged, this, &__OrgDeepinDdeAccounts1UserInterface::onPropertyChanged);

}

__OrgDeepinDdeAccounts1UserInterface::~__OrgDeepinDdeAccounts1UserInterface()
{
    qDeleteAll(d_ptr->m_processingCalls.values());
    delete d_ptr;
}

void __OrgDeepinDdeAccounts1UserInterface::onPropertyChanged(const QString &propName, const QVariant &value)
{
    if (propName == QStringLiteral("AccountType"))
    {
        const int &AccountType = qvariant_cast<int>(value);
        if (d_ptr->AccountType != AccountType)
        {
            d_ptr->AccountType = AccountType;
            Q_EMIT AccountTypeChanged(d_ptr->AccountType);
        }
        return;
    }

    if (propName == QStringLiteral("AutomaticLogin"))
    {
        const bool &AutomaticLogin = qvariant_cast<bool>(value);
        if (d_ptr->AutomaticLogin != AutomaticLogin)
        {
            d_ptr->AutomaticLogin = AutomaticLogin;
            Q_EMIT AutomaticLoginChanged(d_ptr->AutomaticLogin);
        }
        return;
    }

    if (propName == QStringLiteral("CreatedTime"))
    {
        const qulonglong &CreatedTime = qvariant_cast<qulonglong>(value);
        if (d_ptr->CreatedTime != CreatedTime)
        {
            d_ptr->CreatedTime = CreatedTime;
            Q_EMIT CreatedTimeChanged(d_ptr->CreatedTime);
        }
        return;
    }

    if (propName == QStringLiteral("DesktopBackgrounds"))
    {
        const QStringList &DesktopBackgrounds = qvariant_cast<QStringList>(value);
        if (d_ptr->DesktopBackgrounds != DesktopBackgrounds)
        {
            d_ptr->DesktopBackgrounds = DesktopBackgrounds;
            Q_EMIT DesktopBackgroundsChanged(d_ptr->DesktopBackgrounds);
        }
        return;
    }

    if (propName == QStringLiteral("FullName"))
    {
        const QString &FullName = qvariant_cast<QString>(value);
        if (d_ptr->FullName != FullName)
        {
            d_ptr->FullName = FullName;
            Q_EMIT FullNameChanged(d_ptr->FullName);
        }
        return;
    }

    if (propName == QStringLiteral("Gid"))
    {
        const QString &Gid = qvariant_cast<QString>(value);
        if (d_ptr->Gid != Gid)
        {
            d_ptr->Gid = Gid;
            Q_EMIT GidChanged(d_ptr->Gid);
        }
        return;
    }

    if (propName == QStringLiteral("GreeterBackground"))
    {
        const QString &GreeterBackground = qvariant_cast<QString>(value);
        if (d_ptr->GreeterBackground != GreeterBackground)
        {
            d_ptr->GreeterBackground = GreeterBackground;
            Q_EMIT GreeterBackgroundChanged(d_ptr->GreeterBackground);
        }
        return;
    }

    if (propName == QStringLiteral("Groups"))
    {
        const QStringList &Groups = qvariant_cast<QStringList>(value);
        if (d_ptr->Groups != Groups)
        {
            d_ptr->Groups = Groups;
            Q_EMIT GroupsChanged(d_ptr->Groups);
        }
        return;
    }

    if (propName == QStringLiteral("HistoryLayout"))
    {
        const QStringList &HistoryLayout = qvariant_cast<QStringList>(value);
        if (d_ptr->HistoryLayout != HistoryLayout)
        {
            d_ptr->HistoryLayout = HistoryLayout;
            Q_EMIT HistoryLayoutChanged(d_ptr->HistoryLayout);
        }
        return;
    }

    if (propName == QStringLiteral("HomeDir"))
    {
        const QString &HomeDir = qvariant_cast<QString>(value);
        if (d_ptr->HomeDir != HomeDir)
        {
            d_ptr->HomeDir = HomeDir;
            Q_EMIT HomeDirChanged(d_ptr->HomeDir);
        }
        return;
    }

    if (propName == QStringLiteral("IconFile"))
    {
        const QString &IconFile = qvariant_cast<QString>(value);
        if (d_ptr->IconFile != IconFile)
        {
            d_ptr->IconFile = IconFile;
            Q_EMIT IconFileChanged(d_ptr->IconFile);
        }
        return;
    }

    if (propName == QStringLiteral("IconList"))
    {
        const QStringList &IconList = qvariant_cast<QStringList>(value);
        if (d_ptr->IconList != IconList)
        {
            d_ptr->IconList = IconList;
            Q_EMIT IconListChanged(d_ptr->IconList);
        }
        return;
    }

    if (propName == QStringLiteral("Layout"))
    {
        const QString &Layout = qvariant_cast<QString>(value);
        if (d_ptr->Layout != Layout)
        {
            d_ptr->Layout = Layout;
            Q_EMIT LayoutChanged(d_ptr->Layout);
        }
        return;
    }

    if (propName == QStringLiteral("Locale"))
    {
        const QString &Locale = qvariant_cast<QString>(value);
        if (d_ptr->Locale != Locale)
        {
            d_ptr->Locale = Locale;
            Q_EMIT LocaleChanged(d_ptr->Locale);
        }
        return;
    }

    if (propName == QStringLiteral("Locked"))
    {
        const bool &Locked = qvariant_cast<bool>(value);
        if (d_ptr->Locked != Locked)
        {
            d_ptr->Locked = Locked;
            Q_EMIT LockedChanged(d_ptr->Locked);
        }
        return;
    }

    if (propName == QStringLiteral("LoginTime"))
    {
        const qulonglong &LoginTime = qvariant_cast<qulonglong>(value);
        if (d_ptr->LoginTime != LoginTime)
        {
            d_ptr->LoginTime = LoginTime;
            Q_EMIT LoginTimeChanged(d_ptr->LoginTime);
        }
        return;
    }

    if (propName == QStringLiteral("LongDateFormat"))
    {
        const int &LongDateFormat = qvariant_cast<int>(value);
        if (d_ptr->LongDateFormat != LongDateFormat)
        {
            d_ptr->LongDateFormat = LongDateFormat;
            Q_EMIT LongDateFormatChanged(d_ptr->LongDateFormat);
        }
        return;
    }

    if (propName == QStringLiteral("LongTimeFormat"))
    {
        const int &LongTimeFormat = qvariant_cast<int>(value);
        if (d_ptr->LongTimeFormat != LongTimeFormat)
        {
            d_ptr->LongTimeFormat = LongTimeFormat;
            Q_EMIT LongTimeFormatChanged(d_ptr->LongTimeFormat);
        }
        return;
    }

    if (propName == QStringLiteral("MaxPasswordAge"))
    {
        const int &MaxPasswordAge = qvariant_cast<int>(value);
        if (d_ptr->MaxPasswordAge != MaxPasswordAge)
        {
            d_ptr->MaxPasswordAge = MaxPasswordAge;
            Q_EMIT MaxPasswordAgeChanged(d_ptr->MaxPasswordAge);
        }
        return;
    }

    if (propName == QStringLiteral("NoPasswdLogin"))
    {
        const bool &NoPasswdLogin = qvariant_cast<bool>(value);
        if (d_ptr->NoPasswdLogin != NoPasswdLogin)
        {
            d_ptr->NoPasswdLogin = NoPasswdLogin;
            Q_EMIT NoPasswdLoginChanged(d_ptr->NoPasswdLogin);
        }
        return;
    }

    if (propName == QStringLiteral("PasswordHint"))
    {
        const QString &PasswordHint = qvariant_cast<QString>(value);
        if (d_ptr->PasswordHint != PasswordHint)
        {
            d_ptr->PasswordHint = PasswordHint;
            Q_EMIT PasswordHintChanged(d_ptr->PasswordHint);
        }
        return;
    }

    if (propName == QStringLiteral("PasswordLastChange"))
    {
        const int &PasswordLastChange = qvariant_cast<int>(value);
        if (d_ptr->PasswordLastChange != PasswordLastChange)
        {
            d_ptr->PasswordLastChange = PasswordLastChange;
            Q_EMIT PasswordLastChangeChanged(d_ptr->PasswordLastChange);
        }
        return;
    }

    if (propName == QStringLiteral("PasswordStatus"))
    {
        const QString &PasswordStatus = qvariant_cast<QString>(value);
        if (d_ptr->PasswordStatus != PasswordStatus)
        {
            d_ptr->PasswordStatus = PasswordStatus;
            Q_EMIT PasswordStatusChanged(d_ptr->PasswordStatus);
        }
        return;
    }

    if (propName == QStringLiteral("Shell"))
    {
        const QString &Shell = qvariant_cast<QString>(value);
        if (d_ptr->Shell != Shell)
        {
            d_ptr->Shell = Shell;
            Q_EMIT ShellChanged(d_ptr->Shell);
        }
        return;
    }

    if (propName == QStringLiteral("ShortDateFormat"))
    {
        const int &ShortDateFormat = qvariant_cast<int>(value);
        if (d_ptr->ShortDateFormat != ShortDateFormat)
        {
            d_ptr->ShortDateFormat = ShortDateFormat;
            Q_EMIT ShortDateFormatChanged(d_ptr->ShortDateFormat);
        }
        return;
    }

    if (propName == QStringLiteral("ShortTimeFormat"))
    {
        const int &ShortTimeFormat = qvariant_cast<int>(value);
        if (d_ptr->ShortTimeFormat != ShortTimeFormat)
        {
            d_ptr->ShortTimeFormat = ShortTimeFormat;
            Q_EMIT ShortTimeFormatChanged(d_ptr->ShortTimeFormat);
        }
        return;
    }

    if (propName == QStringLiteral("SystemAccount"))
    {
        const bool &SystemAccount = qvariant_cast<bool>(value);
        if (d_ptr->SystemAccount != SystemAccount)
        {
            d_ptr->SystemAccount = SystemAccount;
            Q_EMIT SystemAccountChanged(d_ptr->SystemAccount);
        }
        return;
    }

    if (propName == QStringLiteral("Uid"))
    {
        const QString &Uid = qvariant_cast<QString>(value);
        if (d_ptr->Uid != Uid)
        {
            d_ptr->Uid = Uid;
            Q_EMIT UidChanged(d_ptr->Uid);
        }
        return;
    }

    if (propName == QStringLiteral("Use24HourFormat"))
    {
        const bool &Use24HourFormat = qvariant_cast<bool>(value);
        if (d_ptr->Use24HourFormat != Use24HourFormat)
        {
            d_ptr->Use24HourFormat = Use24HourFormat;
            Q_EMIT Use24HourFormatChanged(d_ptr->Use24HourFormat);
        }
        return;
    }

    if (propName == QStringLiteral("UserName"))
    {
        const QString &UserName = qvariant_cast<QString>(value);
        if (d_ptr->UserName != UserName)
        {
            d_ptr->UserName = UserName;
            Q_EMIT UserNameChanged(d_ptr->UserName);
        }
        return;
    }

    if (propName == QStringLiteral("WeekBegins"))
    {
        const int &WeekBegins = qvariant_cast<int>(value);
        if (d_ptr->WeekBegins != WeekBegins)
        {
            d_ptr->WeekBegins = WeekBegins;
            Q_EMIT WeekBeginsChanged(d_ptr->WeekBegins);
        }
        return;
    }

    if (propName == QStringLiteral("WeekdayFormat"))
    {
        const int &WeekdayFormat = qvariant_cast<int>(value);
        if (d_ptr->WeekdayFormat != WeekdayFormat)
        {
            d_ptr->WeekdayFormat = WeekdayFormat;
            Q_EMIT WeekdayFormatChanged(d_ptr->WeekdayFormat);
        }
        return;
    }

    if (propName == QStringLiteral("XSession"))
    {
        const QString &XSession = qvariant_cast<QString>(value);
        if (d_ptr->XSession != XSession)
        {
            d_ptr->XSession = XSession;
            Q_EMIT XSessionChanged(d_ptr->XSession);
        }
        return;
    }

    qWarning() << "property not handle: " << propName;
    return;
}

int __OrgDeepinDdeAccounts1UserInterface::accountType()
{
    return qvariant_cast<int>(internalPropGet("AccountType", &d_ptr->AccountType));
}

bool __OrgDeepinDdeAccounts1UserInterface::automaticLogin()
{
    return qvariant_cast<bool>(internalPropGet("AutomaticLogin", &d_ptr->AutomaticLogin));
}

qulonglong __OrgDeepinDdeAccounts1UserInterface::createdTime()
{
    return qvariant_cast<qulonglong>(internalPropGet("CreatedTime", &d_ptr->CreatedTime));
}

QStringList __OrgDeepinDdeAccounts1UserInterface::desktopBackgrounds()
{
    return qvariant_cast<QStringList>(internalPropGet("DesktopBackgrounds", &d_ptr->DesktopBackgrounds));
}

QString __OrgDeepinDdeAccounts1UserInterface::fullName()
{
    return qvariant_cast<QString>(internalPropGet("FullName", &d_ptr->FullName));
}

QString __OrgDeepinDdeAccounts1UserInterface::gid()
{
    return qvariant_cast<QString>(internalPropGet("Gid", &d_ptr->Gid));
}

QString __OrgDeepinDdeAccounts1UserInterface::greeterBackground()
{
    return qvariant_cast<QString>(internalPropGet("GreeterBackground", &d_ptr->GreeterBackground));
}

QStringList __OrgDeepinDdeAccounts1UserInterface::groups()
{
    return qvariant_cast<QStringList>(internalPropGet("Groups", &d_ptr->Groups));
}

QStringList __OrgDeepinDdeAccounts1UserInterface::historyLayout()
{
    return qvariant_cast<QStringList>(internalPropGet("HistoryLayout", &d_ptr->HistoryLayout));
}

QString __OrgDeepinDdeAccounts1UserInterface::homeDir()
{
    return qvariant_cast<QString>(internalPropGet("HomeDir", &d_ptr->HomeDir));
}

QString __OrgDeepinDdeAccounts1UserInterface::iconFile()
{
    return qvariant_cast<QString>(internalPropGet("IconFile", &d_ptr->IconFile));
}

QStringList __OrgDeepinDdeAccounts1UserInterface::iconList()
{
    return qvariant_cast<QStringList>(internalPropGet("IconList", &d_ptr->IconList));
}

QString __OrgDeepinDdeAccounts1UserInterface::layout()
{
    return qvariant_cast<QString>(internalPropGet("Layout", &d_ptr->Layout));
}

QString __OrgDeepinDdeAccounts1UserInterface::locale()
{
    return qvariant_cast<QString>(internalPropGet("Locale", &d_ptr->Locale));
}

bool __OrgDeepinDdeAccounts1UserInterface::locked()
{
    return qvariant_cast<bool>(internalPropGet("Locked", &d_ptr->Locked));
}

qulonglong __OrgDeepinDdeAccounts1UserInterface::loginTime()
{
    return qvariant_cast<qulonglong>(internalPropGet("LoginTime", &d_ptr->LoginTime));
}

int __OrgDeepinDdeAccounts1UserInterface::longDateFormat()
{
    return qvariant_cast<int>(internalPropGet("LongDateFormat", &d_ptr->LongDateFormat));
}

int __OrgDeepinDdeAccounts1UserInterface::longTimeFormat()
{
    return qvariant_cast<int>(internalPropGet("LongTimeFormat", &d_ptr->LongTimeFormat));
}

int __OrgDeepinDdeAccounts1UserInterface::maxPasswordAge()
{
    return qvariant_cast<int>(internalPropGet("MaxPasswordAge", &d_ptr->MaxPasswordAge));
}

bool __OrgDeepinDdeAccounts1UserInterface::noPasswdLogin()
{
    return qvariant_cast<bool>(internalPropGet("NoPasswdLogin", &d_ptr->NoPasswdLogin));
}

QString __OrgDeepinDdeAccounts1UserInterface::passwordHint()
{
    return qvariant_cast<QString>(internalPropGet("PasswordHint", &d_ptr->PasswordHint));
}

int __OrgDeepinDdeAccounts1UserInterface::passwordLastChange()
{
    return qvariant_cast<int>(internalPropGet("PasswordLastChange", &d_ptr->PasswordLastChange));
}

QString __OrgDeepinDdeAccounts1UserInterface::passwordStatus()
{
    return qvariant_cast<QString>(internalPropGet("PasswordStatus", &d_ptr->PasswordStatus));
}

QString __OrgDeepinDdeAccounts1UserInterface::shell()
{
    return qvariant_cast<QString>(internalPropGet("Shell", &d_ptr->Shell));
}

int __OrgDeepinDdeAccounts1UserInterface::shortDateFormat()
{
    return qvariant_cast<int>(internalPropGet("ShortDateFormat", &d_ptr->ShortDateFormat));
}

int __OrgDeepinDdeAccounts1UserInterface::shortTimeFormat()
{
    return qvariant_cast<int>(internalPropGet("ShortTimeFormat", &d_ptr->ShortTimeFormat));
}

bool __OrgDeepinDdeAccounts1UserInterface::systemAccount()
{
    return qvariant_cast<bool>(internalPropGet("SystemAccount", &d_ptr->SystemAccount));
}

QString __OrgDeepinDdeAccounts1UserInterface::uid()
{
    return qvariant_cast<QString>(internalPropGet("Uid", &d_ptr->Uid));
}

bool __OrgDeepinDdeAccounts1UserInterface::use24HourFormat()
{
    return qvariant_cast<bool>(internalPropGet("Use24HourFormat", &d_ptr->Use24HourFormat));
}

QString __OrgDeepinDdeAccounts1UserInterface::userName()
{
    return qvariant_cast<QString>(internalPropGet("UserName", &d_ptr->UserName));
}

int __OrgDeepinDdeAccounts1UserInterface::weekBegins()
{
    return qvariant_cast<int>(internalPropGet("WeekBegins", &d_ptr->WeekBegins));
}

int __OrgDeepinDdeAccounts1UserInterface::weekdayFormat()
{
    return qvariant_cast<int>(internalPropGet("WeekdayFormat", &d_ptr->WeekdayFormat));
}

QString __OrgDeepinDdeAccounts1UserInterface::xSession()
{
    return qvariant_cast<QString>(internalPropGet("XSession", &d_ptr->XSession));
}

void __OrgDeepinDdeAccounts1UserInterface::CallQueued(const QString &callName, const QList<QVariant> &args)
{
    if (d_ptr->m_waittingCalls.contains(callName))
    {
        d_ptr->m_waittingCalls[callName] = args;
        return;
    }
    if (d_ptr->m_processingCalls.contains(callName))
    {
        d_ptr->m_waittingCalls.insert(callName, args);
    } else {
        QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(asyncCallWithArgumentList(callName, args));
        connect(watcher, &QDBusPendingCallWatcher::finished, this, &__OrgDeepinDdeAccounts1UserInterface::onPendingCallFinished);
        d_ptr->m_processingCalls.insert(callName, watcher);
    }
}

void __OrgDeepinDdeAccounts1UserInterface::onPendingCallFinished(QDBusPendingCallWatcher *w)
{
    w->deleteLater();
    const auto callName = d_ptr->m_processingCalls.key(w);
    Q_ASSERT(!callName.isEmpty());
    if (callName.isEmpty())
        return;
    d_ptr->m_processingCalls.remove(callName);
    if (!d_ptr->m_waittingCalls.contains(callName))
        return;
    const auto args = d_ptr->m_waittingCalls.take(callName);
    CallQueued(callName, args);
}
