Warning, file /network/kdeconnect-kde/kcmplugin/kdeconnectpluginkcm.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /** 0002 * SPDX-FileCopyrightText: 2015 Albert Vaca <albertvaka@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #pragma once 0008 0009 #include <KCModule> 0010 #include <KPluginMetaData> // Not in KCModule header of older KF5 versions 0011 #include <kconfigwidgets_version.h> 0012 0013 #include "core/kdeconnectpluginconfig.h" 0014 #include "kdeconnectpluginkcm_export.h" 0015 0016 /** 0017 * Inheriting your plugin's KCM from this class gets you a easy way to share 0018 * configuration values between the KCM and the plugin. 0019 */ 0020 class KDECONNECTPLUGINKCM_EXPORT KdeConnectPluginKcm : public KCModule 0021 { 0022 Q_OBJECT 0023 0024 public: 0025 explicit KdeConnectPluginKcm(QObject *parent, const KPluginMetaData &data, const QVariantList &args); 0026 0027 /** 0028 * The device this kcm is instantiated for 0029 */ 0030 QString deviceId() const 0031 { 0032 return m_deviceId; 0033 } 0034 0035 /** 0036 * The object where to save the config, so the plugin can access it 0037 */ 0038 KdeConnectPluginConfig *config() const 0039 { 0040 return m_config; 0041 } 0042 0043 #if KCONFIGWIDGETS_VERSION < QT_VERSION_CHECK(5, 105, 0) 0044 QWidget *widget() 0045 { 0046 return this; 0047 } 0048 #endif 0049 0050 private: 0051 const QString m_deviceId; 0052 const QString m_pluginName; 0053 KdeConnectPluginConfig *const m_config; 0054 };