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

Kross

  • sources
  • kde-4.12
  • kdelibs
  • 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 
33 namespace 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 
269 Q_DECLARE_METATYPE(Kross::Manager*)
270 
271 #endif
272 
Kross::MetaTypeHandler::FunctionPtr
QVariant( FunctionPtr)(void *)
Definition: metatype.h:141
name
const char * name(StandardAction id)
Kross::MetaTypeHandler::FunctionPtr2
QVariant( FunctionPtr2)(MetaTypeHandler *handler, void *)
Definition: metatype.h:142
QUrl
QString
QHash
QObject
Kross::InterpreterInfo
The InterpreterInfo class provides abstract information about a Interpreter before the interpreter-ba...
Definition: core/interpreter.h:43
QScriptable
childreninterface.h
metatype.h
QStringList
Kross::ChildrenInterface
Interface for managing Object collections.
Definition: childreninterface.h:38
Kross::Interpreter
Base class for interpreter implementations.
Definition: core/interpreter.h:177
Action
Kross::MetaTypeHandler
Base class for metatype-handlers as used returned by the Kross::Manager::metaTypeHandler() method...
Definition: metatype.h:138
krossconfig.h
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:94
Kross::ActionCollection
The ActionCollection class manages collections of Action instances.
Definition: actioncollection.h:45
Kross::Manager
The Manager class is a singleton that provides the main entry point to deal with the Kross Scripting ...
Definition: manager.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 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 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