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

Kross

actioncollection.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  * actioncollection.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_ACTIONCOLLECTION_H
00021 #define KROSS_ACTIONCOLLECTION_H
00022 
00023 #include "krossconfig.h"
00024 #include "action.h"
00025 
00026 
00027 #include <QtCore/QObject>
00028 #include <QtCore/QDir>
00029 
00030 class QDomElement;
00031 class QIODevice;
00032 
00033 namespace Kross {
00034 
00046     class KROSSCORE_EXPORT ActionCollection : public QObject
00047     {
00048             Q_OBJECT
00049 
00050         public:
00051 
00062             explicit ActionCollection(const QString& name, ActionCollection* parent = 0);
00063 
00067             virtual ~ActionCollection();
00068 
00072             QString name() const;
00073 
00077             QString text() const;
00078 
00082             void setText(const QString& text);
00083 
00087             QString description() const;
00088 
00092             void setDescription(const QString& description);
00093 
00097             QString iconName() const;
00098 
00102             void setIconName(const QString& iconname);
00103 
00107             QIcon icon() const;
00108 
00112             bool isEnabled() const;
00113 
00117             void setEnabled(bool enabled);
00118 
00124             ActionCollection* parentCollection() const;
00126             void setParentCollection( ActionCollection *parent );
00131             bool hasCollection(const QString& name) const;
00132 
00137             ActionCollection* collection(const QString& name) const;
00138 
00143             QStringList collections() const;
00144 
00145             QList<Action*> actions() const;
00146 
00150             Action* action(const QString& name) const;
00151             void addAction(Action* action);
00152             void addAction(const QString& name, Action* action);
00153             void removeAction(const QString& name);
00154             void removeAction(Action* action);
00155 
00166             bool readXml(const QDomElement& element, const QDir& directory = QDir());
00167             bool readXml(const QDomElement& element, const QStringList& searchPath/* = QStringList()*/);
00168 
00172             bool readXml(QIODevice* device, const QDir& directory = QDir());
00173             bool readXml(QIODevice* device, const QStringList& searchPath/* = QStringList()*/);
00174 
00181             bool readXmlFile(const QString& file);
00182 
00187             QDomElement writeXml();
00188             QDomElement writeXml(const QStringList& searchPath/* = QStringList()*/);
00189 
00190 
00195             bool writeXml(QIODevice* device, int indent = 2);
00196             bool writeXml(QIODevice* device, int indent/* = 2*/, const QStringList& searchPath/* = QStringList()*/);
00197 
00198 
00199         Q_SIGNALS:
00200 
00205             void updated();
00206 
00208             void dataChanged(Action*);
00210             void dataChanged(ActionCollection*);
00211 
00213             void collectionToBeInserted(ActionCollection* child, ActionCollection* parent);
00215             void collectionInserted(ActionCollection* child, ActionCollection* parent);
00217             void collectionToBeRemoved(ActionCollection* child, ActionCollection* parent);
00219             void collectionRemoved(ActionCollection* child, ActionCollection* parent);
00220 
00222             void actionToBeInserted(Action* child, ActionCollection* parent);
00224             void actionInserted(Action* child, ActionCollection* parent);
00226             void actionToBeRemoved(Action* child, ActionCollection* parent);
00228             void actionRemoved(Action* child, ActionCollection* parent);
00229 
00230         protected:
00231             void registerCollection(ActionCollection* collection);
00232             void unregisterCollection(const QString& name);
00233             void connectSignals(ActionCollection* collection, bool conn);
00234             void connectSignals(Action* collection, bool conn);
00235 
00236         private Q_SLOTS:
00237             void emitUpdated();
00238 
00239         private:
00241             class Private;
00243             Private* const d;
00244     };
00245 
00246 }
00247 
00248 #endif
00249 

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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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