KUtils
dispatcher.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KSETTINGS_DISPATCHER_H
00021 #define KSETTINGS_DISPATCHER_H
00022
00023 #include <qobject.h>
00024 #include <qmap.h>
00025 #include <kdelibs_export.h>
00026
00027 class QCString;
00028 class QSignal;
00029 class QStrList;
00030 template<class T> class KStaticDeleter;
00031 class KInstance;
00032 class KConfig;
00033
00034 namespace KSettings
00035 {
00036
00051 class KUTILS_EXPORT Dispatcher : public QObject
00052 {
00053 friend class KStaticDeleter<Dispatcher>;
00054
00055 Q_OBJECT
00056 public:
00060 static Dispatcher * self();
00061
00074 void registerInstance( KInstance * instance, QObject * recv, const char * slot );
00075
00079 KConfig * configForInstanceName( const QCString & instanceName );
00080
00085 QStrList instanceNames() const;
00086
00087
00088
00089
00090
00091
00092
00093 public slots:
00100 void reparseConfiguration( const QCString & instanceName );
00101
00108 void syncConfiguration();
00109
00110 private slots:
00111 void unregisterInstance( QObject * );
00112
00113 private:
00114 Dispatcher( QObject * parent = 0, const char * name = 0 );
00115 ~Dispatcher();
00116 static Dispatcher * m_self;
00117
00118 struct InstanceInfo {
00119 KInstance * instance;
00120 QSignal * signal;
00121 int count;
00122 };
00123 QMap<QCString, InstanceInfo> m_instanceInfo;
00124 QMap<QObject *, QCString> m_instanceName;
00125
00126 class DispatcherPrivate;
00127 DispatcherPrivate * d;
00128 };
00129
00130 }
00131
00132
00133 #endif // KSETTINGS_DISPATCHER_H