don't let spaceAdd ever become negative and break the layout.
[kdelibs.git] / kde3support / kdeui / k3spelldlg.h
blob8d906f91bad33a8d82f600c27560ccd849b83013
1 /* This file is part of the KDE libraries
2 Copyright (C) 1997 David Sweet <dsweet@kde.org>
3 Copyright (C) 2000 Rik Hemsley <rik@kde.org>
4 Copyright (C) 2003 Zack Rusin <zack@kde.org>
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
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., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
20 #ifndef K3SPELLDLG_H
21 #define K3SPELLDLG_H
23 #include <kde3support_export.h>
24 #include <kdialog.h>
26 class QStringList;
27 class QLabel;
28 class Q3ListViewItem;
29 class QPushButton;
30 class QProgressBar;
31 class KListWidget;
32 class KLineEdit;
34 //Possible result codes
35 enum KS_RESULT {
36 KS_CANCEL= 0,
37 KS_REPLACE= 1,
38 KS_REPLACEALL= 2,
39 KS_IGNORE= 3,
40 KS_IGNOREALL= 4,
41 KS_ADD= 5,
42 KS_STOP= 7,
43 KS_SUGGEST= 8,
44 KS_CONFIG= 9
47 /**
48 * @deprecated, use sonnet instead
50 class KDE3SUPPORT_EXPORT_DEPRECATED K3SpellDlg : public KDialog
52 Q_OBJECT
54 class K3SpellDlgPrivate;
55 K3SpellDlgPrivate *d;
56 KLineEdit *editbox;
57 QProgressBar *progbar;
58 KListWidget *listbox;
59 QStringList *sugg;
60 QPushButton *qpbrep, *qpbrepa;
61 QLabel *wordlabel;
62 QString word, newword;
63 bool progressbar;
65 public:
66 explicit K3SpellDlg( QWidget *parent,
67 bool _progressbar = false, bool _modal = false );
68 ~K3SpellDlg();
70 QString replacement() const;
72 /**
73 * Change the misspelled word and suggested replacements
74 * and enable the disabled buttons on the dialog box.
75 * (Buttons are disabled by standby().)
76 **/
77 void init( const QString& _word, QStringList* _sugg );
78 void init( const QString& _word, QStringList* _sugg,
79 const QString& context );
81 void standby();
83 public Q_SLOTS:
84 /**
85 * Adjust the progress bar to @p p percent.
86 **/
87 void slotProgress( unsigned int p );
89 protected:
90 virtual void closeEvent( QCloseEvent * e );
91 void done( int i );
93 Q_SIGNALS:
94 /**
95 This signal is emitted when a button is pressed.
97 void command( int );
99 void ready( bool );
101 protected Q_SLOTS:
102 void ignore();
103 void add();
104 void ignoreAll();
105 void cancel();
106 void replace();
107 void replaceAll();
108 void suggest();
109 void stop();
110 void slotConfigChanged();
112 void textChanged( const QString & );
114 void slotSelectionChanged( Q3ListViewItem* item );
117 #endif