F:/KPlato/koffice/libs/kross/core/childreninterface.h

Aller à la documentation de ce fichier.
00001 /***************************************************************************
00002  * childreninterface.h
00003  * This file is part of the KDE project
00004  * copyright (C)2004-2006 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_CHILDRENINTERFACE_H
00021 #define KROSS_CHILDRENINTERFACE_H
00022 
00023 #include <QString>
00024 #include <QHash>
00025 #include <QObject>
00026 #include <koffice_export.h>
00027 
00028 #include "krossconfig.h"
00029 
00030 namespace Kross {
00031 
00035     class KROSSCORE_EXPORT ChildrenInterface
00036     {
00037         public:
00038 
00039             inline void addObject(QObject* object, const QString& name = QString::null) {
00040                 m_objects.insert(name.isNull() ? object->objectName() : name, object);
00041             }
00042 
00043             inline bool hasObject(const QString& name) const {
00044                 return m_objects.contains(name);
00045             }
00046 
00047             inline QObject* object(const QString& name) const {
00048                 return m_objects.value(name);
00049             }
00050 
00051             inline QHash< QString, QObject* > objects() const {
00052                 return m_objects;
00053             }
00054 
00055         private:
00056             QHash< QString, QObject* > m_objects;
00057     };
00058 
00059 }
00060 
00061 #endif
00062 

Généré le Wed Nov 22 23:41:11 2006 pour KPlato par  doxygen 1.5.1-p1