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

Kross

action.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * action.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_ACTION_H
00021 #define KROSS_ACTION_H
00022 
00023 #include <QtCore/QVariant>
00024 #include <QtCore/QObject>
00025 #include <QtCore/QDir>
00026 #include <QtCore/QUrl>
00027 #include <QtGui/QAction>
00028 #include <QtXml/QDomAttr>
00029 #include <QtScript/QScriptable>
00030 
00031 #include "errorinterface.h"
00032 #include "childreninterface.h"
00033 
00034 namespace Kross {
00035 
00036     class Script;
00037 
00094     class KROSSCORE_EXPORT Action
00095         : public QAction
00096         , public QScriptable
00097         , public ChildrenInterface
00098         , public ErrorInterface
00099     {
00100             Q_OBJECT
00101 
00102         public:
00103 
00112             Action(QObject* parent, const QString& name, const QDir& packagepath = QDir());
00113 
00125             Action(QObject* parent, const QUrl& url);
00126 
00130             virtual ~Action();
00131 
00137             void fromDomElement(const QDomElement& element);
00138 
00144             QDomElement toDomElement() const;
00145 
00155             bool initialize();
00156 
00163             void finalize();
00164 
00169             bool isFinalized() const;
00170 
00182             Script* script() const;
00183 
00184         public Q_SLOTS:
00185 
00189             QString name() const;
00190 
00195             int version() const;
00196 
00200             QString description() const;
00201 
00205             void setDescription(const QString& description);
00206 
00210             QString iconName() const;
00211 
00215             void setIconName(const QString& iconname);
00216 
00220             bool isEnabled() const;
00221 
00225             void setEnabled(bool enabled);
00226 
00230             QString file() const;
00231 
00235             bool setFile(const QString& scriptfile);
00236 
00240             QByteArray code() const;
00241 
00245             void setCode(const QByteArray& code);
00246 
00251             QString interpreter() const;
00252 
00256             void setInterpreter(const QString& interpretername);
00257 
00262             QString currentPath() const;
00263 
00268             void addQObject(QObject* obj, const QString &name = QString());
00269 
00273             QObject* qobject(const QString &name) const;
00274 
00278             QStringList qobjectNames() const;
00279 
00285             QVariantMap options() const;
00286 
00292             QVariant option(const QString& name, const QVariant& defaultvalue = QVariant());
00293 
00297             bool setOption(const QString& name, const QVariant& value);
00298 
00302             QStringList functionNames();
00303 
00310             QVariant callFunction(const QString& name, const QVariantList& args = QVariantList());
00311 
00328             QVariant evaluate(const QByteArray& code);
00329 
00330         Q_SIGNALS:
00331 
00338             void updated();
00339 
00341             void dataChanged(Action*);
00342 
00346             void started(Kross::Action*);
00347 
00351             void finished(Kross::Action*);
00352 
00356             void finalized(Kross::Action*);
00357 
00358         private Q_SLOTS:
00359 
00365             void slotTriggered();
00366 
00367         private:
00369             class Private;
00371             Private* const d;
00372     };
00373 
00374 }
00375 
00376 Q_DECLARE_METATYPE(Kross::Action*)
00377 
00378 #endif
00379 

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