1
/* This file is part of the KDE project
2
Copyright (C) 2002 David Faure <david@mandrakesoft.com>
3
2002 Laurent Montel <lmontel@mandrakesoft.com>
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 as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18
Boston, MA 02111-1307, USA.
21
#ifndef kobgspellcheck_h
22
#define kobgspellcheck_h
26
#include <qstringlist.h>
34
class KoBgSpellCheck : public QObject
39
virtual ~KoBgSpellCheck();
40
void enableBackgroundSpellCheck( bool b );
42
bool backgroundSpellCheckEnabled() const { return m_bSpellCheckEnabled; }
44
void setIgnoreUpperWords( bool b);
45
void setIgnoreTitleCase( bool b);
47
void setKSpellConfig(const KOSpellConfig &_kspell);
49
//repaint object when we spell check
50
virtual void slotRepaintChanged(KoTextObject *obj)=0;
52
virtual KoTextObject* nextTextObject( KoTextObject *obj )=0;
54
virtual void configurateSpellChecker()=0;
55
void addIgnoreWordAll( const QString & word);
56
void clearIgnoreWordAll( );
57
void addIgnoreWordAllList( const QStringList & list);
58
void spellCheckParagraphDeleted( KoTextParag *_parag, KoTextObject *obj);
59
void addPersonalDictonary( const QString & word );
61
void startBackgroundSpellCheck();
64
void spellCheckerReady();
65
void spellCheckerMisspelling(const QString &, int );
66
void spellCheckerDone();
67
void spellCheckerFinished( );
68
void spellCheckNextParagraph();
71
KSpellConfig* spellConfig();
72
void nextParagraphNeedingCheck();
73
void stopSpellChecking();
74
// Structure holding the background spellcheck data
76
KoBGSpell() : kspell(0L), currentTextObj(0L), currentParag(0L) {}
78
// KSpell object for the background spellcheck
80
// The text frameset currently being checked
81
// TODO change current text frameset, and implementing nextTextFrameSet, see kwview.cc
82
// TODO implement "skip unchanged framesets" and "stop timer after all checked and until
83
// user types something again"
84
KoTextObject *currentTextObj;
85
// The paragraph currently being checked
86
KoTextParag *currentParag;
87
// Last parag was changed (word marked misspelled), we need to repaint it.
93
class KoBgSpellCheckPrivate;
94
KoBgSpellCheckPrivate *d;
95
QStringList m_spellListIgnoreAll;
96
bool m_bSpellCheckEnabled;
97
bool m_bDontCheckUpperWord;
98
bool m_bDontCheckTitleCase;
99
bool m_bSpellCheckConfigure;