• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • kde3support
  • kdeui
k3spell.h
Go to the documentation of this file.
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 David Sweet <dsweet@kde.org>
3 Copyright (C) 2003 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 K3SPELL_H
20#define K3SPELL_H
21
22#include <kde3support_export.h>
23
24#include <QtCore/QObject>
25#include <QtCore/QStringList>
26#include <QtCore/QString>
27
28class QTextCodec;
29class KProcess;
30class K3SpellConfig;
31class K3SpellDlg;
32
46class KDE3SUPPORT_EXPORT_DEPRECATED K3Spell : public QObject
47{
48 Q_OBJECT
49
50public:
51
65 enum spellStatus { Starting = 0, Running, Cleaning, Finished, Error, Crashed, FinishedNoMisspellingsEncountered };
66
80 enum SpellerType { Text = 0, HTML, TeX, Nroff };
81
99 K3Spell(QWidget *parent, const QString &caption,
100 QObject *receiver, const char *slot, K3SpellConfig *kcs=0,
101 bool progressbar = true, bool modal = false);
102
121 K3Spell(QWidget *parent, const QString &caption,
122 QObject *receiver, const char *slot, K3SpellConfig *kcs,
123 bool progressbar, bool modal, SpellerType type);
124
130 spellStatus status() const;
131
139 virtual void cleanUp ();
140
145 void setAutoDelete(bool _autoDelete);
146
159
160 virtual bool check (const QString &_buffer, bool usedialog = true);
161
167 int lastPosition() const;
168
179 virtual bool checkList (QStringList *_wordlist, bool usedialog = true);
180
203 virtual bool checkWord (const QString &_buffer, bool usedialog = false);
204 bool checkWord( const QString & buffer, bool _usedialog, bool suggest );
205
211 void hide ();
212
221 QStringList suggestions () const;
222
239 int dlgResult () const;
240
249 void moveDlg (int x, int y);
250
254 int heightDlg () const;
258 int widthDlg () const;
259
265 QString intermediateBuffer () const;
266
273 virtual bool ignore (const QString & word);
274
281 virtual bool addPersonal (const QString & word);
282
286 K3SpellConfig ksConfig () const;
287
295 void setProgressResolution (unsigned int res);
296
301 virtual ~K3Spell();
302
311 static KDE_DEPRECATED int modalCheck( QString& text );
312
321 static int modalCheck( QString& text, K3SpellConfig * kcs );
322
327 void setIgnoreUpperWords(bool b);
328
334 void setIgnoreTitleCase(bool b);
335
336Q_SIGNALS:
337
355 void misspelling (const QString & originalword, const QStringList & suggestions,
356 unsigned int pos);
357
373 void corrected (const QString & originalword, const QString & newword, unsigned int pos);
374
381 void ignoreall (const QString & originalword);
382
388 void ignoreword (const QString & originalword);
389
396 void addword (const QString & originalword);
397
401 void replaceall( const QString & origword , const QString &replacement );
402
407 void ready(K3Spell *);
408
413 void progress (unsigned int i);
414
423 void done (const QString &buffer);
424
432 void done(bool);
433
444 void death( );
445
446
447protected Q_SLOTS:
448 /* All of those signals from KProcess get sent here. */
449 void K3Spell2 ();
450 void checkWord2 ();
451 void checkWord3 ();
452 void check2 ();
453 void checkList2 ();
454 void checkList3a ();
455 void checkListReplaceCurrent ();
456 void checkList4 ();
457 void dialog2 (int dlgresult);
458 void check3 ();
459 void suggestWord();
460
461 void slotStopCancel (int);
462 void ispellExit ();
463 void emitDeath();
464 void ispellErrors ();
465 void checkNext();
466
467private Q_SLOTS:
471 void slotModalReady();
472
476 void slotModalDone( const QString & );
477
481 void slotSpellCheckerCorrected( const QString & oldText, const QString & newText, unsigned int );
482
486 void slotModalSpellCheckerFinished( );
487
488Q_SIGNALS:
489 void dialog3 ();
490
491protected:
492
493 KProcess *proc;
494 QWidget *parent;
495 K3SpellConfig *ksconfig;
496 K3SpellDlg *ksdlg;
497 QStringList *wordlist;
498 QStringList::Iterator wlIt;
499 QStringList ignorelist;
500 QStringList replacelist;
501 QStringList sugg;
502
503 spellStatus m_status;
504
505 bool usedialog;
506 bool texmode;
507 bool dlgon;
508 bool personaldict;
509 bool dialogwillprocess;
510 bool progressbar;
511 bool dialogsetup;
512 bool autoDelete;
513
514 QString caption;
515 QString orig;
516 QString origbuffer;
517 QString newbuffer;
518 QString cwword;
519 QString dlgorigword;
520 QString dlgreplacement;
521 QString dialog3slot;
522
523 int dlgresult;
524 int trystart;
525 int maxtrystart;
526 int lastpos;
527 unsigned int totalpos;
528 int lastline;
529 unsigned int posinline;
530 unsigned int lastlastline;
531 unsigned int offset;
532 unsigned int progres;
533 unsigned int curprog;
534
538 bool modaldlg;
539 static QString modaltext;
540 static int modalreturn;
541 static QWidget* modalWidgetHack;
542
543 int parseOneResponse (const QString &_buffer, QString &word, QStringList &sugg);
544 QString funnyWord (const QString & word);
545 void dialog (const QString & word, QStringList & sugg, const char* _slot);
546 QString replacement () const;
547
548 void setUpDialog ( bool reallyusedialogbox = true);
549
550 void emitProgress ();
551 bool cleanFputs (const QString & s );
552 bool cleanFputsWord (const QString & s );
553 void startIspell();
554 bool writePersonalDictionary();
555 void initialize( QWidget *_parent, const QString &_caption,
556 QObject *obj, const char *slot, K3SpellConfig *_ksc,
557 bool _progressbar, bool _modal, SpellerType type );
558
559private:
560 class K3SpellPrivate;
561 K3SpellPrivate *d;
562};
563
564#endif
K3SpellConfig
A configuration class/dialog for K3Spell.
Definition k3sconfig.h:89
K3SpellDlg
Definition k3spelldlg.h:51
K3Spell
KDE Spellchecker
Definition k3spell.h:47
K3Spell::texmode
bool texmode
Definition k3spell.h:506
K3Spell::progressbar
bool progressbar
Definition k3spell.h:510
K3Spell::totalpos
unsigned int totalpos
Definition k3spell.h:527
K3Spell::checkWord3
void checkWord3()
Definition k3spell.cpp:741
K3Spell::K3Spell2
void K3Spell2()
Definition k3spell.cpp:422
K3Spell::cleanFputs
bool cleanFputs(const QString &s)
Definition k3spell.cpp:549
K3Spell::curprog
unsigned int curprog
Definition k3spell.h:533
K3Spell::replacelist
QStringList replacelist
Definition k3spell.h:500
K3Spell::ispellExit
void ispellExit()
Definition k3spell.cpp:1440
K3Spell::lastpos
int lastpos
Definition k3spell.h:526
K3Spell::offset
unsigned int offset
Definition k3spell.h:531
K3Spell::done
void done(const QString &buffer)
Emitted when check() is done.
K3Spell::checkListReplaceCurrent
void checkListReplaceCurrent()
Definition k3spell.cpp:1018
K3Spell::dialog
void dialog(const QString &word, QStringList &sugg, const char *_slot)
Definition k3spell.cpp:1322
K3Spell::progres
unsigned int progres
Definition k3spell.h:532
K3Spell::corrected
void corrected(const QString &originalword, const QString &newword, unsigned int pos)
Emitted after the "Replace" or "Replace All" buttons of the dialog was pressed, or if the word was co...
K3Spell::origbuffer
QString origbuffer
Definition k3spell.h:516
K3Spell::m_status
spellStatus m_status
Definition k3spell.h:503
K3Spell::dialog2
void dialog2(int dlgresult)
Definition k3spell.cpp:1356
K3Spell::checkNext
void checkNext()
Definition k3spell.cpp:703
K3Spell::cwword
QString cwword
Definition k3spell.h:518
K3Spell::suggestions
QStringList suggestions() const
Returns list of suggested word replacements.
Definition k3spell.cpp:148
K3Spell::dialog3
void dialog3()
K3Spell::modaltext
static QString modaltext
Definition k3spell.h:539
K3Spell::trystart
int trystart
Definition k3spell.h:524
K3Spell::cleanFputsWord
bool cleanFputsWord(const QString &s)
Definition k3spell.cpp:522
K3Spell::initialize
void initialize(QWidget *_parent, const QString &_caption, QObject *obj, const char *slot, K3SpellConfig *_ksc, bool _progressbar, bool _modal, SpellerType type)
Definition k3spell.cpp:1577
K3Spell::check2
void check2()
Definition k3spell.cpp:1147
K3Spell::K3Spell
K3Spell(QWidget *parent, const QString &caption, QObject *receiver, const char *slot, K3SpellConfig *kcs=0, bool progressbar=true, bool modal=false)
Starts the spellchecker.
Definition k3spell.cpp:125
K3Spell::ignoreall
void ignoreall(const QString &originalword)
Emitted when the user pressed "Ignore All" in the dialog.
K3Spell::autoDelete
bool autoDelete
Definition k3spell.h:512
K3Spell::slotStopCancel
void slotStopCancel(int)
Definition k3spell.cpp:1305
K3Spell::death
void death()
Emitted on terminal errors and after clean up.
K3Spell::usedialog
bool usedialog
Definition k3spell.h:505
K3Spell::newbuffer
QString newbuffer
Definition k3spell.h:517
K3Spell::replaceall
void replaceall(const QString &origword, const QString &replacement)
Emitted when the user pressed "ReplaceAll" in the dialog.
K3Spell::check3
void check3()
Definition k3spell.cpp:1266
K3Spell::modalWidgetHack
static QWidget * modalWidgetHack
Definition k3spell.h:541
K3Spell::personaldict
bool personaldict
Definition k3spell.h:508
K3Spell::writePersonalDictionary
bool writePersonalDictionary()
Definition k3spell.cpp:503
K3Spell::caption
QString caption
Definition k3spell.h:514
K3Spell::checkList3a
void checkList3a()
Definition k3spell.cpp:944
K3Spell::addword
void addword(const QString &originalword)
Emitted when the user pressed "Add" in the dialog.
K3Spell::ignorelist
QStringList ignorelist
Definition k3spell.h:499
K3Spell::replacement
QString replacement() const
Definition k3spell.cpp:1351
K3Spell::spellStatus
spellStatus
Possible states of the spell checker.
Definition k3spell.h:65
K3Spell::Running
@ Running
Definition k3spell.h:65
K3Spell::Error
@ Error
Definition k3spell.h:65
K3Spell::FinishedNoMisspellingsEncountered
@ FinishedNoMisspellingsEncountered
Definition k3spell.h:65
K3Spell::Starting
@ Starting
Definition k3spell.h:65
K3Spell::Cleaning
@ Cleaning
Definition k3spell.h:65
K3Spell::Finished
@ Finished
Definition k3spell.h:65
K3Spell::Crashed
@ Crashed
Definition k3spell.h:65
K3Spell::funnyWord
QString funnyWord(const QString &word)
Definition k3spell.cpp:748
K3Spell::dlgresult
int dlgresult
Definition k3spell.h:523
K3Spell::dialog3slot
QString dialog3slot
Definition k3spell.h:521
K3Spell::misspelling
void misspelling(const QString &originalword, const QStringList &suggestions, unsigned int pos)
Emitted whenever a misspelled word is found by check() or by checkWord().
K3Spell::maxtrystart
int maxtrystart
Definition k3spell.h:525
K3Spell::sugg
QStringList sugg
Definition k3spell.h:501
K3Spell::wordlist
QStringList * wordlist
Definition k3spell.h:497
K3Spell::lastline
int lastline
Definition k3spell.h:528
K3Spell::progress
void progress(unsigned int i)
Emitted during a check().
K3Spell::ignoreword
void ignoreword(const QString &originalword)
Emitted when the user pressed "Ignore" in the dialog.
K3Spell::emitDeath
void emitDeath()
Definition k3spell.cpp:1467
K3Spell::parent
QWidget * parent
Definition k3spell.h:494
K3Spell::setUpDialog
void setUpDialog(bool reallyusedialogbox=true)
Definition k3spell.cpp:470
K3Spell::ksdlg
K3SpellDlg * ksdlg
Definition k3spell.h:496
K3Spell::dlgorigword
QString dlgorigword
Definition k3spell.h:519
K3Spell::done
void done(bool)
Emitted when checkList() is done.
K3Spell::startIspell
void startIspell()
Definition k3spell.cpp:192
K3Spell::dlgreplacement
QString dlgreplacement
Definition k3spell.h:520
K3Spell::SpellerType
SpellerType
These are possible types of documents which the spell checker can check.
Definition k3spell.h:80
K3Spell::TeX
@ TeX
Definition k3spell.h:80
K3Spell::HTML
@ HTML
Definition k3spell.h:80
K3Spell::Text
@ Text
Definition k3spell.h:80
K3Spell::Nroff
@ Nroff
Definition k3spell.h:80
K3Spell::lastlastline
unsigned int lastlastline
Definition k3spell.h:530
K3Spell::checkWord2
void checkWord2()
Definition k3spell.cpp:661
K3Spell::wlIt
QStringList::Iterator wlIt
Definition k3spell.h:498
K3Spell::modaldlg
bool modaldlg
Used for modalCheck.
Definition k3spell.h:538
K3Spell::checkList4
void checkList4()
Definition k3spell.cpp:1033
K3Spell::emitProgress
void emitProgress()
Definition k3spell.cpp:1480
K3Spell::proc
KProcess * proc
Definition k3spell.h:493
K3Spell::dlgon
bool dlgon
Definition k3spell.h:507
K3Spell::modalreturn
static int modalreturn
Definition k3spell.h:540
K3Spell::posinline
unsigned int posinline
Definition k3spell.h:529
K3Spell::ready
void ready(K3Spell *)
Emitted after K3Spell has verified that ISpell/ASpell is running and working properly.
K3Spell::dialogwillprocess
bool dialogwillprocess
Definition k3spell.h:509
K3Spell::parseOneResponse
int parseOneResponse(const QString &_buffer, QString &word, QStringList &sugg)
Definition k3spell.cpp:783
K3Spell::checkList2
void checkList2()
Definition k3spell.cpp:913
K3Spell::ispellErrors
void ispellErrors()
Definition k3spell.cpp:416
K3Spell::ksconfig
K3SpellConfig * ksconfig
Definition k3spell.h:495
K3Spell::orig
QString orig
Definition k3spell.h:515
K3Spell::dialogsetup
bool dialogsetup
Definition k3spell.h:511
K3Spell::suggestWord
void suggestWord()
Definition k3spell.cpp:718
KProcess
QObject
QWidget
kde3support_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Tue Mar 25 2025 00:00:00 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal