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

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
  • scripting
runnerscript.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007 by Aaron Seigo <aseigo@kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Library General Public License as
6  * published by the Free Software Foundation; either version 2, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef PLASMA_RUNNERSCRIPT_H
21 #define PLASMA_RUNNERSCRIPT_H
22 
23 #include <kgenericfactory.h>
24 #include <kplugininfo.h>
25 
26 #include <plasma/plasma_export.h>
27 #include <plasma/abstractrunner.h>
28 #include <plasma/scripting/scriptengine.h>
29 
30 namespace Plasma
31 {
32 
33 class RunnerScriptPrivate;
34 
40 class PLASMA_EXPORT RunnerScript : public ScriptEngine
41 {
42  Q_OBJECT
43 
44 public:
52  explicit RunnerScript(QObject *parent = 0);
53  ~RunnerScript();
54 
58  void setRunner(AbstractRunner *runner);
59 
63  AbstractRunner *runner() const;
64 
70  virtual void match(Plasma::RunnerContext &search);
71 
76  virtual void run(const Plasma::RunnerContext &search, const Plasma::QueryMatch &action);
77 
78 
79 Q_SIGNALS:
80  void prepare();
81  void teardown();
82  void createRunOptions(QWidget *widget);
83  void reloadConfiguration();
84  void actionsForMatch(const Plasma::QueryMatch &match, QList<QAction*>* actions);
85 
86 protected:
90  QString mainScript() const;
91 
97  const Package *package() const;
98 
102  KPluginInfo description() const;
103 
108  DataEngine *dataEngine(const QString &name);
109 
110  KConfigGroup config() const;
111  void setIgnoredTypes(RunnerContext::Types types);
112  void setHasRunOptions(bool hasRunOptions);
113  void setSpeed(AbstractRunner::Speed newSpeed);
114  void setPriority(AbstractRunner::Priority newPriority);
115  KService::List serviceQuery(const QString &serviceType,
116  const QString &constraint = QString()) const;
117  QAction* addAction(const QString &id, const QIcon &icon, const QString &text);
118  void addAction(const QString &id, QAction *action);
119  void removeAction(const QString &id);
120  QAction* action(const QString &id) const;
121  QHash<QString, QAction*> actions() const;
122  void clearActions();
123  void addSyntax(const RunnerSyntax &syntax);
124  void setSyntaxes(const QList<RunnerSyntax> &syns);
125 
126 private:
127  friend class AbstractRunner;
128 
129  RunnerScriptPrivate *const d;
130 };
131 
132 #define K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(libname, classname) \
133 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
134 K_EXPORT_PLUGIN(factory("plasma_runnerscriptengine_" #libname))
135 
136 } //Plasma namespace
137 
138 #endif
abstractrunner.h
Plasma::AbstractRunner::Speed
Speed
Specifies a nominal speed for the runner.
Definition: abstractrunner.h:73
Plasma::RunnerScript
Provides a restricted interface for scripting a runner.
Definition: runnerscript.h:40
QWidget
Plasma::AbstractRunner
An abstract base class for Plasma Runner plugins.
Definition: abstractrunner.h:63
QObject
Plasma::RunnerSyntax
Definition: runnersyntax.h:40
Plasma::ScriptEngine
The base class for scripting interfaces to be used in loading plasmoids of a given language...
Definition: scriptengine.h:65
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:58
Plasma::AbstractRunner::Priority
Priority
Specifies a priority for the runner.
Definition: abstractrunner.h:79
Plasma::Package
object representing an installed Plasmagik package
Definition: package.h:42
Plasma::RunnerContext
The RunnerContext class provides information related to a search, including the search term...
Definition: runnercontext.h:46
Plasma::QueryMatch
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition: querymatch.h:47
scriptengine.h
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:34 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