This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-kde/krunner/ollie_runner.h

40 lines
973 B
C++

#ifndef OLLIE_RUNNER_H
#define OLLIE_RUNNER_H
#include <KRunner/AbstractRunner>
#include <KRunner/RunnerContext>
#include <KRunner/QueryMatch>
#include <QDBusInterface>
#if QT_VERSION_MAJOR >= 6
// KF6: classes are in the KRunner namespace
namespace RunnerNS = KRunner;
#else
// KF5: classes are in the Plasma namespace
namespace RunnerNS = Plasma;
#endif
class OllieRunner : public RunnerNS::AbstractRunner
{
Q_OBJECT
public:
#if QT_VERSION_MAJOR >= 6
OllieRunner(QObject *parent, const KPluginMetaData &data);
#else
OllieRunner(QObject *parent, const KPluginMetaData &data, const QVariantList &args);
#endif
void match(RunnerNS::RunnerContext &context) override;
void run(const RunnerNS::RunnerContext &context, const RunnerNS::QueryMatch &match) override;
private:
QDBusInterface *m_iface;
QString oneShotRun(const QString &prompt);
QStringList listSessions();
void killSession(const QString &id);
};
#endif // OLLIE_RUNNER_H