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

Kross

  • kross
  • core
core/interpreter.h
Go to the documentation of this file.
1/***************************************************************************
2 * interpreter.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2006 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_INTERPRETER_H
21#define KROSS_INTERPRETER_H
22
23#include "errorinterface.h"
24
25#include <QtCore/QStringList>
26#include <QtCore/QVariant>
27#include <QtCore/QMap>
28#include <QtCore/QObject>
29
30namespace Kross {
31
32 // Forward declaration.
33 class Manager;
34 class Action;
35 class Script;
36 class Interpreter;
37
43 class KROSSCORE_EXPORT InterpreterInfo
44 {
45 public:
46
51 class Option
52 {
53 public:
54
58 typedef QMap< QString, Option* > Map;
59
67 Option(const QString& comment, const QVariant& value)
68 : comment(comment), value(value) {}
69
71 QString comment;
72
74 QVariant value;
75 };
76
102 InterpreterInfo(const QString& interpretername, void* funcPtr, const QString& wildcard, const QStringList& mimetypes, const Option::Map& options = Option::Map());
103
107 ~InterpreterInfo();
108
112 const QString interpreterName() const;
113
120 const QString wildcard() const;
121
126 const QStringList mimeTypes() const;
127
131 bool hasOption(const QString& name) const;
132
136 Option* option(const QString& name) const;
137
141 Option::Map& options();
142
148 const QVariant optionValue(const QString& name, const QVariant& defaultvalue = QVariant()) const;
149
158 Interpreter* interpreter();
159
160 private:
162 class Private;
164 Private* const d;
165 };
166
177 class KROSSCORE_EXPORT Interpreter : public QObject, public ErrorInterface
178 {
179 Q_OBJECT
180 public:
181
188 explicit Interpreter(InterpreterInfo* info);
189
193 virtual ~Interpreter();
194
199 InterpreterInfo* interpreterInfo() const;
200
209 virtual Script* createScript(Action* Action) = 0;
210
211 private:
213 class Private;
215 Private* const d;
216 };
217
218}
219
220#endif
221
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file.
Definition: action.h:99
Kross::ErrorInterface
Interface for error-handling.
Definition: errorinterface.h:33
Kross::InterpreterInfo::Option
Each interpreter is able to define options we could use to manipulate the interpreter behaviour.
Definition: core/interpreter.h:52
Kross::InterpreterInfo::Option::value
QVariant value
The value the option has.
Definition: core/interpreter.h:74
Kross::InterpreterInfo::Option::Option
Option(const QString &comment, const QVariant &value)
Constructor.
Definition: core/interpreter.h:67
Kross::InterpreterInfo::Option::Map
QMap< QString, Option * > Map
Map of options.
Definition: core/interpreter.h:58
Kross::InterpreterInfo::Option::comment
QString comment
A description of the option.
Definition: core/interpreter.h:71
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::Interpreter::createScript
virtual Script * createScript(Action *Action)=0
Create and return a new interpreter dependent Script instance.
Kross::Script
Base class for interpreter dependent functionality each script provides.
Definition: core/script.h:44
QMap
QObject
errorinterface.h
Kross
Definition: action.cpp:36
Action
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.

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