/*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/&gt;.
*
*/

#include "quickoperationdbus.h"


QuickOperationDbus::QuickOperationDbus()
{
    /* 注册dbus */
    QDBusConnection::sessionBus().unregisterService("org.ukui.Sidebar");
    QDBusConnection::sessionBus().registerService("org.ukui.Sidebar");
    /* 注册对象路径，导出所有此对象的插槽 */
    /* registerObject参数：路径，interface,对象，options */
    QDBusConnection::sessionBus().registerObject("/org/ukui/Sidebar/quick/operation",this,
                                                 QDBusConnection::ExportAllSlots|QDBusConnection::ExportAllSignals);
}

QuickOperationDbus::~QuickOperationDbus()
{

}

void QuickOperationDbus::setQuickOperationPanelHeight(int height)
{
    m_quickOperationHeight = height;
}
void QuickOperationDbus::setQuickOperationPanelWidth(int width)
{
    m_quickOperationWidth = width;
}

int QuickOperationDbus::getQuickOperationPanelHeight()
{
    return m_quickOperationHeight;
}

int QuickOperationDbus::getQuickOperationPanelWidth()
{
    return m_quickOperationWidth;
}

void QuickOperationDbus::setQuickOperationPanelHideHeight(int width)
{
    m_quickOperationHideHeight = width;
}

int QuickOperationDbus::getQuickOperationPanelHideHeight()
{
    return m_quickOperationHideHeight;
}

void QuickOperationDbus::setAnimationSpeed(int speed)
{
    m_animationSpeed = speed;
}

void QuickOperationDbus::setFoldOrunfold(QString state)
{
    m_flodState = state;
}

int QuickOperationDbus::getAnimationSpeed()
{
    return m_animationSpeed;
}

QString QuickOperationDbus::getFoldOrUnfold()
{
    return m_flodState;
}
