7#ifndef PLASMA_RUNNERCONTEXT_H
8#define PLASMA_RUNNERCONTEXT_H
12#include <QSharedDataPointer>
14#include "krunner_export.h"
22class RunnerContextPrivate;
45 FileSystem = Directory | File | Executable | ShellCommand,
48 Q_DECLARE_FLAGS(Types, Type)
83#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76)
89 KRUNNER_DEPRECATED_VERSION(5, 76,
"feature is deprecated. Do the checks manually inside of the match logic")
93#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76)
100 KRUNNER_DEPRECATED_VERSION(5, 76,
"feature is unused and not supported by most runners")
101 QStringList enabledCategories() const;
104#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76)
111 KRUNNER_DEPRECATED_VERSION(5, 76,
"feature is unused and not supported by most runners")
112 void setEnabledCategories(const QStringList &categories);
115#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 76)
124 KRUNNER_DEPRECATED_VERSION(5, 76,
"feature is unused, determine the mime type manually if needed")
125 QString mimeType() const;
166#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 81)
178 KRUNNER_DEPRECATED_VERSION(5, 81,
"feature is unused, aggregate and filter the matches before adding them to the runnercontext instead")
179 bool removeMatch(const QString matchId);
182#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 81)
194 KRUNNER_DEPRECATED_VERSION(5, 81,
"feature is unused, aggregate and filter the matches before adding them to the runnercontext instead")
195 bool removeMatches(const QStringList matchIdList);
198#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 81)
210 KRUNNER_DEPRECATED_VERSION(5, 81,
"feature is unused, aggregate and filter the matches before adding them to the runnercontext instead")
221#if KRUNNER_ENABLE_DEPRECATED_SINCE(5, 79)
230 KRUNNER_DEPRECATED_VERSION(5, 79,
"Deprecated due to lack of usage, instead filter the matches manually based on the id")
286 void save(KConfigGroup &config);
299 void matchesChanged();
302 KRUNNER_NO_EXPORT QString requestedQueryString()
const;
303 KRUNNER_NO_EXPORT
int requestedCursorPosition()
const;
304 KRUNNER_NO_EXPORT
bool shouldIgnoreCurrentMatchForHistory()
const;
306 QExplicitlySharedDataPointer<RunnerContextPrivate> d;
309Q_DECLARE_OPERATORS_FOR_FLAGS(RunnerContext::Types)
An abstract base class for Plasma Runner plugins.
Definition abstractrunner.h:69
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition querymatch.h:35
The RunnerContext class provides information related to a search, including the search term,...
Definition runnercontext.h:32
void save(KConfigGroup &config)
bool addMatch(const QueryMatch &match)
Appends a match to the existing list of matches.
void setQuery(const QString &term)
Sets the query term for this object and attempts to determine the type of the search.
bool singleRunnerQueryMode() const
bool addMatches(const QList< QueryMatch > &matches)
Appends lists of matches to the list of matches.
RunnerContext(RunnerContext &other, QObject *parent=nullptr)
Copy constructor.
void reset()
Resets the search term for this object.
void run(const QueryMatch &match)
Run a match using the information from this context.
void restore(const KConfigGroup &config)
Sets the launch counts for the associated match ids.
void requestQueryStringUpdate(const QString &text, int cursorPosition) const
Request that KRunner updates the query string and stasy open, even after running a match.
void setSingleRunnerQueryMode(bool enabled)
Sets single runner query mode.
RunnerContext & operator=(const RunnerContext &other)
Assignment operator.
void ignoreCurrentMatchForHistory() const
Set this to true in the AbstractRunner::run method to prevent the entry from being saved to the histo...
QList< QueryMatch > matches() const
Retrieves all available matches for the current search term.
The RunnerManager class decides what installed runners are runnable, and their ratings.
Definition runnermanager.h:47