• 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
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::curprog
unsigned int curprog
Definition: k3spell.h:533
K3Spell::replacelist
QStringList replacelist
Definition: k3spell.h:500
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::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::cwword
QString cwword
Definition: k3spell.h:518
K3Spell::dialog3
void dialog3()
K3Spell::modaltext
static QString modaltext
Definition: k3spell.h:539
K3Spell::trystart
int trystart
Definition: k3spell.h:524
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::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::modalWidgetHack
static QWidget * modalWidgetHack
Definition: k3spell.h:541
K3Spell::personaldict
bool personaldict
Definition: k3spell.h:508
K3Spell::caption
QString caption
Definition: k3spell.h:514
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::spellStatus
spellStatus
Possible states of the spell checker.
Definition: k3spell.h:65
K3Spell::Cleaning
@ Cleaning
Definition: k3spell.h:65
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::parent
QWidget * parent
Definition: k3spell.h:494
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::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::HTML
@ HTML
Definition: k3spell.h:80
K3Spell::lastlastline
unsigned int lastlastline
Definition: k3spell.h:530
K3Spell::wlIt
QStringList::Iterator wlIt
Definition: k3spell.h:498
K3Spell::modaldlg
bool modaldlg
Used for modalCheck.
Definition: k3spell.h:538
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::ksconfig
K3SpellConfig * ksconfig
Definition: k3spell.h:495
K3Spell::orig
QString orig
Definition: k3spell.h:515
K3Spell::dialogsetup
bool dialogsetup
Definition: k3spell.h:511
KProcess
QObject
QWidget
kde3support_export.h
Error
Error
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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