dialog.h

00001 // -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; -*-
00002 /*
00003  * dialog.h
00004  *
00005  * Copyright (C)  2003  Zack Rusin <zack@kde.org>
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00020  * 02110-1301  USA
00021  */
00022 #ifndef KSPELL_DIALOG_H
00023 #define KSPELL_DIALOG_H
00024 
00025 #include <kdialogbase.h>
00026 
00027 namespace KSpell2
00028 {
00029     class Filter;
00030     class BackgroundChecker;
00031     class KDE_EXPORT Dialog : public KDialogBase
00032     {
00033         Q_OBJECT
00034     public:
00035         Dialog( BackgroundChecker *checker,
00036                 QWidget *parent, const char *name=0 );
00037         ~Dialog();
00038 
00039         QString originalBuffer() const;
00040         QString buffer() const;
00041 
00042         void show();
00043         void activeAutoCorrect( bool _active );
00044 
00045     public slots:
00046         void setBuffer( const QString& );
00047         void setFilter( Filter* filter );
00048 
00049     signals:
00050         void done( const QString& newBuffer );
00051         void misspelling( const QString& word, int start );
00052         void replace( const QString& oldWord, int start,
00053                       const QString& newWord );
00054 
00055         void stop();
00056         void cancel();
00057         void autoCorrect( const QString & currentWord, const QString & replaceWord );
00058     private slots:
00059         void slotMisspelling(const QString& word, int start );
00060         void slotDone();
00061 
00062         void slotFinished();
00063         void slotCancel();
00064 
00065         void slotAddWord();
00066         void slotReplaceWord();
00067         void slotReplaceAll();
00068         void slotSkip();
00069         void slotSkipAll();
00070         void slotSuggest();
00071         void slotChangeLanguage( const QString& );
00072         void slotSelectionChanged( QListViewItem * );
00073         void slotAutocorrect();
00074 
00075     private:
00076         void updateDialog( const QString& word );
00077         void fillSuggestions( const QStringList& suggs );
00078         void initConnections();
00079         void initGui();
00080         void continueChecking();
00081 
00082     private:
00083         class Private;
00084         Private *d;
00085     };
00086 }
00087 
00088 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys