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

Kross

manager.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * manager.h
00003  * This file is part of the KDE project
00004  * copyright (C)2004-2007 by Sebastian Sauer (mail@dipe.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this program; see the file COPYING.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  ***************************************************************************/
00019 
00020 #ifndef KROSS_MANAGER_H
00021 #define KROSS_MANAGER_H
00022 
00023 #include <QtCore/QStringList>
00024 #include <QtCore/QMap>
00025 #include <QtCore/QObject>
00026 #include <QtCore/QUrl>
00027 #include <QtScript/QScriptable>
00028 
00029 #include "krossconfig.h"
00030 #include "childreninterface.h"
00031 #include "metatype.h"
00032 
00033 namespace Kross {
00034 
00035     // Forward declarations.
00036     class Interpreter;
00037     class Action;
00038     class ActionCollection;
00039     class InterpreterInfo;
00040 
00049     class KROSSCORE_EXPORT Manager
00050         : public QObject
00051         , public QScriptable
00052         , public ChildrenInterface
00053     {
00054             Q_OBJECT
00055 
00056         public:
00057 
00062             static Manager& self();
00063 
00068             QHash<QString, InterpreterInfo*> interpreterInfos() const;
00069 
00074             bool hasInterpreterInfo(const QString& interpretername) const;
00075 
00081             InterpreterInfo* interpreterInfo(const QString& interpretername) const;
00082 
00093             const QString interpreternameForFile(const QString& file);
00094 
00104             Interpreter* interpreter(const QString& interpretername) const;
00105 
00111             ActionCollection* actionCollection() const;
00112 
00119             MetaTypeHandler* metaTypeHandler(const QByteArray& typeName) const;
00120 
00132             void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler::FunctionPtr* handler);
00133 
00145             void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler::FunctionPtr2* handler);
00146 
00158             void registerMetaTypeHandler(const QByteArray& typeName, MetaTypeHandler* handler);
00159 
00165             bool strictTypesEnabled() const;
00166 
00177             void setStrictTypesEnabled(bool enabled);
00178 
00182             bool hasHandlerAssigned(const QByteArray& typeName) const;
00183         public Q_SLOTS:
00184 
00190             QStringList interpreters() const;
00191 
00197             bool hasAction(const QString& name);
00198 
00204             QObject* action(const QString& name);
00205 
00215             QObject* module(const QString& modulename);
00216 
00221             bool executeScriptFile(const QUrl& file = QUrl());
00222 
00223             void addQObject(QObject* obj, const QString &name = QString());
00224             QObject* qobject(const QString &name) const;
00225             QStringList qobjectNames() const;
00226 
00227         Q_SIGNALS:
00228 
00232             void started(Kross::Action*);
00233 
00237             void finished(Kross::Action*);
00238 
00239         private:
00241             class Private;
00243             Private* const d;
00244 
00245         public:
00246 
00251             explicit Manager();
00252 
00256             virtual ~Manager();
00257     };
00258 
00259 }
00260 
00261 Q_DECLARE_METATYPE(Kross::Manager*)
00262 
00263 #endif
00264 

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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