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

Plasma

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

#include <Plasma/RunnerContext>

Inheritance diagram for Plasma::RunnerContext:
Inheritance graph
[legend]

Public Types

enum  Type {
  None = 0, UnknownType = 1, Directory = 2, File = 4,
  NetworkLocation = 8, Executable = 16, ShellCommand = 32, Help = 64,
  FileSystem = Directory | File | Executable | ShellCommand
}
 

Signals

void matchesChanged ()
 

Public Member Functions

 RunnerContext (QObject *parent=0)
 
 RunnerContext (RunnerContext &other, QObject *parent=0)
 
 ~RunnerContext ()
 
bool addMatch (const QString &term, const QueryMatch &match)
 
bool addMatches (const QString &term, const QList< QueryMatch > &matches)
 
bool isValid () const
 
QueryMatch match (const QString &id) const
 
QList< QueryMatch > matches () const
 
QString mimeType () const
 
RunnerContext & operator= (const RunnerContext &other)
 
QString query () const
 
bool removeMatch (const QString matchId)
 
bool removeMatches (const QStringList matchIdList)
 
bool removeMatches (AbstractRunner *runner)
 
void reset ()
 
void restore (const KConfigGroup &config)
 
void run (const QueryMatch &match)
 
void save (KConfigGroup &config)
 
void setQuery (const QString &term)
 
void setSingleRunnerQueryMode (bool enabled)
 
bool singleRunnerQueryMode () const
 
Type type () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

The RunnerContext class provides information related to a search, including the search term, metadata on the search term and collected matches.

Definition at line 46 of file runnercontext.h.

Member Enumeration Documentation

enum Plasma::RunnerContext::Type
Enumerator
None 
UnknownType 
Directory 
File 
NetworkLocation 
Executable 
ShellCommand 
Help 
FileSystem 

Definition at line 51 of file runnercontext.h.

Constructor & Destructor Documentation

Plasma::RunnerContext::RunnerContext ( QObject *  parent = 0)
explicit

Definition at line 266 of file runnercontext.cpp.

Plasma::RunnerContext::RunnerContext ( RunnerContext &  other,
QObject *  parent = 0 
)

Copy constructor.

Definition at line 273 of file runnercontext.cpp.

Plasma::RunnerContext::~RunnerContext ( )

Definition at line 281 of file runnercontext.cpp.

Member Function Documentation

bool Plasma::RunnerContext::addMatch ( const QString &  term,
const QueryMatch &  match 
)

Appends a match to the existing list of matches.

If you are going to be adding multiple matches, use addMatches instead.

Parameters
termthe search term that this match was generated for.
matchthe match to add
Returns
true if the match was added, false otherwise.

Definition at line 408 of file runnercontext.cpp.

bool Plasma::RunnerContext::addMatches ( const QString &  term,
const QList< QueryMatch > &  matches 
)

Appends lists of matches to the list of matches.

This method is thread safe and causes the matchesChanged() signal to be emitted.

Returns
true if matches were added, false if matches were e.g. outdated

Definition at line 373 of file runnercontext.cpp.

bool Plasma::RunnerContext::isValid ( ) const
Returns
true if this context is no longer valid and therefore matching using it should abort. Most useful as an optimization technique inside of AbstractRunner subclasses in the match method, e.g.:

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.

Since
4.2.3

Definition at line 364 of file runnercontext.cpp.

QueryMatch Plasma::RunnerContext::match ( const QString &  id) const

Retrieves a match by id.

Parameters
idthe id of the match to return
Returns
the match associated with this id, or an invalid QueryMatch object if the id does not eixst

Definition at line 530 of file runnercontext.cpp.

QList< QueryMatch > Plasma::RunnerContext::matches ( ) const

Retrieves all available matches for the current search term.

Returns
a list of matches

Definition at line 522 of file runnercontext.cpp.

void Plasma::RunnerContext::matchesChanged ( )
signal
QString Plasma::RunnerContext::mimeType ( ) const

The mimetype that the search term refers to, if discoverable.

Returns
QString() if the mimetype can not be determined, otherwise the mimetype of the object being referred to by the search string.

Definition at line 359 of file runnercontext.cpp.

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

Assignment operator.

Since
4.4

Definition at line 285 of file runnercontext.cpp.

QString Plasma::RunnerContext::query ( ) const
Returns
the current search query term.

Definition at line 346 of file runnercontext.cpp.

bool Plasma::RunnerContext::removeMatch ( const QString  matchId)

Removes a match from the existing list of matches.

If you are going to be removing multiple matches, use removeMatches instead.

Parameters
matchIdthe id of match to remove
Returns
true if the match was removed, false otherwise.
Since
4.4

Definition at line 471 of file runnercontext.cpp.

bool Plasma::RunnerContext::removeMatches ( const QStringList  matchIdList)

Removes lists of matches from the existing list of matches.

This method is thread safe and causes the matchesChanged() signal to be emitted.

Parameters
matchIdListthe list of matches id to remove
Returns
true if at least one match was removed, false otherwise.
Since
4.4

Definition at line 434 of file runnercontext.cpp.

bool Plasma::RunnerContext::removeMatches ( Plasma::AbstractRunner *  runner)

Removes lists of matches from a given AbstractRunner.

This method is thread safe and causes the matchesChanged() signal to be emitted.

Parameters
runnerthe AbstractRunner from which to remove matches
Returns
true if at least one match was removed, false otherwise.
Since
4.10

Definition at line 491 of file runnercontext.cpp.

void Plasma::RunnerContext::reset ( )

Resets the search term for this object.

This removes all current matches in the process and turns off single runner query mode.

Definition at line 300 of file runnercontext.cpp.

void Plasma::RunnerContext::restore ( const KConfigGroup &  config)

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.

Parameters
configthe config group where launch data was stored

Definition at line 553 of file runnercontext.cpp.

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

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

Parameters
matchthe match to run

Definition at line 580 of file runnercontext.cpp.

void Plasma::RunnerContext::save ( KConfigGroup &  config)
Parameters
configthe config group where launch data should be stored

Definition at line 566 of file runnercontext.cpp.

void Plasma::RunnerContext::setQuery ( const QString &  term)

Sets the query term for this object and attempts to determine the type of the search.

Definition at line 334 of file runnercontext.cpp.

void Plasma::RunnerContext::setSingleRunnerQueryMode ( bool  enabled)

Sets single runner query mode.

Note that a call to reset() will turn off single runner query mode.

See also
reset()
Since
4.4

Definition at line 543 of file runnercontext.cpp.

bool Plasma::RunnerContext::singleRunnerQueryMode ( ) const
Returns
true if the current query is a single runner query
Since
4.4

Definition at line 548 of file runnercontext.cpp.

RunnerContext::Type Plasma::RunnerContext::type ( ) const

The type of item the search term might refer to.

See also
Type

Definition at line 354 of file runnercontext.cpp.


The documentation for this class was generated from the following files:
  • runnercontext.h
  • runnercontext.cpp
This file is part of the KDE documentation.
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.

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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • 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