backgroundengine.h

00001 
00021 #ifndef KSPELL_BACKGROUNDENGINE_H
00022 #define KSPELL_BACKGROUNDENGINE_H
00023 
00024 #include "broker.h"
00025 
00026 #include <qobject.h>
00027 #include <qstringlist.h>
00028 
00029 namespace KSpell2
00030 {
00031     class Filter;
00032     class Broker;
00033     class Dictionary;
00034     class BackgroundEngine : public QObject
00035     {
00036         Q_OBJECT
00037     public:
00038         BackgroundEngine( QObject *parent );
00039         ~BackgroundEngine();
00040 
00041         void setBroker( const Broker::Ptr& broker );
00042         Broker *broker() const { return m_broker; }
00043 
00044         void setText( const QString& );
00045         QString text() const;
00046 
00047         void changeLanguage( const QString& );
00048         QString language() const;
00049 
00050         void setFilter( Filter *filter );
00051         Filter *filter() const { return m_filter; }
00052 
00053         void start();
00054         void continueChecking();
00055         void stop();
00056 
00057         bool        checkWord( const QString& word );
00058         QStringList suggest( const QString& word );
00059         bool        addWord( const QString& word );
00060     signals:
00061         void misspelling( const QString&, int );
00062         void done();
00063     protected slots:
00064         void checkNext();
00065     private:
00066         Filter            *m_filter;
00067         Broker::Ptr        m_broker;
00068         Dictionary        *m_dict;
00069         DefaultDictionary *m_defaultDict;
00070     };
00071 }
00072 
00073 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys