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

Kross

interpreter.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * interpreter.h
00003  * This file is part of the KDE project
00004  * copyright (C)2004-2006 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_INTERPRETER_H
00021 #define KROSS_INTERPRETER_H
00022 
00023 
00024 #include <QtCore/QStringList>
00025 #include <QtCore/QVariant>
00026 #include <QtCore/QMap>
00027 
00028 #include "errorinterface.h"
00029 
00030 namespace Kross {
00031 
00032     // Forward declaration.
00033     class Manager;
00034     class Action;
00035     class Script;
00036     class Interpreter;
00037 
00043     class KROSSCORE_EXPORT InterpreterInfo : public ErrorInterface
00044     {
00045         public:
00046 
00051             class Option
00052             {
00053                 public:
00054 
00058                     typedef QMap<QString, Option* > Map;
00059 
00066                     Option(const QString& comment, const QVariant& value)
00067                         : comment(comment), value(value) {}
00068 
00070                     QString comment;
00071 
00073                     QVariant value;
00074             };
00075 
00079             InterpreterInfo(const QString& interpretername, const QString& library, const QString& wildcard, QStringList mimetypes, Option::Map options);
00080 
00084             ~InterpreterInfo();
00085 
00089             const QString interpreterName() const;
00090 
00097             const QString wildcard() const;
00098 
00105             const QStringList mimeTypes() const;
00106 
00110             bool hasOption(const QString& key) const;
00111 
00115             Option* option(const QString& name) const;
00116 
00122             const QVariant optionValue(const QString& name, const QVariant& defaultvalue = QVariant()) const;
00123 
00127             Option::Map options();
00128 
00133             Interpreter* interpreter();
00134 
00135         private:
00137             class Private;
00139             Private* const d;
00140     };
00141 
00151     class KROSSCORE_EXPORT Interpreter : public ErrorInterface
00152     {
00153         public:
00154 
00161             explicit Interpreter(InterpreterInfo* info);
00162 
00166             virtual ~Interpreter();
00167 
00172             InterpreterInfo* interpreterInfo() const;
00173 
00182             virtual Script* createScript(Action* Action) = 0;
00183 
00185             virtual void virtual_hook(int id, void* data);
00186 
00187         private:
00189             class Private;
00191             Private* const d;
00192     };
00193 
00194 }
00195 
00196 #endif
00197 

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
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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