Warning, file /plasma/libksysguard/systemstats/SensorPlugin.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: 2019 David Edmundson <davidedmundson@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <memory> 0010 0011 #include <QObject> 0012 #include <QVariant> 0013 0014 #include "systemstats_export.h" 0015 0016 namespace KSysGuard 0017 { 0018 class SensorPlugin; 0019 class SensorContainer; 0020 0021 /** 0022 * Base class for plugins 0023 */ 0024 class SYSTEMSTATS_EXPORT SensorPlugin : public QObject 0025 { 0026 Q_OBJECT 0027 public: 0028 SensorPlugin(QObject *parent, const QVariantList &args); 0029 ~SensorPlugin() override; 0030 0031 /** 0032 A list of all containers provided by this plugin 0033 */ 0034 QList<SensorContainer *> containers() const; 0035 0036 SensorContainer *container(const QString &id) const; 0037 0038 /** 0039 * @brief providerName 0040 * @returns a non-user facing name of the plugin base 0041 */ 0042 virtual QString providerName() const; 0043 0044 /** 0045 * @brief 0046 * A hook called before an update will be sent to the user 0047 */ 0048 virtual void update(); 0049 0050 /** 0051 * Registers an object as being available for stat retrieval. 0052 */ 0053 void addContainer(SensorContainer *container); 0054 0055 private: 0056 class Private; 0057 const std::unique_ptr<Private> d; 0058 }; 0059 0060 } // namespace KSysGuard