2013-07-04 18:17:22 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2013-07-04 18:17:22 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2013-07-04 18:17:22 +01:00
|
|
|
*/
|
|
|
|
|
2013-08-13 22:23:32 +01:00
|
|
|
#ifndef PLUGINLOADER_H
|
|
|
|
#define PLUGINLOADER_H
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2015-03-19 15:36:53 +00:00
|
|
|
#include <QHash>
|
2022-09-10 22:23:52 +01:00
|
|
|
#include <QObject>
|
2013-08-13 04:07:32 +01:00
|
|
|
#include <QString>
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2015-03-19 15:36:53 +00:00
|
|
|
#include <KPluginMetaData>
|
2013-08-12 15:09:52 +01:00
|
|
|
|
2020-03-01 20:00:40 +00:00
|
|
|
#include "kdeconnectcore_export.h"
|
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
class Device;
|
2013-08-13 04:14:46 +01:00
|
|
|
class KdeConnectPlugin;
|
2020-03-01 20:00:40 +00:00
|
|
|
class KPluginFactory;
|
2013-08-13 04:07:32 +01:00
|
|
|
|
2020-03-01 20:00:40 +00:00
|
|
|
class KDECONNECTCORE_EXPORT PluginLoader
|
2013-07-04 18:17:22 +01:00
|
|
|
{
|
2013-08-13 04:07:32 +01:00
|
|
|
public:
|
2022-09-10 22:23:52 +01:00
|
|
|
static PluginLoader *instance();
|
2013-08-13 05:03:12 +01:00
|
|
|
|
2013-10-12 00:54:08 +01:00
|
|
|
QStringList getPluginList() const;
|
2023-06-27 12:10:59 +01:00
|
|
|
bool doesPluginExist(const QString &name) const;
|
2022-09-10 22:23:52 +01:00
|
|
|
KPluginMetaData getPluginInfo(const QString &name) const;
|
|
|
|
KdeConnectPlugin *instantiatePluginForDevice(const QString &name, Device *device) const;
|
2013-08-13 04:07:32 +01:00
|
|
|
|
2016-07-06 16:37:22 +01:00
|
|
|
QStringList incomingCapabilities() const;
|
|
|
|
QStringList outgoingCapabilities() const;
|
2022-09-10 22:23:52 +01:00
|
|
|
QSet<QString> pluginsForCapabilities(const QSet<QString> &incoming, const QSet<QString> &outgoing);
|
2016-07-06 16:37:22 +01:00
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
private:
|
|
|
|
PluginLoader();
|
2013-07-04 18:17:22 +01:00
|
|
|
|
2020-03-01 20:00:40 +00:00
|
|
|
QHash<QString, KPluginMetaData> plugins;
|
|
|
|
#ifdef SAILFISHOS
|
2022-09-10 22:23:52 +01:00
|
|
|
QHash<QString, KPluginFactory *> pluginsFactories;
|
2020-03-01 20:00:40 +00:00
|
|
|
#endif
|
2013-07-04 18:17:22 +01:00
|
|
|
};
|
|
|
|
|
2013-07-24 17:42:33 +01:00
|
|
|
#endif
|