00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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