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

Kross

  • kross
  • core
action.h
Go to the documentation of this file.
1/***************************************************************************
2 * action.h
3 * This file is part of the KDE project
4 * copyright (C)2004-2007 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_ACTION_H
21#define KROSS_ACTION_H
22
23#include <QtCore/QVariant>
24#include <QtCore/QObject>
25#include <QtCore/QDir>
26#include <QtCore/QUrl>
27#include <QtGui/QAction>
28#include <QtXml/QDomAttr>
29#include <QtScript/QScriptable>
30
31#include "errorinterface.h"
32#include "childreninterface.h"
33
34namespace Kross {
35
36 class Script;
37
94 class KROSSCORE_EXPORT Action
95 : public QAction
96 , public QScriptable
97 , public ChildrenInterface
98 , public ErrorInterface
99 {
100 Q_OBJECT
101
102 public:
103
113 Action(QObject* parent, const QString& name, const QDir& packagepath = QDir()); //BIC may be removed in favour of the next c'tor
114
126 Action(QObject* parent, const QUrl& url);
127
131 virtual ~Action();
132
139 void fromDomElement(const QDomElement& element);
140
149 void fromDomElement(const QDomElement& element, const QStringList& searchPath/* = QStringList()*/);
150
156 QDomElement toDomElement() const;
157
165 QDomElement toDomElement(const QStringList& searchPath/* = QStringList()*/) const;
166
176 bool initialize();
177
184 void finalize();
185
190 bool isFinalized() const;
191
203 Script* script() const;
204
205 public Q_SLOTS:
206
210 QString name() const;
211
216 int version() const;
217
221 QString description() const;
222
226 void setDescription(const QString& description);
227
231 QString iconName() const;
232
236 void setIconName(const QString& iconname);
237
241 bool isEnabled() const;
242
246 void setEnabled(bool enabled);
247
251 QString file() const;
252
256 bool setFile(const QString& scriptfile);
257
261 QByteArray code() const;
262
266 void setCode(const QByteArray& code);
267
272 QString interpreter() const;
273
277 void setInterpreter(const QString& interpretername);
278
283 QString currentPath() const;
284
289 void addQObject(QObject* obj, const QString &name = QString());
290
294 QObject* qobject(const QString &name) const;
295
299 QStringList qobjectNames() const;
300
306 QVariantMap options() const;
307
313 QVariant option(const QString& name, const QVariant& defaultvalue = QVariant());
314
318 bool setOption(const QString& name, const QVariant& value);
319
323 QStringList functionNames();
324
331 QVariant callFunction(const QString& name, const QVariantList& args = QVariantList());
332
349 QVariant evaluate(const QByteArray& code);
350
351 Q_SIGNALS:
352
359 void updated();
360
362 void dataChanged(Action*);
363
367 void started(Kross::Action*);
368
372 void finished(Kross::Action*);
373
377 void finalized(Kross::Action*);
378
379 private Q_SLOTS:
380
386 void slotTriggered();
387
388 private:
390 class Private;
392 Private* const d;
393 };
394
395}
396
397Q_DECLARE_METATYPE(Kross::Action*)
398
399#endif
400
childreninterface.h
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file.
Definition: action.h:99
Kross::Action::name
QString name() const
Kross::Action::started
void started(Kross::Action *)
This signal is emitted before the script got executed.
Kross::Action::finished
void finished(Kross::Action *)
This signal is emitted after the script got executed.
Kross::Action::finalized
void finalized(Kross::Action *)
This signal is emitted once a script finalized.
Kross::Action::dataChanged
void dataChanged(Action *)
This signal is emitted when the data of the Action is changed.
Kross::Action::updated
void updated()
This signal is emitted if the content of the Action was changed.
Kross::ChildrenInterface
Interface for managing Object collections.
Definition: childreninterface.h:39
Kross::ErrorInterface
Interface for error-handling.
Definition: errorinterface.h:33
Kross::Script
Base class for interpreter dependent functionality each script provides.
Definition: core/script.h:44
QAction
QObject
QScriptable
QUrl
errorinterface.h
name
const char * name(StandardAction id)
Kross
Definition: action.cpp:36
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