KRunner
abstractrunner.cpp
27 // By now, runners who do "qobject_cast<Krunner::RunnerManager*>(parent)" should have saved the value
51 KConfigGroup runners(KSharedConfig::openConfig(QStringLiteral("krunnerrc")), QStringLiteral("Runners"));
84void AbstractRunner::run(const KRunner::RunnerContext & /*search*/, const KRunner::QueryMatch & /*action*/)
KConfigGroup group(const QString &group)
QString pluginId() const
QString name() const
Returns the translated name from the runner's metadata.
Definition abstractrunner.cpp:88
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 setSyntaxes(const QList< RunnerSyntax > &syntaxes)
Sets the list of syntaxes; passing in an empty list effectively clears the syntaxes.
Definition abstractrunner.cpp:64
void setTriggerWords(const QStringList &triggerWords)
Constructs internally a regex which requires the query to start with the trigger words.
Definition abstractrunner.cpp:148
bool isMatchingSuspended() const
Definition abstractrunner.cpp:108
void addSyntax(const RunnerSyntax &syntax)
Adds a registered syntax that this runner understands.
Definition abstractrunner.cpp:59
bool hasMatchRegex() const
If the runner has a valid regex and non empty regex.
Definition abstractrunner.cpp:167
virtual void init()
Reimplement this to run any initialization routines on first load.
Definition abstractrunner.cpp:103
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
virtual QMimeData * mimeDataForMatch(const KRunner::QueryMatch &match)
Reimplement this if you want your runner to support serialization and drag and drop.
Definition abstractrunner.cpp:74
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
Represents a query prototype that the runner accepts.
Definition runnersyntax.h:41
void suspend()
void setUrls(const QList< QUrl > &urls)
Q_EMITQ_EMIT
QObject * parent() const const
void setObjectName(QAnyStringView name)
QString escape(QStringView str)
bool isValid() const const
QString pattern() const const
bool isEmpty() const const
qsizetype length() const const
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.