• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • Plasma
  • QueryMatch
Public Types | Public Member Functions | List of all members
Plasma::QueryMatch Class Reference

#include <Plasma/QueryMatch>

Public Types

enum  Type {
  NoMatch = 0, CompletionMatch = 10, PossibleMatch = 30, InformationalMatch = 50,
  HelperMatch = 70, ExactMatch = 100
}
 

Public Member Functions

 QueryMatch (AbstractRunner *runner)
 
 QueryMatch (const QueryMatch &other)
 
 ~QueryMatch ()
 
void createConfigurationInterface (QWidget *parent)
 
QVariant data () const
 
bool hasConfigurationInterface () const
 
QIcon icon () const
 
QString id () const
 
bool isEnabled () const
 
bool isValid () const
 
bool operator!= (const QueryMatch &other) const
 
bool operator< (const QueryMatch &other) const
 
QueryMatch & operator= (const QueryMatch &other)
 
bool operator== (const QueryMatch &other) const
 
qreal relevance () const
 
void run (const RunnerContext &context) const
 
AbstractRunner * runner () const
 
QAction * selectedAction () const
 
void setData (const QVariant &data)
 
void setEnabled (bool enable)
 
void setIcon (const QIcon &icon)
 
void setId (const QString &id)
 
void setRelevance (qreal relevance)
 
void setSelectedAction (QAction *action)
 
void setSubtext (const QString &text)
 
void setText (const QString &text)
 
void setType (Type type)
 
QString subtext () const
 
QString text () const
 
Type type () const
 

Detailed Description

A match returned by an AbstractRunner in response to a given RunnerContext.

Definition at line 47 of file querymatch.h.

Member Enumeration Documentation

enum Plasma::QueryMatch::Type

The type of match.

Value is important here as it is used for sorting

Enumerator
NoMatch 

Null match.

CompletionMatch 

Possible completion for the data of the query.

PossibleMatch 

Something that may match the query.

InformationalMatch 

A purely informational, non-actionable match, such as the answer to a question or calculation.

HelperMatch 

A match that represents an action not directly related to activating the given search term, such as a search in an external tool or a command learning trigger.

Helper matches tend to be generic to the query and should not be autoactivated just because the user hits "Enter" while typing. They must be explicitly selected to be activated, but unlike InformationalMatch cause an action to be triggered.

ExactMatch 

An exact match to the query.

Definition at line 53 of file querymatch.h.

Constructor & Destructor Documentation

Plasma::QueryMatch::QueryMatch ( AbstractRunner *  runner)
explicit

Constructs a PossibleMatch associated with a given RunnerContext and runner.

Parameters
runnerthe runner this match belongs to

Definition at line 89 of file querymatch.cpp.

Plasma::QueryMatch::QueryMatch ( const QueryMatch &  other)

Copy constructor.

Definition at line 95 of file querymatch.cpp.

Plasma::QueryMatch::~QueryMatch ( )

Definition at line 100 of file querymatch.cpp.

Member Function Documentation

void Plasma::QueryMatch::createConfigurationInterface ( QWidget *  parent)

If hasConfigurationInterface() returns true, this method may be called to get a widget displaying the options the user can interact with to modify the behaviour of what happens when the match is run.

Parameters
widgetthe parent of the options widgets.
Since
4.3

Definition at line 286 of file querymatch.cpp.

QVariant Plasma::QueryMatch::data ( ) const
Returns
the data associated with this match; usually runner-specific

Definition at line 189 of file querymatch.cpp.

bool Plasma::QueryMatch::hasConfigurationInterface ( ) const
Returns
true if this match can be configured before being run
Since
4.3

Definition at line 281 of file querymatch.cpp.

QIcon Plasma::QueryMatch::icon ( ) const
Returns
the icon for this match

Definition at line 207 of file querymatch.cpp.

QString Plasma::QueryMatch::id ( ) const

a string that can be used as an ID for this match, even between different queries.

It is based in part on the source of the match (the AbstractRunner) and distinguishing information provided by the runner, ensuring global uniqueness as well as consistency between query matches.

Definition at line 109 of file querymatch.cpp.

