File indexing completed on 2024-04-28 16:51:32

0001 /*
0002     SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de>
0003 
0004     SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractbrowserplugin.h"
0010 
0011 #include <QDBusContext>
0012 
0013 // FIXME adaptor needs this, can we tell qt5_add_dbus_adaptor to add it to the generated file?
0014 #include "dbusutils_p.h"
0015 
0016 class AbstractKRunnerPlugin : public AbstractBrowserPlugin, protected QDBusContext
0017 {
0018     Q_OBJECT
0019 
0020 protected:
0021     AbstractKRunnerPlugin(const QString &objectPath, const QString &subsystemId, int protocolVersion, QObject *parent);
0022 
0023     static QImage imageFromDataUrl(const QString &dataUrl);
0024     static RemoteImage serializeImage(const QImage &image);
0025 
0026 public:
0027     bool onLoad() override;
0028     bool onUnload() override;
0029 
0030     // DBus API
0031     virtual RemoteActions Actions() = 0;
0032     virtual RemoteMatches Match(const QString &searchTerm) = 0;
0033     virtual void Run(const QString &id, const QString &actionId) = 0;
0034 
0035 private:
0036     QString m_objectPath;
0037 };