broker.h

00001 // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
00022 #ifndef KSPELL_BROKER_H
00023 #define KSPELL_BROKER_H
00024 
00025 #include <ksharedptr.h>
00026 
00027 #include <qobject.h>
00028 #include <qstringlist.h>
00029 #include <qstring.h>
00030 
00031 class KSharedConfig;
00032 template <typename T>
00033 class QPtrDict;
00034 
00035 namespace KSpell2
00036 {
00037     class Settings;
00038     class Dictionary;
00039     class DefaultDictionary;
00040 
00048     class KDE_EXPORT Broker : public QObject,
00049                    public KShared
00050     {
00051         Q_OBJECT
00052     public:
00053         typedef KSharedPtr<Broker> Ptr;
00068         static Broker *openBroker( KSharedConfig *config = 0 );
00069 
00070     public:
00071         ~Broker();
00072 
00080         DefaultDictionary *defaultDictionary() const;
00081 
00096         Dictionary *dictionary(
00097             const QString& language = QString::null,
00098             const QString& client = QString::null ) const;
00099 
00103         QStringList clients() const;
00104 
00108         QStringList languages() const;
00109 
00113         Settings *settings() const;
00114     signals:
00119         void configurationChanged();
00120 
00121     protected:
00122         friend class Settings;
00123         void changed();
00124     private:
00125         Broker( KSharedConfig *config );
00126         void loadPlugins();
00127         void loadPlugin( const QString& );
00128     private:
00129         class Private;
00130         Private *d;
00131     private:
00132         static QPtrDict<Broker> *s_brokers;
00133     };
00134 }
00135 
00136 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys