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

Kross

  • kross
  • core
actioncollection.h
Go to the documentation of this file.
1/***************************************************************************
2 * actioncollection.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_ACTIONCOLLECTION_H
21#define KROSS_ACTIONCOLLECTION_H
22
23#include "krossconfig.h"
24#include "action.h"
25
26#include <QtCore/QObject>
27#include <QtCore/QDir>
28
29class QDomElement;
30class QIODevice;
31
32namespace Kross {
33
45 class KROSSCORE_EXPORT ActionCollection : public QObject
46 {
47 Q_OBJECT
48
49 public:
50
61 explicit ActionCollection(const QString& name, ActionCollection* parent = 0);
62
66 virtual ~ActionCollection();
67
71 QString name() const;
72
76 QString text() const;
77
81 void setText(const QString& text);
82
86 QString description() const;
87
91 void setDescription(const QString& description);
92
96 QString iconName() const;
97
101 void setIconName(const QString& iconname);
102
106 QIcon icon() const;
107
111 bool isEnabled() const;
112
116 void setEnabled(bool enabled);
117
123 ActionCollection* parentCollection() const;
125 void setParentCollection( ActionCollection *parent );
130 bool hasCollection(const QString& name) const;
131
136 ActionCollection* collection(const QString& name) const;
137
142 QStringList collections() const;
143
144 QList<Action*> actions() const;
145
149 Action* action(const QString& name) const;
150 void addAction(Action* action);
151 void addAction(const QString& name, Action* action);
152 void removeAction(const QString& name);
153 void removeAction(Action* action);
154
165 bool readXml(const QDomElement& element, const QDir& directory = QDir());
166 bool readXml(const QDomElement& element, const QStringList& searchPath/* = QStringList()*/);
167
171 bool readXml(QIODevice* device, const QDir& directory = QDir());
172 bool readXml(QIODevice* device, const QStringList& searchPath/* = QStringList()*/);
173
180 bool readXmlFile(const QString& file);
181
186 QDomElement writeXml();
187 QDomElement writeXml(const QStringList& searchPath/* = QStringList()*/);
188
189
194 bool writeXml(QIODevice* device, int indent = 2);
195 bool writeXml(QIODevice* device, int indent/* = 2*/, const QStringList& searchPath/* = QStringList()*/);
196
197
198 Q_SIGNALS:
199
204 void updated();
205
207 void dataChanged(Action*);
209 void dataChanged(ActionCollection*);
210
212 void collectionToBeInserted(ActionCollection* child, ActionCollection* parent);
214 void collectionInserted(ActionCollection* child, ActionCollection* parent);
216 void collectionToBeRemoved(ActionCollection* child, ActionCollection* parent);
218 void collectionRemoved(ActionCollection* child, ActionCollection* parent);
219
221 void actionToBeInserted(Action* child, ActionCollection* parent);
223 void actionInserted(Action* child, ActionCollection* parent);
225 void actionToBeRemoved(Action* child, ActionCollection* parent);
227 void actionRemoved(Action* child, ActionCollection* parent);
228
229 protected:
230 void registerCollection(ActionCollection* collection);
231 void unregisterCollection(const QString& name);
232 void connectSignals(ActionCollection* collection, bool conn);
233 void connectSignals(Action* collection, bool conn);
234
235 private Q_SLOTS:
236 void emitUpdated();
237
238 private:
240 class Private;
242 Private* const d;
243 };
244
245}
246
247#endif
248
action.h
Kross::ActionCollection
The ActionCollection class manages collections of Action instances.
Definition: actioncollection.h:46
Kross::ActionCollection::collectionToBeRemoved
void collectionToBeRemoved(ActionCollection *child, ActionCollection *parent)
This signal is emitted before child is removed from parent.
Kross::ActionCollection::collectionInserted
void collectionInserted(ActionCollection *child, ActionCollection *parent)
This signal is emitted after child has been added to parent.
Kross::ActionCollection::dataChanged
void dataChanged(Action *)
This signal is emitted when the data of a child action is changed.
Kross::ActionCollection::actionInserted
void actionInserted(Action *child, ActionCollection *parent)
This signal is emitted after child has been added to parent.
Kross::ActionCollection::actionToBeRemoved
void actionToBeRemoved(Action *child, ActionCollection *parent)
This signal is emitted before child is removed from parent.
Kross::ActionCollection::actionRemoved
void actionRemoved(Action *child, ActionCollection *parent)
This signal is emitted after child has been removed from parent.
Kross::ActionCollection::collectionToBeInserted
void collectionToBeInserted(ActionCollection *child, ActionCollection *parent)
This signal is emitted just before child is added to parent.
Kross::ActionCollection::actionToBeInserted
void actionToBeInserted(Action *child, ActionCollection *parent)
This signal is emitted just before child is added to parent.
Kross::ActionCollection::collectionRemoved
void collectionRemoved(ActionCollection *child, ActionCollection *parent)
This signal is emitted after child has been removed from parent.
Kross::ActionCollection::dataChanged
void dataChanged(ActionCollection *)
This signal is emitted when the data of the ActionCollection is changed.
Kross::ActionCollection::updated
void updated()
This signal is emitted if the content of the ActionCollection was changed.
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file.
Definition: action.h:99
QIODevice
QList
QObject
indent
QString indent(QString text, int spaces)
krossconfig.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