#include "screensaverwndadaptor.h"

#include <QtCore/QMetaObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>

ScreenSaverWndAdaptor::ScreenSaverWndAdaptor(FullBackgroundWidget *parent)
    : QDBusAbstractAdaptor(parent)
    , m_parentWidget(parent)
{
    // constructor
    setAutoRelaySignals(true);

    connect(m_parentWidget, SIGNAL(StartupModeChanged(bool)), this, SIGNAL(StartupModeChanged(bool)));
}

ScreenSaverWndAdaptor::~ScreenSaverWndAdaptor()
{

}

int ScreenSaverWndAdaptor::RegisteSubWnd(quint64 uWndId)
{
    int nWndCount = m_parentWidget->RegisteSubWnd(uWndId);
    if (nWndCount >= 0) {
        Q_EMIT SubWndChanged(nWndCount);
    }
    return nWndCount;
}

int ScreenSaverWndAdaptor::UnRegisteSubWnd(quint64 uWndId)
{
    int nWndCount = m_parentWidget->UnRegisteSubWnd(uWndId);
    if (nWndCount >= 0) {
        Q_EMIT SubWndChanged(nWndCount);
    }
    return nWndCount;
}

QList<quint64> ScreenSaverWndAdaptor::GetSubWndIds()
{
    return m_parentWidget->GetSubWndIds();
}

bool ScreenSaverWndAdaptor::IsStartupMode()
{
    return m_parentWidget->IsStartupMode();
}
