RunnerSyntax Class Reference
from PyKDE4.plasma import *
Namespace: Plasma.RunnerSyntax
Detailed Description
RunnerSyntax
- 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
Method Documentation
addExampleQuery |
( |
self, |
|
|
|
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
@arg 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:"
- Returns:
- the description of what the syntax does from the user's
point of view
- Returns:
- the example queries associated with this Syntax object
- 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.
QString searchTermDescription |
( |
|
self ) |
|
- Returns:
- a description of the search term for this syntax
setDescription |
( |
self, |
|
|
|
QString |
description |
|
) |
|
|
|
Sets the description for the syntax, describing what it does from
the user's point of view.
setSearchTermDescription |
( |
self, |
|
|
|
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.