C# Class Plasma.RunnerContext

Inheritance: Qyoto.QObject, IDisposable
显示文件 Open project: 0xd34df00d/Qross

Public Methods

Method Description
AddMatch ( string term, Plasma match ) : bool Appends a match to the existing list of matches. If you are going to be adding multiple matches, use addMatches instead. @arg term the search term that this match was generated for. @arg match the match to add
AddMatches ( string term, List matches ) : bool Appends lists of matches to the list of matches. This method is thread safe and causes the matchesChanged() signal to be emitted.
Dispose ( ) : void
IsValid ( ) : bool while (.. a possibly large iteration) { if (!context.isValid()) { return; } ... some processing ... } While not required to be used within runners, it provies a nice way to avoid unnecessary processing in runners that may run for an extended period (as measured in 10s of ms) and therefore improve the user experience.
Match ( string id ) : Plasma.QueryMatch Retrieves a match by id. name="id" the id of the match to return
Matches ( ) : List Retrieves all available matches for the current search term.
MimeType ( ) : string The mimetype that the search term refers to, if discoverable.
Query ( ) : string
RemoveMatch ( string matchId ) : bool Removes a match from the existing list of matches. If you are going to be removing multiple matches, use removeMatches instead. @arg matchId the id of match to remove
RemoveMatches ( List matchIdList ) : bool Removes lists of matches from the existing list of matches. This method is thread safe and causes the matchesChanged() signal to be emitted. @arg matchIdList the list of matches id to remove
Reset ( ) : void Resets the search term for this object. This removes all current matches in the process and turns off single runner query mode.
Restore ( Kimono.KConfigGroup config ) : void Sets the launch counts for the associated match ids If a runner adds a match to this context, the context will check if the match id has been launched before and increase the matches relevance correspondingly. In this manner, any front end can implement adaptive search by sorting items according to relevance. name="config" the config group where launch data was stored
Run ( Plasma match ) : void Run a match using the information from this context The context will also keep track of the number of times the match was launched to sort future matches according to user habits name="match" the match to run
RunnerContext ( ) : System
RunnerContext ( Plasma other ) : System
RunnerContext ( Plasma other, QObject parent ) : System Copy constructor
RunnerContext ( QObject parent ) : System
Save ( Kimono.KConfigGroup config ) : void name="config" the config group where launch data should be stored
SetQuery ( string term ) : void Sets the query term for this object and attempts to determine the type of the search.
SetSingleRunnerQueryMode ( bool enabled ) : void Sets single runner query mode. Note that a call to reset() will turn off single runner query mode.
SingleRunnerQueryMode ( ) : bool
type ( ) : Plasma.RunnerContext.TypeOf The type of item the search term might refer to.

Protected Methods

Method Description
CreateProxy ( ) : void
RunnerContext ( Type dummy ) : System

Method Details

AddMatch() public method

Appends a match to the existing list of matches. If you are going to be adding multiple matches, use addMatches instead. @arg term the search term that this match was generated for. @arg match the match to add
public AddMatch ( string term, Plasma match ) : bool
term string
match Plasma
return bool

AddMatches() public method

Appends lists of matches to the list of matches. This method is thread safe and causes the matchesChanged() signal to be emitted.
public AddMatches ( string term, List matches ) : bool
term string
matches List
return bool

CreateProxy() protected method

protected CreateProxy ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

IsValid() public method

while (.. a possibly large iteration) { if (!context.isValid()) { return; } ... some processing ... } While not required to be used within runners, it provies a nice way to avoid unnecessary processing in runners that may run for an extended period (as measured in 10s of ms) and therefore improve the user experience.
public IsValid ( ) : bool
return bool

Match() public method

Retrieves a match by id. name="id" the id of the match to return
public Match ( string id ) : Plasma.QueryMatch
id string
return Plasma.QueryMatch

Matches() public method

Retrieves all available matches for the current search term.
public Matches ( ) : List
return List

MimeType() public method

The mimetype that the search term refers to, if discoverable.
public MimeType ( ) : string
return string

Query() public method

public Query ( ) : string
return string

RemoveMatch() public method

Removes a match from the existing list of matches. If you are going to be removing multiple matches, use removeMatches instead. @arg matchId the id of match to remove
public RemoveMatch ( string matchId ) : bool
matchId string
return bool

RemoveMatches() public method

Removes lists of matches from the existing list of matches. This method is thread safe and causes the matchesChanged() signal to be emitted. @arg matchIdList the list of matches id to remove
public RemoveMatches ( List matchIdList ) : bool
matchIdList List
return bool

Reset() public method

Resets the search term for this object. This removes all current matches in the process and turns off single runner query mode.
public Reset ( ) : void
return void

Restore() public method

Sets the launch counts for the associated match ids If a runner adds a match to this context, the context will check if the match id has been launched before and increase the matches relevance correspondingly. In this manner, any front end can implement adaptive search by sorting items according to relevance. name="config" the config group where launch data was stored
public Restore ( Kimono.KConfigGroup config ) : void
config Kimono.KConfigGroup
return void

Run() public method

Run a match using the information from this context The context will also keep track of the number of times the match was launched to sort future matches according to user habits name="match" the match to run
public Run ( Plasma match ) : void
match Plasma
return void

RunnerContext() public method

public RunnerContext ( ) : System
return System

RunnerContext() public method

public RunnerContext ( Plasma other ) : System
other Plasma
return System

RunnerContext() public method

Copy constructor
public RunnerContext ( Plasma other, QObject parent ) : System
other Plasma
parent Qyoto.QObject
return System

RunnerContext() public method

public RunnerContext ( QObject parent ) : System
parent Qyoto.QObject
return System

RunnerContext() protected method

protected RunnerContext ( Type dummy ) : System
dummy System.Type
return System

Save() public method

name="config" the config group where launch data should be stored
public Save ( Kimono.KConfigGroup config ) : void
config Kimono.KConfigGroup
return void

SetQuery() public method

Sets the query term for this object and attempts to determine the type of the search.
public SetQuery ( string term ) : void
term string
return void

SetSingleRunnerQueryMode() public method

Sets single runner query mode. Note that a call to reset() will turn off single runner query mode.
public SetSingleRunnerQueryMode ( bool enabled ) : void
enabled bool
return void

SingleRunnerQueryMode() public method

public SingleRunnerQueryMode ( ) : bool
return bool

type() public method

The type of item the search term might refer to.
public type ( ) : Plasma.RunnerContext.TypeOf
return Plasma.RunnerContext.TypeOf