Plasma
#include <runnersyntax.h>
Public Member Functions | |
RunnerSyntax (const QString &exampleQuery, const QString &description) | |
RunnerSyntax (const RunnerSyntax &other) | |
~RunnerSyntax () | |
void | addExampleQuery (const QString &exampleQuery) |
QString | description () const |
QStringList | exampleQueries () const |
QStringList | exampleQueriesWithTermDescription () const |
RunnerSyntax & | operator= (const RunnerSyntax &rhs) |
QString | searchTermDescription () const |
void | setDescription (const QString &description) |
void | setSearchTermDescription (const QString &description) |
Detailed Description
- Since
- 4.3
Represents a query prototype that the runner accepts. These can be created and registered with AbstractRunner::addSyntax(Syntax &) to allow applications to show to the user what the runner is currently capable of doing
Definition at line 40 of file runnersyntax.h.
Constructor & Destructor Documentation
Constructs a simple syntax object.
- Parameters
-
exampleQuery an example of the query, with :q: placed wherever search term text might appear. e.g. if the runner accepts "keyword some random text" then the value of this parameter should be "keyword :q:" descrition A description of what the described syntax does from the user's point of view.
Definition at line 41 of file runnersyntax.cpp.
Plasma::RunnerSyntax::RunnerSyntax | ( | const RunnerSyntax & | other | ) |
Copy constructor.
Definition at line 46 of file runnersyntax.cpp.
Plasma::RunnerSyntax::~RunnerSyntax | ( | ) |
Definition at line 51 of file runnersyntax.cpp.
Member Function Documentation
void Plasma::RunnerSyntax::addExampleQuery | ( | const QString & | exampleQuery | ) |
Adds a synonymous example query to this Syntax.
Some runners may accept multiple formulations of keywords to trigger the same behaviour. This allows the runner to show these relationships by grouping the example queries into one Syntax object
- Parameters
-
exampleQuery an example of the query, with :q: placed wherever search term text might appear. e.g. if the runner accepts "keyword some random text" then the value of this parameter should be "keyword :q:"
Definition at line 62 of file runnersyntax.cpp.
QString Plasma::RunnerSyntax::description | ( | ) | const |
- Returns
- the description of what the syntax does from the user's point of view
Definition at line 88 of file runnersyntax.cpp.
QStringList Plasma::RunnerSyntax::exampleQueries | ( | ) | const |
- Returns
- the example queries associated with this Syntax object
Definition at line 67 of file runnersyntax.cpp.
QStringList Plasma::RunnerSyntax::exampleQueriesWithTermDescription | ( | ) | const |
- Returns
- the example queries associated with this Syntax object, with the searchTermDescription replacing instances of :q:. Used for showing the queries in the user interface.
Definition at line 72 of file runnersyntax.cpp.
RunnerSyntax & Plasma::RunnerSyntax::operator= | ( | const RunnerSyntax & | rhs | ) |
Assignment operator.
Definition at line 56 of file runnersyntax.cpp.
QString Plasma::RunnerSyntax::searchTermDescription | ( | ) | const |
- Returns
- a description of the search term for this syntax
Definition at line 100 of file runnersyntax.cpp.
void Plasma::RunnerSyntax::setDescription | ( | const QString & | description | ) |
Sets the description for the syntax, describing what it does from the user's point of view.
Definition at line 83 of file runnersyntax.cpp.
void Plasma::RunnerSyntax::setSearchTermDescription | ( | const QString & | description | ) |
Sets the text that should be used to replace instances of :q: in the text.
By default this is the generic phrase "search term". If the syntax expects a specific kind of input, it may be defined here. A syntax used by a runner that changes the brightness of the display may set this to "brightness" for instance.
Definition at line 95 of file runnersyntax.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.