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

Plasma

  • 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
30namespace Plasma
31{
32
33class RunnerScriptPrivate;
34
40class PLASMA_EXPORT RunnerScript : public ScriptEngine
41{
42 Q_OBJECT
43
44public:
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
79Q_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
86protected:
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
126private:
127 friend class AbstractRunner;
128
129 RunnerScriptPrivate *const d;
130};
131
132#define K_EXPORT_PLASMA_RUNNERSCRIPTENGINE(libname, classname) \
133K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
134K_EXPORT_PLUGIN(factory("plasma_runnerscriptengine_" #libname))
135
136} //Plasma namespace
137
138#endif
abstractrunner.h
Plasma::AbstractRunner
An abstract base class for Plasma Runner plugins.
Definition: abstractrunner.h:64
Plasma::AbstractRunner::Speed
Speed
Specifies a nominal speed for the runner.
Definition: abstractrunner.h:73
Plasma::AbstractRunner::Priority
Priority
Specifies a priority for the runner.
Definition: abstractrunner.h:79
Plasma::DataEngine
Data provider for plasmoids (Plasma plugins)
Definition: dataengine.h:59
Plasma::Package
object representing an installed Plasmagik package
Definition: package.h:43
Plasma::QueryMatch
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition: querymatch.h:48
Plasma::RunnerContext
The RunnerContext class provides information related to a search, including the search term,...
Definition: runnercontext.h:47
Plasma::RunnerScript
Provides a restricted interface for scripting a runner.
Definition: runnerscript.h:41
Plasma::RunnerScript::actionsForMatch
void actionsForMatch(const Plasma::QueryMatch &match, QList< QAction * > *actions)
Plasma::RunnerScript::createRunOptions
void createRunOptions(QWidget *widget)
Plasma::RunnerScript::teardown
void teardown()
Plasma::RunnerScript::reloadConfiguration
void reloadConfiguration()
Plasma::RunnerScript::prepare
void prepare()
Plasma::RunnerSyntax
Definition: runnersyntax.h:41
Plasma::ScriptEngine
The base class for scripting interfaces to be used in loading plasmoids of a given language.
Definition: scriptengine.h:66
QObject
QWidget
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
scriptengine.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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