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 #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 00050 class KUTILS_EXPORT Dispatcher : public QObject 00051 { 00052 friend class KStaticDeleter<Dispatcher>; 00053 00054 Q_OBJECT 00055 public: 00059 static Dispatcher * self(); 00060 00073 void registerInstance( KInstance * instance, QObject * recv, const char * slot ); 00074 00078 KConfig * configForInstanceName( const QCString & instanceName ); 00079 00084 QStrList instanceNames() const; 00085 00086 //X /** 00087 //X * @return The KInstance object belonging to the instance name you pass 00088 //X * (only works for registered instances of course). 00089 //X */ 00090 //X KInstance * instanceForName( const QCString & instanceName ); 00091 00092 public slots: 00099 void reparseConfiguration( const QCString & instanceName ); 00100 00107 void syncConfiguration(); 00108 00109 private slots: 00110 void unregisterInstance( QObject * ); 00111 00112 private: 00113 Dispatcher( QObject * parent = 0, const char * name = 0 ); 00114 ~Dispatcher(); 00115 static Dispatcher * m_self; 00116 00117 struct InstanceInfo { 00118 KInstance * instance; 00119 QSignal * signal; 00120 int count; 00121 }; 00122 QMap<QCString, InstanceInfo> m_instanceInfo; 00123 QMap<QObject *, QCString> m_instanceName; 00124 00125 class DispatcherPrivate; 00126 DispatcherPrivate * d; 00127 }; 00128 00129 } 00130 00131 // vim: sw=4 sts=4 et 00132 #endif // KSETTINGS_DISPATCHER_H
KDE Logo
This file is part of the documentation for kutils Library Version 3.4.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 14 00:32:59 2005 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003