00001
00022 #ifndef TDESPELL_BROKER_H
00023 #define TDESPELL_BROKER_H
00024
00025 #include <ksharedptr.h>
00026
00027 #include <tqobject.h>
00028 #include <tqstringlist.h>
00029 #include <tqstring.h>
00030
00031 class TDESharedConfig;
00032 template <typename T>
00033 class TQPtrDict;
00034
00035 namespace KSpell2
00036 {
00037 class Settings;
00038 class Dictionary;
00039 class DefaultDictionary;
00040
00048 class KDE_EXPORT Broker : public TQObject,
00049 public TDEShared
00050 {
00051 Q_OBJECT
00052 public:
00053 typedef TDESharedPtr<Broker> Ptr;
00068 static Broker *openBroker( TDESharedConfig *config = 0 );
00069
00070 public:
00071 ~Broker();
00072
00080 DefaultDictionary *defaultDictionary() const;
00081
00096 Dictionary *dictionary(
00097 const TQString& language = TQString::null,
00098 const TQString& client = TQString::null ) const;
00099
00103 TQStringList clients() const;
00104
00108 TQStringList 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( TDESharedConfig *config );
00126 void loadPlugins();
00127 void loadPlugin( const TQString& );
00128 private:
00129 class Private;
00130 Private *d;
00131 private:
00132 static TQPtrDict<Broker> *s_brokers;
00133 };
00134 }
00135
00136 #endif