diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /lib/kotext/KoSpell.h | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext/KoSpell.h')
-rw-r--r-- | lib/kotext/KoSpell.h | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/lib/kotext/KoSpell.h b/lib/kotext/KoSpell.h new file mode 100644 index 00000000..b359b1aa --- /dev/null +++ b/lib/kotext/KoSpell.h @@ -0,0 +1,105 @@ +/* This file is part of the KDE libraries + Copyright (C) 1997 David Sweet <[email protected]> + Copyright (C) 2004 Zack Rusin <[email protected]> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ +#ifndef KOSPELL_H +#define KOSPELL_H + +#include <qobject.h> +#include <qstringlist.h> +#include <qstring.h> + +#include <kspell2/backgroundchecker.h> +#include <koffice_export.h> +class KoTextIterator; +class KoTextParag; +class KoTextObject; +class KoTextDocument; +namespace KSpell2 +{ + class Settings; +} + +/** + * KOffice spell checking object + * Used for both spell-checking-with-a-dialog (directly) + * and background spell-checking (via KoBgSpellCheck). + * + * @author Zack Rusin <[email protected]>, David Sweet <[email protected]> + * @see KSpell2::Broker + */ +class KOTEXT_EXPORT KoSpell : public KSpell2::BackgroundChecker +{ + Q_OBJECT + +public: + KoSpell( const KSpell2::Broker::Ptr& broker, QObject *parent =0, + const char *name =0 ); + /** + * The destructor instructs ISpell/ASpell to write out the personal + * dictionary and then terminates ISpell/ASpell. + */ + virtual ~KoSpell(); + + /** + * Returns whether the speller is already checking something. + */ + bool checking() const; + + /** + * Spellchecks a buffer of many words in plain text + * format. + * + * The buffer is not modified. The signal done() will be + * sent when @ref check() is finished. + */ + virtual bool check( KoTextIterator *itr, bool dialog = false ); + virtual bool check( KoTextParag *parag ); + virtual bool checkWordInParagraph( KoTextParag *parag, int pos, + QString& word, int& start ); + + KoTextParag *currentParag() const; + KoTextObject *currentTextObject() const; + int currentStartIndex() const; + + KoTextDocument *textDocument() const; + + /** + * Returns the Settings object used by the broker. + */ + KSpell2::Settings *settings() const; + +public slots: + void slotCurrentParagraphDeleted(); + +signals: + /** + * Emitted after a paragraph has been checked. + */ + void paragraphChecked( KoTextParag* ); + + void aboutToFeedText(); + +protected: + virtual QString getMoreText(); + virtual void finishedCurrentFeed(); + +private: + class Private; + Private *d; +}; +#endif |