2015-03-14 04:19:39 +00:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2015 Albert Vaca <albertvaka@gmail.com>
|
2015-03-14 04:19:39 +00: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
|
2015-03-14 04:19:39 +00:00
|
|
|
*/
|
|
|
|
|
2023-08-12 12:56:19 +01:00
|
|
|
#pragma once
|
2015-03-14 04:19:39 +00:00
|
|
|
|
|
|
|
#include <KCModule>
|
2023-07-21 11:26:19 +01:00
|
|
|
#include <KPluginMetaData> // Not in KCModule header of older KF5 versions
|
2023-04-17 18:10:08 +01:00
|
|
|
#include <kconfigwidgets_version.h>
|
2015-03-14 04:19:39 +00:00
|
|
|
|
|
|
|
#include "core/kdeconnectpluginconfig.h"
|
2015-09-10 14:51:38 +01:00
|
|
|
#include "kdeconnectpluginkcm_export.h"
|
2015-03-14 04:19:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inheriting your plugin's KCM from this class gets you a easy way to share
|
|
|
|
* configuration values between the KCM and the plugin.
|
|
|
|
*/
|
2022-09-10 22:23:52 +01:00
|
|
|
class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule
|
2015-03-14 04:19:39 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-08-12 12:56:19 +01:00
|
|
|
explicit KdeConnectPluginKcm(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
|
2015-03-14 04:19:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The device this kcm is instantiated for
|
|
|
|
*/
|
2023-08-12 12:56:19 +01:00
|
|
|
QString deviceId() const
|
|
|
|
{
|
|
|
|
return m_deviceId;
|
|
|
|
}
|
2015-03-14 04:19:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The object where to save the config, so the plugin can access it
|
|
|
|
*/
|
2023-08-12 12:56:19 +01:00
|
|
|
KdeConnectPluginConfig *config() const
|
|
|
|
{
|
|
|
|
return m_config;
|
|
|
|
}
|
2015-03-14 04:19:39 +00:00
|
|
|
|
2023-04-17 18:10:08 +01:00
|
|
|
#if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0)
|
|
|
|
QWidget *widget()
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-03-14 04:19:39 +00:00
|
|
|
private:
|
2023-08-12 12:56:19 +01:00
|
|
|
const QString m_deviceId;
|
|
|
|
const QString m_pluginName;
|
|
|
|
KdeConnectPluginConfig *const m_config;
|
2015-03-14 04:19:39 +00:00
|
|
|
};
|