2023-03-20 01:32:19 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
|
|
#include "shelldbusobject.h"
|
|
|
|
|
#include "mobileadaptor.h"
|
|
|
|
|
|
|
|
|
|
#include <QDBusConnection>
|
|
|
|
|
|
|
|
|
|
ShellDBusObject::ShellDBusObject(QObject *parent)
|
|
|
|
|
: QObject{parent}
|
2024-07-13 16:30:07 +00:00
|
|
|
, m_startupFeedbackModel{new StartupFeedbackModel{this}}
|
2023-03-20 01:32:19 +00:00
|
|
|
{
|
2023-03-20 04:10:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::registerObject()
|
|
|
|
|
{
|
|
|
|
|
if (!m_initialized) {
|
|
|
|
|
new PlasmashellAdaptor{this};
|
|
|
|
|
QDBusConnection::sessionBus().registerObject(QStringLiteral("/Mobile"), this);
|
|
|
|
|
m_initialized = true;
|
|
|
|
|
}
|
2023-03-20 01:32:19 +00:00
|
|
|
}
|
|
|
|
|
|
2024-07-13 16:30:07 +00:00
|
|
|
StartupFeedbackModel *ShellDBusObject::startupFeedbackModel()
|
|
|
|
|
{
|
|
|
|
|
return m_startupFeedbackModel;
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-20 01:32:19 +00:00
|
|
|
bool ShellDBusObject::doNotDisturb()
|
|
|
|
|
{
|
|
|
|
|
return m_doNotDisturb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setDoNotDisturb(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (value != m_doNotDisturb) {
|
|
|
|
|
m_doNotDisturb = value;
|
|
|
|
|
Q_EMIT doNotDisturbChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-25 17:30:47 +00:00
|
|
|
QString ShellDBusObject::panelState()
|
|
|
|
|
{
|
|
|
|
|
return m_panelState;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setPanelState(QString state)
|
|
|
|
|
{
|
|
|
|
|
if (state != m_panelState) {
|
|
|
|
|
m_panelState = state;
|
|
|
|
|
Q_EMIT panelStateChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2023-03-20 01:32:19 +00:00
|
|
|
bool ShellDBusObject::isActionDrawerOpen()
|
|
|
|
|
{
|
|
|
|
|
return m_isActionDrawerOpen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setIsActionDrawerOpen(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (value != m_isActionDrawerOpen) {
|
|
|
|
|
m_isActionDrawerOpen = value;
|
|
|
|
|
Q_EMIT isActionDrawerOpenChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-19 01:21:46 +00:00
|
|
|
bool ShellDBusObject::isVolumeOSDOpen()
|
|
|
|
|
{
|
|
|
|
|
return m_isVolumeOSDOpen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setIsVolumeOSDOpen(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (value != m_isVolumeOSDOpen) {
|
|
|
|
|
m_isVolumeOSDOpen = value;
|
|
|
|
|
Q_EMIT isVolumeOSDOpenChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ShellDBusObject::isNotificationPopupDrawerOpen()
|
|
|
|
|
{
|
|
|
|
|
return m_isNotificationPopupDrawerOpen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setIsNotificationPopupDrawerOpen(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (value != m_isNotificationPopupDrawerOpen) {
|
|
|
|
|
m_isNotificationPopupDrawerOpen = value;
|
|
|
|
|
Q_EMIT isNotificationPopupDrawerOpenChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-25 06:29:40 +00:00
|
|
|
bool ShellDBusObject::isTaskSwitcherVisible()
|
|
|
|
|
{
|
|
|
|
|
return m_isTaskSwitcherVisible;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::setIsTaskSwitcherVisible(bool value)
|
|
|
|
|
{
|
|
|
|
|
if (value != m_isTaskSwitcherVisible) {
|
|
|
|
|
m_isTaskSwitcherVisible = value;
|
|
|
|
|
Q_EMIT isTaskSwitcherVisibleChanged();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-20 01:32:19 +00:00
|
|
|
void ShellDBusObject::openActionDrawer()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT openActionDrawerRequested();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::closeActionDrawer()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT closeActionDrawerRequested();
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-13 16:30:07 +00:00
|
|
|
void ShellDBusObject::openAppLaunchAnimationWithPosition(int screen,
|
|
|
|
|
QString splashIcon,
|
|
|
|
|
QString title,
|
|
|
|
|
QString storageId,
|
|
|
|
|
qreal x,
|
|
|
|
|
qreal y,
|
|
|
|
|
qreal sourceIconSize)
|
2023-03-20 01:32:19 +00:00
|
|
|
{
|
2024-07-13 16:30:07 +00:00
|
|
|
if (!m_startupFeedbackModel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-03-10 03:50:55 +00:00
|
|
|
|
2024-07-13 16:30:07 +00:00
|
|
|
StartupFeedback *feedback = new StartupFeedback{m_startupFeedbackModel, splashIcon, title, storageId, x, y, sourceIconSize, screen};
|
|
|
|
|
m_startupFeedbackModel->addApp(feedback);
|
2023-03-20 01:32:19 +00:00
|
|
|
}
|
|
|
|
|
|
2024-07-13 16:30:07 +00:00
|
|
|
void ShellDBusObject::triggerAppLaunchMaximizePanelAnimation(int screen, QString color)
|
2023-03-20 01:32:19 +00:00
|
|
|
{
|
2024-07-13 16:30:07 +00:00
|
|
|
Q_EMIT appLaunchMaximizePanelAnimationTriggered(screen, color);
|
2023-03-20 01:32:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::openHomeScreen()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT openHomeScreenRequested();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ShellDBusObject::resetHomeScreenPosition()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT resetHomeScreenPositionRequested();
|
|
|
|
|
}
|
2023-03-20 04:10:14 +00:00
|
|
|
|
|
|
|
|
void ShellDBusObject::showVolumeOSD()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT showVolumeOSDRequested();
|
|
|
|
|
}
|
2025-07-02 14:27:33 +00:00
|
|
|
|
|
|
|
|
void ShellDBusObject::openLockScreenKeypad()
|
|
|
|
|
{
|
|
|
|
|
Q_EMIT openLockScreenKeypadRequested();
|
|
|
|
|
}
|