• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

Plasma::QueryMatch

Plasma::QueryMatch Class Reference

#include <querymatch.h>

List of all members.


Detailed Description

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

Definition at line 43 of file querymatch.h.


Public Types

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

Public Member Functions

QVariant data () const
QIcon icon () const
QString id () const
bool isEnabled () const
bool isValid () const
bool operator< (const QueryMatch &other) const
QueryMatch & operator= (const QueryMatch &other)
 QueryMatch (const QueryMatch &other)
 QueryMatch (AbstractRunner *runner)
qreal relevance () const
void run (const RunnerContext &context) const
AbstractRunner * runner () 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 setSubtext (const QString &text)
void setText (const QString &text)
void setType (Type type)
QString subtext () const
QString text () const
Type type () const
 ~QueryMatch ()

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 49 of file querymatch.h.


Constructor & Destructor Documentation

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

Constructs a PossibleMatch associated with a given RunnerContext and runner.

  • search the RunnerContext this match belongs to
  • runner the runner this match belongs to

Definition at line 59 of file querymatch.cpp.

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

Copy constructor.

Definition at line 68 of file querymatch.cpp.

Plasma::QueryMatch::~QueryMatch (  ) 

Definition at line 73 of file querymatch.cpp.


Member Function Documentation

QVariant Plasma::QueryMatch::data (  )  const

Definition at line 145 of file querymatch.cpp.

QIcon Plasma::QueryMatch::icon (  )  const

Definition at line 160 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 82 of file querymatch.cpp.

bool Plasma::QueryMatch::isEnabled (  )  const

Definition at line 170 of file querymatch.cpp.

bool Plasma::QueryMatch::isValid (  )  const

Definition at line 77 of file querymatch.cpp.

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

Definition at line 175 of file querymatch.cpp.

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

Definition at line 194 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 102 of file querymatch.cpp.

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

Requests this match to activae using the given context.

Parameters:
context the context to use in conjunction with this run

Definition at line 203 of file querymatch.cpp.

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

The runner associated with this action.

Definition at line 107 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 122 of file querymatch.cpp.

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

Definition at line 165 of file querymatch.cpp.

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

Definition at line 140 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:
id the new identifying string to use to refer to this entry

Definition at line 128 of file querymatch.cpp.

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

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

Parameters:
relevance a number between 0 and 1.

Definition at line 97 of file querymatch.cpp.

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

Definition at line 117 of file querymatch.cpp.

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

Definition at line 112 of file querymatch.cpp.

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

Sets the type of match this action represents.

Definition at line 87 of file querymatch.cpp.

QString Plasma::QueryMatch::subtext (  )  const

Definition at line 155 of file querymatch.cpp.

QString Plasma::QueryMatch::text (  )  const

Definition at line 150 of file querymatch.cpp.

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

The type of action this is.

Defaults to PossibleMatch.

Definition at line 92 of file querymatch.cpp.


The documentation for this class was generated from the following files:
  • querymatch.h
  • querymatch.cpp

libplasma

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

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal