• Skip to content
  • Skip to link menu
KDE 4.1 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 
00039     class KROSSCORE_EXPORT ActionCollection : public QObject
00040     {
00041             Q_OBJECT
00042 
00043         public:
00044 
00055             explicit ActionCollection(const QString& name, ActionCollection* parent = 0);
00056 
00060             virtual ~ActionCollection();
00061 
00065             QString name() const;
00066 
00070             QString text() const;
00071 
00075             void setText(const QString& text);
00076 
00080             QString description() const;
00081 
00085             void setDescription(const QString& description);
00086 
00090             QString iconName() const;
00091 
00095             void setIconName(const QString& iconname);
00096 
00100             QIcon icon() const;
00101 
00105             bool isEnabled() const;
00106 
00110             void setEnabled(bool enabled);
00111 
00117             ActionCollection* parentCollection() const;
00118 
00123             bool hasCollection(const QString& name) const;
00124 
00129             ActionCollection* collection(const QString& name) const;
00130 
00135             QStringList collections() const;
00136 
00137             QList<Action*> actions() const;
00138 
00142             Action* action(const QString& name) const;
00143             void addAction(Action* action);
00144             void addAction(const QString& name, Action* action);
00145             void removeAction(const QString& name);
00146             void removeAction(Action* action);
00147 
00158             bool readXml(const QDomElement& element, const QDir& directory = QDir());
00159 
00163             bool readXml(QIODevice* device, const QDir& directory = QDir());
00164 
00171             bool readXmlFile(const QString& file);
00172 
00177             QDomElement writeXml();
00178 
00183             bool writeXml(QIODevice* device, int indent = 2);
00184 
00185         Q_SIGNALS:
00186 
00191             void updated();
00192 
00193             //void inserted(ActionCollection* self, ActionCollection* into);
00194             //void updated(ActionCollection* self);
00195             //void removed(ActionCollection* self, ActionCollection* from);
00196 
00197         protected:
00198             void registerCollection(ActionCollection* collection);
00199             void unregisterCollection(const QString& name);
00200 
00201         private:
00203             class Private;
00205             Private* const d;
00206     };
00207 
00208 }
00209 
00210 #endif
00211 

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
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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