scriptmanager.h
/* This file is part of the KDE project
Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __scriptmanager_h__
#define __scriptmanager_h__
#include <qvariant.h>
#include <scriptclientinterface.h>
#include <scriptinterface.h>
#include <qdict.h>
#include <qobject.h>
#include <kdelibs_export.h>
class ScriptInfo;
//namespace KScriptInterface
//{
class KDE_EXPORT KScriptManager : public QObject, public KScriptClientInterface
{
Q_OBJECT
friend class KScriptInterface;
public:
KScriptManager(QObject *parent, const char *name);
virtual ~KScriptManager();
bool addScript( const QString &scriptDesktopFile);
bool removeScript( const QString &scriptName );
QStringList scripts();
void clear();
void error( const QString &msg ) {emit scriptError(msg);}
void warning( const QString &msg ) {emit scriptWarning(msg);}
void output( const QString &msg ) {emit scriptOutput(msg);}
void progress( int percent ) {emit scriptProgress(percent);}
void done( KScriptClientInterface::Result result, const QVariant &returned ) {emit scriptDone(result, returned);}
public slots:
void runScript( const QString &scriptName, QObject *context = 0, const QVariant &arg = 0 );
signals:
void scriptError( const QString &msg );
void scriptWarning( const QString &msg );
void scriptOutput( const QString &msg );
void scriptProgress( int percent);
void scriptDone( KScriptClientInterface::Result result, const QVariant &returned);
protected:
QDict<ScriptInfo> m_scripts;
QDict<KScriptInterface> m_scriptCache;
//QStringList m_scriptNames;
QString m_currentScript;
};
//};
#endif
KScriptManager::error
void error(const QString &msg)
This function will allow the main application of any errors that have occurred during processing of t...
Definition: scriptmanager.h:76
KScriptManager
This class is the base for all script engines.
Definition: scriptmanager.h:39
KScriptManager::done
void done(KScriptClientInterface::Result result, const QVariant &returned)
This function will allow feedback on completion of the script.
Definition: scriptmanager.h:99
KScriptClientInterface
This class is used for allowing feedback to the main system.
Definition: scriptclientinterface.h:73
KScriptManager::progress
void progress(int percent)
This function will allow feedback to any progress bars in the main application as to how far along th...
Definition: scriptmanager.h:93
KScriptManager::warning
void warning(const QString &msg)
This function will allow the main application of any warnings that have occurred during the processin...
Definition: scriptmanager.h:81
KScriptManager::output
void output(const QString &msg)
This function will allow the main application of any normal output that has occurred during the proce...
Definition: scriptmanager.h:86
KScriptInterface
This class is the base for all script engines.
Definition: scriptinterface.h:47

KDE Home | KDE Accessibility Home | Description of Access Keys