kutils Library API Documentation

dispatcher.h

00001 /* This file is part of the KDE project 00002 Copyright (C) 2003 Matthias Kretz <kretz@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 00018 */ 00019 00020 #ifndef KSETTINGS_DISPATCHER_H 00021 #define KSETTINGS_DISPATCHER_H 00022 00023 #include <qobject.h> 00024 #include <qmap.h> 00025 00026 class QCString; 00027 class QSignal; 00028 class QStrList; 00029 template<class T> class KStaticDeleter; 00030 class KInstance; 00031 class KConfig; 00032 00033 namespace KSettings 00034 { 00035 00049 class Dispatcher : public QObject 00050 { 00051 friend class KStaticDeleter<Dispatcher>; 00052 00053 Q_OBJECT 00054 public: 00058 static Dispatcher * self(); 00059 00072 void registerInstance( KInstance * instance, QObject * recv, const char * slot ); 00073 00077 KConfig * configForInstanceName( const QCString & instanceName ); 00078 00083 QStrList instanceNames() const; 00084 00085 //X /** 00086 //X * @return The KInstance object belonging to the instance name you pass 00087 //X * (only works for registered instances of course). 00088 //X */ 00089 //X KInstance * instanceForName( const QCString & instanceName ); 00090 00091 public slots: 00098 void reparseConfiguration( const QCString & instanceName ); 00099 00106 void syncConfiguration(); 00107 00108 private slots: 00109 void unregisterInstance( QObject * ); 00110 00111 private: 00112 Dispatcher( QObject * parent = 0, const char * name = 0 ); 00113 ~Dispatcher(); 00114 static Dispatcher * m_self; 00115 00116 struct InstanceInfo { 00117 KInstance * instance; 00118 QSignal * signal; 00119 int count; 00120 }; 00121 QMap<QCString, InstanceInfo> m_instanceInfo; 00122 QMap<QObject *, QCString> m_instanceName; 00123 00124 class DispatcherPrivate; 00125 DispatcherPrivate * d; 00126 }; 00127 00128 } 00129 00130 // vim: sw=4 sts=4 et 00131 #endif // KSETTINGS_DISPATCHER_H
KDE Logo
This file is part of the documentation for kutils Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 20 09:49:42 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003