lib Library API Documentation

koSpelldlg.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 1997 David Sweet <dsweet@kde.org>
00003    Copyright (C) 2000 Rik Hemsley <rik@kde.org>
00004    Copyright (C) 2002 Laurent Montel <lmontel@mandrakesoft.com>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License version 2 as published by the Free Software Foundation.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef __KOSPELLDLG_H__
00021 #define __KOSPELLDLG_H__
00022 
00023 #include <kdialogbase.h>
00024 
00025 class QStringList;
00026 class QLabel;
00027 class QPushButton;
00028 class KListBox;
00029 class KLineEdit;
00030 class QComboBox;
00031 class QCheckBox;
00032 
00033 //Possible result codes
00034 enum KOS_RESULT {
00035   KOS_CANCEL=     0,
00036   KOS_REPLACE=    1,
00037   KOS_REPLACEALL= 2,
00038   KOS_IGNORE=     3,
00039   KOS_IGNOREALL=  4,
00040   KOS_ADD=        5,
00041   KOS_STOP=       7,
00042   KOS_CHECKAGAIN =8,
00043   KOS_ADDAUTOCORRECT = 9,
00044   KOS_CHECKAGAINWITHNEWLANGUAGE = 10
00045 };
00046 
00047 class KOSpellDlg : public KDialogBase
00048 {
00049     Q_OBJECT
00050 
00051     class KOSpellDlgPrivate;
00052     KOSpellDlgPrivate *d;
00053     KLineEdit *editbox;
00054     KListBox *listbox;
00055     QComboBox *language;
00056     QStringList *sugg;
00057     QPushButton *qpbrep, *qpbrepa;
00058     QLabel *wordlabel;
00059     QString word, newword;
00060     QCheckBox *m_previous;
00061 
00062     int m_indexLanguage;
00063 public:
00064     KOSpellDlg (QWidget *parent, KOSpellConfig *_ksc, const char *name, int indexOfLanguage,
00065               bool _modal = FALSE, bool _autocorrect = false );
00066 
00067     QString replacement () const
00068         { return newword; }
00069 
00075     void init (const QString& _word, QStringList *_sugg);
00076 
00077     void changeSuggList( QStringList *_lst );
00078 
00079     void standby() { emit(ready(false)); }
00080 
00081     int languageIndex()const { return m_indexLanguage;}
00082 
00083     bool previousWord() const;
00084 
00085 protected:
00086     virtual void closeEvent ( QCloseEvent * e );
00087     void done (int i);
00088     void changeButtonState( QStringList * _sugg );
00089 
00090 signals:
00094     void command (int);
00095 
00096     void ready(bool);
00097 
00098 protected slots:
00099     void ignore();
00100     void add();
00101     void ignoreAll();
00102     void cancel();
00103     void replace();
00104     void replaceAll();
00105     void stop();
00106     void addToAutoCorrect();
00107 
00108     void spellCheckAgain();
00109     void textChanged (const QString &);
00110     void changeLanguage( int );
00111     void selected (int i);
00112     void highlighted (int i);
00113 
00114 
00115 };
00116 
00117 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 11 11:47:43 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003