lib

KoSpell.h
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 David Sweet <dsweet@kde.org>
3 Copyright (C) 2004 Zack Rusin <zack@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19#ifndef KOSPELL_H
20#define KOSPELL_H
21
22#include <tqobject.h>
23#include <tqstringlist.h>
24#include <tqstring.h>
25
26#include <tdespell2/backgroundchecker.h>
27#include <koffice_export.h>
28class KoTextIterator;
29class KoTextParag;
30class KoTextObject;
31class KoTextDocument;
32namespace KSpell2
33{
34 class Settings;
35}
36
45class KOTEXT_EXPORT KoSpell : public KSpell2::BackgroundChecker
46{
47 TQ_OBJECT
48
49
50public:
51 KoSpell( const KSpell2::Broker::Ptr& broker, TQObject *parent =0,
52 const char *name =0 );
57 virtual ~KoSpell();
58
62 bool checking() const;
63
71 virtual bool check( KoTextIterator *itr, bool dialog = false );
72 virtual bool check( KoTextParag *parag );
73 virtual bool checkWordInParagraph( KoTextParag *parag, int pos,
74 TQString& word, int& start );
75
76 KoTextParag *currentParag() const;
77 KoTextObject *currentTextObject() const;
78 int currentStartIndex() const;
79
80 KoTextDocument *textDocument() const;
81
85 KSpell2::Settings *settings() const;
86
87public slots:
88 void slotCurrentParagraphDeleted();
89
90signals:
94 void paragraphChecked( KoTextParag* );
95
96 void aboutToFeedText();
97
98protected:
99 virtual TQString getMoreText();
100 virtual void finishedCurrentFeed();
101
102private:
103 class Private;
104 Private *d;
105};
106#endif
bool checking() const
Returns whether the speller is already checking something.
Definition KoSpell.cpp:218
void paragraphChecked(KoTextParag *)
Emitted after a paragraph has been checked.
virtual bool check(KoTextIterator *itr, bool dialog=false)
Spellchecks a buffer of many words in plain text format.
Definition KoSpell.cpp:69
KSpell2::Settings * settings() const
Returns the Settings object used by the broker.
Definition KoSpell.cpp:241
virtual bool checkWordInParagraph(KoTextParag *parag, int pos, TQString &word, int &start)
Definition KoSpell.cpp:99
A convenient way to iterate over paragraphs, possibly in multiple textobjects, with many options (fro...
The KoTextObject is the high-level object that contains a KoTextDocument (the list of paragraphs),...