lib

KoSpell.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 1997 David Sweet <dsweet@kde.org>
00003    Copyright (C) 2004 Zack Rusin <zack@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License version 2 as published by the Free Software Foundation.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef KOSPELL_H
00020 #define KOSPELL_H
00021 
00022 #include <qobject.h>
00023 #include <qstringlist.h>
00024 #include <qstring.h>
00025 
00026 #include <kspell2/backgroundchecker.h>
00027 #include <koffice_export.h>
00028 class KoTextIterator;
00029 class KoTextParag;
00030 class KoTextObject;
00031 class KoTextDocument;
00032 namespace KSpell2
00033 {
00034     class Settings;
00035 }
00036 
00045 class KOTEXT_EXPORT KoSpell : public KSpell2::BackgroundChecker
00046 {
00047     Q_OBJECT
00048 
00049 public:
00050     KoSpell( const KSpell2::Broker::Ptr& broker, QObject *parent =0,
00051              const char *name =0 );
00056     virtual ~KoSpell();
00057 
00061     bool checking() const;
00062 
00070     virtual bool check( KoTextIterator *itr, bool dialog = false );
00071     virtual bool check( KoTextParag *parag );
00072     virtual bool checkWordInParagraph( KoTextParag *parag, int pos,
00073                                        QString& word, int& start );
00074 
00075     KoTextParag  *currentParag() const;
00076     KoTextObject *currentTextObject() const;
00077     int currentStartIndex() const;
00078 
00079     KoTextDocument *textDocument() const;
00080 
00084     KSpell2::Settings *settings() const;
00085 
00086 public slots:
00087     void slotCurrentParagraphDeleted();
00088 
00089 signals:
00093     void paragraphChecked( KoTextParag* );
00094 
00095     void aboutToFeedText();
00096 
00097 protected:
00098     virtual QString getMoreText();
00099     virtual void finishedCurrentFeed();
00100 
00101 private:
00102     class Private;
00103     Private *d;
00104 };
00105 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys