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

libplasma

Plasma::AbstractRunner

Plasma::AbstractRunner Class Reference

#include <abstractrunner.h>

Inheritance diagram for Plasma::AbstractRunner:

Inheritance graph
[legend]

List of all members.


Detailed Description

An abstract base class for Plasma Runner plugins.

Definition at line 40 of file abstractrunner.h.


Public Types

enum  Speed { NormalSpeed, SlowSpeed }
typedef QList< AbstractRunner * > List

Public Member Functions

 AbstractRunner (QObject *parent=0)
virtual ~AbstractRunner ()
KConfigGroup config () const
virtual void match (Plasma::SearchContext *search)=0
void performMatch (Plasma::SearchContext &globalContext)
bool hasMatchOptions ()
virtual void createMatchOptions (QWidget *widget)
bool isConfigurable ()
virtual void createConfigurationInterface (QWidget *widget)
virtual void exec (Plasma::SearchMatch *action)
Speed speed () const

Static Public Member Functions

static List loadRunners (QObject *parent, const QStringList &whitelist=QStringList())

Protected Member Functions

void setHasMatchOptions (bool hasMatchOptions)
void setIsConfigurable (bool canBeConfigured)
void setSpeed (Speed newSpeed)

Member Typedef Documentation

typedef QList<AbstractRunner*> Plasma::AbstractRunner::List

Definition at line 48 of file abstractrunner.h.


Member Enumeration Documentation

enum Plasma::AbstractRunner::Speed

Enumerator:
NormalSpeed 
SlowSpeed 

Definition at line 45 of file abstractrunner.h.


Constructor & Destructor Documentation

Plasma::AbstractRunner::AbstractRunner ( QObject *  parent = 0  )  [explicit]

Constructs a Runner object.

Since AbstractRunner has pure virtuals, this constructor can not be called directly. Rather a subclass must be created

Definition at line 40 of file abstractrunner.cpp.

Plasma::AbstractRunner::~AbstractRunner (  )  [virtual]

Definition at line 46 of file abstractrunner.cpp.


Member Function Documentation

AbstractRunner::List Plasma::AbstractRunner::loadRunners ( QObject *  parent,
const QStringList &  whitelist = QStringList() 
) [static]

Static method is called to load and get a list available of Runners.

Parameters:
whitelist An optional whitelist of runners to load

Definition at line 129 of file abstractrunner.cpp.

KConfigGroup Plasma::AbstractRunner::config (  )  const

Provides access to the runner's configuration object.

Definition at line 51 of file abstractrunner.cpp.

virtual void Plasma::AbstractRunner::match ( Plasma::SearchContext *  search  )  [pure virtual]

If the runner can run precisely this term, return a QAction, else return 0.

The first runner that returns a QAction will be the default runner. Other runner's actions will be suggested in the interface. Non-exact matches should be offered via findMatches. The action will be activated if the user selects it. If the action is informational only and should not be executed, disable the action with setEnabled( false ).

If this runner's exact match is selected, the action will not be triggered, but it will be passed into the exec method.

See also:
exec
Ownership of the action passes to the AbstractRunner class.

void Plasma::AbstractRunner::performMatch ( Plasma::SearchContext &  globalContext  ) 

Definition at line 62 of file abstractrunner.cpp.

bool Plasma::AbstractRunner::hasMatchOptions (  ) 

If the runner has options that the user can interact with to modify what happens when exec or one of the actions created in fillMatches is called, the runner should return true.

Definition at line 84 of file abstractrunner.cpp.

void Plasma::AbstractRunner::createMatchOptions ( QWidget *  widget  )  [virtual]

If hasMatchOptions() 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 a given match is selected.

Parameters:
widget the parent of the options widgets.

Definition at line 94 of file abstractrunner.cpp.

bool Plasma::AbstractRunner::isConfigurable (  ) 

If the runner itself has configuration options, this method returns true.

Definition at line 99 of file abstractrunner.cpp.

void Plasma::AbstractRunner::createConfigurationInterface ( QWidget *  widget  )  [virtual]

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

Parameters:
widget the parent of the options widgets.

Definition at line 109 of file abstractrunner.cpp.

void Plasma::AbstractRunner::exec ( Plasma::SearchMatch *  action  )  [virtual]

Called whenever an exact or possible match associated with this runner is triggered.

Definition at line 124 of file abstractrunner.cpp.

AbstractRunner::Speed Plasma::AbstractRunner::speed (  )  const

The nominal speed of the runner.

Definition at line 114 of file abstractrunner.cpp.

void Plasma::AbstractRunner::setHasMatchOptions ( bool  hasMatchOptions  )  [protected]

Sets whether or not the the runner has options for matches.

Definition at line 89 of file abstractrunner.cpp.

void Plasma::AbstractRunner::setIsConfigurable ( bool  canBeConfigured  )  [protected]

Sets whether or not the runner has configuration options itself.

Definition at line 104 of file abstractrunner.cpp.

void Plasma::AbstractRunner::setSpeed ( Speed  newSpeed  )  [protected]

Sets the nominal speed of the runner.

Only slow runners need to call this within their constructor because the default speed is NormalSpeed. Runners that use DBUS should call this within their constructors.

Definition at line 119 of file abstractrunner.cpp.


The documentation for this class was generated from the following files:
  • abstractrunner.h
  • abstractrunner.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
  • 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