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

Kross

  • kross
  • core
manager.h
Go to the documentation of this file.
1/***************************************************************************
2 * manager.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2007 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#ifndef KROSS_MANAGER_H
21#define KROSS_MANAGER_H
22
23#include <QtCore/QStringList>
24#include <QtCore/QMap>
25#include <QtCore/QObject>
26#include <QtCore/QUrl>
27#include <QtScript/QScriptable>
28
29#include "krossconfig.h"
30#include "childreninterface.h"
31#include "metatype.h"
32
33namespace Kross {
34
35 // Forward declarations.
36 class Interpreter;
37 class Action;
38 class ActionCollection;
39 class InterpreterInfo;
40
49 class KROSSCORE_EXPORT Manager
50 : public QObject
51 , public QScriptable
52 , public ChildrenInterface
53 {
54 Q_OBJECT
55
56 public:
57
62 static Manager& self();
63
68 QHash<QString, InterpreterInfo*> interpreterInfos() const;
69
74 bool hasInterpreterInfo(const QString& interpretername) const;
75
81 InterpreterInfo* interpreterInfo(const QString& interpretername) const;
82
93 const QString interpreternameForFile(const QString& file);
94
104 Interpreter* interpreter(const QString& interpretername) const;
105
111 ActionCollection* actionCollection() const;
112
119 MetaTypeHandler* metaTypeHandler(const QByteArray& typeName) const;
120
132 void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler::FunctionPtr* handler);
133
145 void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler::FunctionPtr2* handler);
146
158 void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler* handler);
159
165 bool strictTypesEnabled() const;
166
177 void setStrictTypesEnabled(bool enabled);
178
182 bool hasHandlerAssigned(const QByteArray& typeName) const;
183 public Q_SLOTS:
184
190 QStringList interpreters() const;
191
197 bool hasAction(const QString& name);
198
204 QObject* action(const QString& name);
205
215 QObject* module(const QString& modulename);
216
223 void deleteModules();
224
229 bool executeScriptFile(const QUrl& file = QUrl());
230
231 void addQObject(QObject* obj, const QString &name = QString());
232 QObject* qobject(const QString &name) const;
233 QStringList qobjectNames() const;
234
235 Q_SIGNALS:
236
240 void started(Kross::Action*);
241
245 void finished(Kross::Action*);
246
247 private:
249 class Private;
251 Private* const d;
252
253 public:
254
259 explicit Manager();
260
264 virtual ~Manager();
265 };
266
267}
268
269Q_DECLARE_METATYPE(Kross::Manager*)
270
271#endif
272
childreninterface.h
Kross::ActionCollection
The ActionCollection class manages collections of Action instances.
Definition actioncollection.h:46
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file.
Definition action.h:99
Kross::ChildrenInterface
Interface for managing Object collections.
Definition childreninterface.h:39
Kross::InterpreterInfo
The InterpreterInfo class provides abstract information about a Interpreter before the interpreter-ba...
Definition core/interpreter.h:44
Kross::Interpreter
Base class for interpreter implementations.
Definition core/interpreter.h:178
Kross::Manager
The Manager class is a singleton that provides the main entry point to deal with the Kross Scripting ...
Definition manager.h:53
Kross::Manager::qobjectNames
QStringList qobjectNames() const
Definition manager.cpp:390
Kross::Manager::Manager
Manager()
The constructor.
Definition manager.cpp:121
Kross::Manager::interpreters
QStringList interpreters() const
Definition manager.cpp:280
Kross::Manager::executeScriptFile
bool executeScriptFile(const QUrl &file=QUrl())
Execute a script file.
Definition manager.cpp:370
Kross::Manager::metaTypeHandler
MetaTypeHandler * metaTypeHandler(const QByteArray &typeName) const
Definition manager.cpp:395
Kross::Manager::deleteModules
void deleteModules()
External modules are dynamically loadable and are normally deleted when the kross library is unloaded...
Definition manager.cpp:364
Kross::Manager::setStrictTypesEnabled
void setStrictTypesEnabled(bool enabled)
Enable more strict type handling.
Definition manager.cpp:420
Kross::Manager::interpreter
Interpreter * interpreter(const QString &interpretername) const
Return the Interpreter instance defined by the interpretername.
Definition manager.cpp:271
Kross::Manager::strictTypesEnabled
bool strictTypesEnabled() const
Returns true if strict type handling is enabled.
Definition manager.cpp:415
Kross::Manager::qobject
QObject * qobject(const QString &name) const
Definition manager.cpp:385
Kross::Manager::hasAction
bool hasAction(const QString &name)
Definition manager.cpp:290
Kross::Manager::interpreternameForFile
const QString interpreternameForFile(const QString &file)
Return the name of the Interpreter that feels responsible for the defined file .
Definition manager.cpp:255
Kross::Manager::started
void started(Kross::Action *)
This signal is emitted when the execution of a script is started.
Kross::Manager::finished
void finished(Kross::Action *)
This signal is emitted when the execution of a script is finished.
Kross::Manager::registerMetaTypeHandler
void registerMetaTypeHandler(const QByteArray &typeName, MetaTypeHandler::FunctionPtr *handler)
Register a handler for custom types.
Definition manager.cpp:400
Kross::Manager::self
static Manager & self()
Return the Manager instance.
Definition manager.cpp:73
Kross::Manager::actionCollection
ActionCollection * actionCollection() const
Definition manager.cpp:285
Kross::Manager::hasHandlerAssigned
bool hasHandlerAssigned(const QByteArray &typeName) const
Definition manager.cpp:425
Kross::Manager::module
QObject * module(const QString &modulename)
Load and return an external module.
Definition manager.cpp:307
Kross::Manager::interpreterInfo
InterpreterInfo * interpreterInfo(const QString &interpretername) const
Definition manager.cpp:250
Kross::Manager::addQObject
void addQObject(QObject *obj, const QString &name=QString())
Definition manager.cpp:380
Kross::Manager::interpreterInfos
QHash< QString, InterpreterInfo * > interpreterInfos() const
Definition manager.cpp:240
Kross::Manager::hasInterpreterInfo
bool hasInterpreterInfo(const QString &interpretername) const
Definition manager.cpp:245
Kross::Manager::action
QObject * action(const QString &name)
Definition manager.cpp:295
Kross::Manager::registerMetaTypeHandler
void registerMetaTypeHandler(const QByteArray &typeName, MetaTypeHandler::FunctionPtr2 *handler)
Register a handler for custom types.
Kross::MetaTypeHandler
Base class for metatype-handlers as used returned by the Kross::Manager::metaTypeHandler() method.
Definition metatype.h:139
Kross::MetaTypeHandler::FunctionPtr2
QVariant FunctionPtr2(MetaTypeHandler *handler, void *)
Definition metatype.h:142
Kross::MetaTypeHandler::FunctionPtr
QVariant FunctionPtr(void *)
Definition metatype.h:141
QHash
QObject
QScriptable
QUrl
krossconfig.h
metatype.h
Kross
Definition action.cpp:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 17 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kross

Skip menu "Kross"
  • 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