F:/KPlato/koffice/libs/kross/core/action.h

Aller à la documentation de ce fichier.
00001 /***************************************************************************
00002  * action.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_ACTION_H
00021 #define KROSS_ACTION_H
00022 
00023 #include <QString>
00024 #include <QVariant>
00025 #include <QObject>
00026 //#include <qdom.h>
00027 
00028 #include <kaction.h>
00029 #include <kurl.h>
00030 #include <koffice_export.h>
00031 
00032 #include "errorinterface.h"
00033 #include "childreninterface.h"
00034 
00035 class QDir;
00036 class QDomElement;
00037 
00038 namespace Kross {
00039 
00052     class KROSSCORE_EXPORT Action : public KAction, public ChildrenInterface, public ErrorInterface
00053     {
00054             Q_OBJECT
00055 
00056         public:
00057 
00067             Action(KActionCollection* collection, const QString& name);
00068 
00078             Action(const QString& file);
00079 
00091             Action(KActionCollection* collection, const QDomElement& element, const QDir& packagepath);
00092 
00096             virtual ~Action();
00097 
00101             QString file() const;
00102 
00106             bool setFile(const QString& scriptfile);
00107 
00113             QMap<QString, QVariant>& options() const;
00114 
00120             QVariant option(const QString name, QVariant defaultvalue = QVariant());
00121 
00125             bool setOption(const QString name, const QVariant& value);
00126 
00130             QStringList functionNames();
00131 
00138             QVariant callFunction(const QString& name, const QVariantList& args = QVariantList());
00139 
00149             bool initialize();
00150 
00157             void finalize();
00158 
00159         public slots:
00160 
00164             QString description() const;
00165 
00169             void setDescription(const QString& description);
00170 
00174             QString code() const;
00175 
00179             void setCode(const QString& code);
00180 
00185             QString interpreter() const;
00186 
00190             void setInterpreter(const QString& interpretername);
00191 
00196             QString currentPath() const;
00197 
00198         signals:
00199 
00203             void started(Kross::Action*);
00204 
00208             void finished(Kross::Action*);
00209 
00210         private slots:
00211 
00217             void slotTriggered();
00218 
00219         private:
00221             class Private;
00223             Private* const d;
00224     };
00225 
00226 }
00227 
00228 #endif
00229 

Généré le Wed Nov 22 23:41:11 2006 pour KPlato par  doxygen 1.5.1-p1