bool Plasma::QueryMatch::isEnabled ( ) const
Returns
true if the match is enabled and therefore runnable, otherwise false

Definition at line 218 of file querymatch.cpp.

bool Plasma::QueryMatch::isValid ( ) const
Returns
true if the match is valid and can therefore be run, an invalid match does not have an associated AbstractRunner

Definition at line 104 of file querymatch.cpp.

bool Plasma::QueryMatch::operator!= ( const QueryMatch &  other) const

Definition at line 268 of file querymatch.cpp.

bool Plasma::QueryMatch::operator< ( const QueryMatch &  other) const

Definition at line 233 of file querymatch.cpp.

QueryMatch & Plasma::QueryMatch::operator= ( const QueryMatch &  other)

Definition at line 254 of file querymatch.cpp.

bool Plasma::QueryMatch::operator== ( const QueryMatch &  other) const

Definition at line 263 of file querymatch.cpp.

qreal Plasma::QueryMatch::relevance ( ) const

The relevance of this action to the search.

By default, the relevance is 1.

Returns
a number between 0 and 1

Definition at line 133 of file querymatch.cpp.

void Plasma::QueryMatch::run ( const RunnerContext &  context) const

Requests this match to activae using the given context.

Parameters
contextthe context to use in conjunction with this run
See also
AbstractRunner::run

Definition at line 273 of file querymatch.cpp.

AbstractRunner * Plasma::QueryMatch::runner ( ) const
Returns
the runner associated with this action

Definition at line 138 of file querymatch.cpp.

QAction * Plasma::QueryMatch::selectedAction ( ) const

The current action.

Definition at line 223 of file querymatch.cpp.

void Plasma::QueryMatch::setData ( const QVariant &  data)

Sets data to be used internally by the associated AbstractRunner.

When set, it is also used to form part of the id() for this match. If that is innapropriate as an id, the runner may generate its own id and set that with setId(const QString&) directly after calling setData

Definition at line 155 of file querymatch.cpp.

void Plasma::QueryMatch::setEnabled ( bool  enable)

Sets whether or not this match can be activited.

Parameters
enabletrue if the match is enabled and therefore runnable

Definition at line 213 of file querymatch.cpp.

void Plasma::QueryMatch::setIcon ( const QIcon &  icon)

Sets the icon associated with this match.

Parameters
iconthe icon to show along with the match

Definition at line 183 of file querymatch.cpp.

void Plasma::QueryMatch::setId ( const QString &  id)

Sets the id for this match; useful if the id does not match data().toString().

The id must be unique to all matches from this runner, and should remain constant for the same query for best results.

Parameters
idthe new identifying string to use to refer to this entry

Definition at line 169 of file querymatch.cpp.

void Plasma::QueryMatch::setRelevance ( qreal  relevance)

Sets the relevance of this action for the search it was created for.

Parameters
relevancea number between 0 and 1.

Definition at line 128 of file querymatch.cpp.

void Plasma::QueryMatch::setSelectedAction ( QAction *  action)

Sets the selected action.

Definition at line 228 of file querymatch.cpp.

void Plasma::QueryMatch::setSubtext ( const QString &  text)

Sets the descriptive text for this match; can be longer than the main title text.

Parameters
textthe text to use as the description

Definition at line 149 of file querymatch.cpp.

void Plasma::QueryMatch::setText ( const QString &  text)

Sets the main title text for this match; should be short enough to fit nicely on one line in a user interface.

Parameters
textthe text to use as the title

Definition at line 143 of file querymatch.cpp.

void Plasma::QueryMatch::setType ( Type  type)

Sets the type of match this action represents.

Definition at line 118 of file querymatch.cpp.

QString Plasma::QueryMatch::subtext ( ) const
Returns
the descriptive text for this match

Definition at line 201 of file querymatch.cpp.

QString Plasma::QueryMatch::text ( ) const
Returns
the title text for this match

Definition at line 195 of file querymatch.cpp.

QueryMatch::Type Plasma::QueryMatch::type ( ) const

The type of action this is.

Defaults to PossibleMatch.

Definition at line 123 of file querymatch.cpp.


The documentation for this class was generated from the following files:
  • querymatch.h
  • querymatch.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:35 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal