2017-07-31 03:53:39 +03:00
/*
2021-05-27 15:01:00 +00:00
SPDX - FileCopyrightText : 2021 Michail Vourlakos < mvourlakos @ gmail . com >
SPDX - License - Identifier : GPL - 2.0 - or - later
2017-07-31 03:53:39 +03:00
*/
2021-01-14 20:21:12 +02:00
# ifndef SYNCEDLAUNCHERS_H
# define SYNCEDLAUNCHERS_H
2017-07-31 03:53:39 +03:00
2018-12-02 02:05:52 +02:00
// Qt
2021-01-13 22:53:55 +02:00
# include <QList>
2017-07-31 03:53:39 +03:00
# include <QObject>
2021-01-13 22:53:55 +02:00
# include <QQuickItem>
2017-07-31 03:53:39 +03:00
2018-02-03 13:10:43 +02:00
namespace Plasma {
class Applet ;
}
namespace Latte {
2019-05-09 17:12:57 +03:00
namespace Layouts {
class Manager ;
}
2018-02-03 13:10:43 +02:00
}
2017-07-31 03:53:39 +03:00
namespace Latte {
2019-05-09 17:40:53 +03:00
namespace Layouts {
2017-07-31 03:53:39 +03:00
//! in order to support property the launcher groups Layout and Global
//! the latte plasmoids must communicate between them with signals when
//! there are changes in their models. This way we are trying to avoid
//! crashes that occur by setting the launcherList of the tasksModel so
//! often. The plasma devs of libtaskmanager have designed the launchers
//! model to be initialized only once during startup
2021-01-14 20:21:12 +02:00
class SyncedLaunchers : public QObject
2018-07-03 22:15:45 +03:00
{
2017-07-31 03:53:39 +03:00
Q_OBJECT
public :
2021-01-14 20:21:12 +02:00
SyncedLaunchers ( QObject * parent ) ;
~ SyncedLaunchers ( ) override ;
2017-07-31 03:53:39 +03:00
public slots :
2021-01-13 22:53:55 +02:00
Q_INVOKABLE void addAbilityClient ( QQuickItem * client ) ;
Q_INVOKABLE void removeAbilityClient ( QQuickItem * client ) ;
2018-01-21 20:17:58 +02:00
Q_INVOKABLE void addLauncher ( QString layoutName , int launcherGroup , QString launcher ) ;
Q_INVOKABLE void removeLauncher ( QString layoutName , int launcherGroup , QString launcher ) ;
Q_INVOKABLE void addLauncherToActivity ( QString layoutName , int launcherGroup , QString launcher , QString activity ) ;
Q_INVOKABLE void removeLauncherFromActivity ( QString layoutName , int launcherGroup , QString launcher , QString activity ) ;
Q_INVOKABLE void urlsDropped ( QString layoutName , int launcherGroup , QStringList urls ) ;
2020-03-14 14:41:07 +02:00
Q_INVOKABLE void validateLaunchersOrder ( QString layoutName , uint senderId , int launcherGroup , QStringList launchers ) ;
2017-07-31 03:53:39 +03:00
private :
2021-01-13 22:53:55 +02:00
QList < QQuickItem * > clients ( QString layoutName = QString ( ) ) ;
private slots :
void removeClientObject ( QObject * obj ) ;
2017-07-31 03:53:39 +03:00
private :
2019-05-09 17:12:57 +03:00
Layouts : : Manager * m_manager { nullptr } ;
2021-01-13 22:53:55 +02:00
QList < QQuickItem * > m_clients ;
2017-07-31 03:53:39 +03:00
} ;
2019-05-09 17:40:53 +03:00
}
2017-07-31 03:53:39 +03:00
}
# endif