File indexing completed on 2024-04-28 15:33:59

0001 /*
0002     SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef PURPOSE_PLUGINBASE_H
0008 #define PURPOSE_PLUGINBASE_H
0009 
0010 #include "job.h"
0011 #include <kcoreaddons_export.h>
0012 
0013 #include <QObject>
0014 
0015 #if KCOREADDONS_BUILD_DEPRECATED_SINCE(5, 84)
0016 #define EXPORT_SHARE_VERSION K_EXPORT_PLUGIN_VERSION(2)
0017 #else
0018 // TODO KF6: remove, only added for backward compat in KF5
0019 #define EXPORT_SHARE_VERSION
0020 #endif
0021 
0022 namespace Purpose
0023 {
0024 /**
0025  * @brief Base class to implement by plugins
0026  *
0027  * Class for Qt native plugins to extend. Plugins will just be issuing jobs
0028  * that will be configured then started.
0029  *
0030  * See README.md on how to create plugins on technologies different
0031  * to Qt.
0032  *
0033  * @note This file shouldn't be included by any application.
0034  */
0035 class PURPOSE_EXPORT PluginBase : public QObject
0036 {
0037     Q_OBJECT
0038 public:
0039     explicit PluginBase(QObject *parent = nullptr);
0040     ~PluginBase() override;
0041 
0042     /** @returns the job that will perform the plugin's action. */
0043     virtual Job *createJob() const = 0;
0044 };
0045 
0046 }
0047 
0048 Q_DECLARE_INTERFACE(Purpose::PluginBase, "org.kde.purpose")
0049 
0050 #endif