katespell.h

00001 /* This file is part of the KDE libraries
00002    Copyright (C) 2004-2005 Anders Lund <anders@alweb.dk>
00003    Copyright (C) 2002 John Firebaugh <jfirebaugh@kde.org>
00004    Copyright (C) 2001-2004 Christoph Cullmann <cullmann@kde.org>
00005    Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
00006    Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
00007 
00008    This library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public
00010    License version 2 as published by the Free Software Foundation.
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    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020    Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef __KATE_SPELL_H__
00024 #define __KATE_SPELL_H__
00025 
00026 #include "katecursor.h"
00027 
00028 class KateView;
00029 
00030 class KAction;
00031 class KSpell;
00032 
00033 class KateSpell : public QObject
00034 {
00035   Q_OBJECT
00036 
00037   public:
00038     KateSpell( KateView* );
00039     ~KateSpell();
00040 
00041     void createActions( KActionCollection* );
00042 
00043     void updateActions ();
00044 
00045   // spellcheck from cursor, selection
00046   private slots:
00047     void spellcheckFromCursor();
00048 
00049     // defined here in anticipation of pr view selections ;)
00050     void spellcheckSelection();
00051 
00052     void spellcheck();
00053 
00060     void spellcheck( const KateTextCursor &from, const KateTextCursor &to=KateTextCursor() );
00061 
00062     void ready(KSpell *);
00063     void misspelling( const QString&, const QStringList&, unsigned int );
00064     void corrected  ( const QString&, const QString&, unsigned int);
00065     void spellResult( const QString& );
00066     void spellCleanDone();
00067 
00068     void locatePosition( uint pos, uint& line, uint& col );
00069 
00070   private:
00071     KateView *m_view;
00072     KAction *m_spellcheckSelection;
00073 
00074     KSpell *m_kspell;
00075 
00076     // define the part of the text to check
00077     KateTextCursor m_spellStart, m_spellEnd;
00078 
00079     // keep track of where we are.
00080     KateTextCursor m_spellPosCursor;
00081     uint m_spellLastPos;
00082 };
00083 
00084 #endif
00085 
00086 // kate: space-indent on; indent-width 2; replace-tabs on;
KDE Home | KDE Accessibility Home | Description of Access Keys