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

Kross

  • sources
  • kde-4.12
  • kdelibs
  • 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 
29 class QDomElement;
30 class QIODevice;
31 
32 namespace 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 
name
const char * name(StandardAction id)
QString
QObject
indent
QString indent(QString text, int spaces)
action.h
QStringList
krossconfig.h
Kross::Action
The Action class is an abstract container to deal with scripts like a single standalone script file...
Definition: action.h:94
Kross::ActionCollection
The ActionCollection class manages collections of Action instances.
Definition: actioncollection.h:45
QIODevice
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:54 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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