KRunner
abstractrunner.h
40 * This means that except for AbstractRunner::run and the constructor, all methods will be non-blocking
119 * Reloads the runner's configuration. This is called when it's KCM in the PluginSelector is applied.
120 * This function may be used to set for example using setMatchRegex, setMinLetterCount or setTriggerWords.
140 * This can be set using the X-Plasma-Runner-Min-Letter-Count property or the setMinLetterCount method.
157 * If this regex is set with a non empty pattern it must match the query in order for match being called.
158 * Just like the minLetterCount property this check is ignored when the runner is in the singleRunnerMode.
214 * @note You should connect here to the prepare/teardown signals. However, avoid doing heavy initialization here
235 * Settings should be written in a KDE config module. See https://develop.kde.org/docs/plasma/krunner/#runner-configuration
QString name() const
Returns the translated name from the runner's metadata.
Definition abstractrunner.cpp:88
void teardown()
This signal is emitted when a session of matches is complete, giving runners the opportunity to tear ...
KConfigGroup config() const
Provides access to the runner's configuration object.
Definition abstractrunner.cpp:49
int minLetterCount() const
This is the minimum letter count for the query.
Definition abstractrunner.cpp:127
virtual void reloadConfiguration()
Reloads the runner's configuration.
Definition abstractrunner.cpp:55
void suspendMatching(bool suspend)
Sets whether or not the runner is available for match requests.
Definition abstractrunner.cpp:114
virtual void run(const KRunner::RunnerContext &context, const KRunner::QueryMatch &match)
Called whenever an exact or possible match associated with this runner is triggered.
Definition abstractrunner.cpp:84
void setTriggerWords(const QStringList &triggerWords)
Constructs internally a regex which requires the query to start with the trigger words.
Definition abstractrunner.cpp:148
void addSyntax(const QString &exampleQuery, const QString &description)
Utility overload for creating a syntax based on the given parameters.
Definition abstractrunner.h:253
bool isMatchingSuspended() const
Definition abstractrunner.cpp:108
void addSyntax(const RunnerSyntax &syntax)
Adds a registered syntax that this runner understands.
Definition abstractrunner.cpp:59
void prepare()
This signal is emitted when matching is about to commence, giving runners an opportunity to prepare t...
bool hasMatchRegex() const
If the runner has a valid regex and non empty regex.
Definition abstractrunner.cpp:167
void addSyntax(const QStringList &exampleQueries, const QString &description)
Utility overload for creating a syntax based on the given parameters.
Definition abstractrunner.h:259
QList< RunnerSyntax > syntaxes() const
Definition abstractrunner.cpp:69
QRegularExpression matchRegex() const
If this regex is set with a non empty pattern it must match the query in order for match being called...
Definition abstractrunner.cpp:137
void setMatchRegex(const QRegularExpression ®ex)
Set the matchRegex property.
Definition abstractrunner.cpp:142
AbstractRunner(QObject *parent, const KPluginMetaData &pluginMetaData)
Constructor for a KRunner plugin.
Definition abstractrunner.cpp:23
virtual void match(KRunner::RunnerContext &context)=0
This is the main query method.
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition querymatch.h:32
The RunnerContext class provides information related to a search, including the search term and colle...
Definition runnercontext.h:32
The RunnerManager class decides what installed runners are runnable, and their ratings.
Definition runnermanager.h:43
Represents a query prototype that the runner accepts.
Definition runnersyntax.h:41
void suspend()
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:10:47 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 31 2025 12:10:47 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.