home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kspell2 / highlighter.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-01-15  |  1.7 KB  |  60 lines

  1. /*
  2.  * highlighter.h
  3.  *
  4.  * Copyright (C)  2004  Zack Rusin <zack@kde.org>
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2.1 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the Free Software
  18.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  19.  * 02110-1301  USA
  20.  */
  21. #ifndef KSPELL_HIGHLIGHTER_H
  22. #define KSPELL_HIGHLIGHTER_H
  23.  
  24. #include "filter.h"
  25.  
  26. #include <qsyntaxhighlighter.h>
  27.  
  28. class QTextEdit;
  29.  
  30. namespace KSpell2
  31. {
  32.     class Highlighter : public QSyntaxHighlighter
  33.     {
  34.     public:
  35.         Highlighter( QTextEdit *textEdit,
  36.                      const QString& configFile = QString::null,
  37.                      Filter *filter = Filter::defaultFilter() );
  38.         ~Highlighter();
  39.  
  40.         virtual int highlightParagraph( const QString& text,
  41.                                         int endStateOfLastPara );
  42.  
  43.         Filter *currentFilter() const;
  44.         void setCurrentFilter( Filter *filter );
  45.  
  46.         QString currentLanguage() const;
  47.         void setCurrentLanguage( const QString& lang );
  48.  
  49.     protected:
  50.         virtual void setMisspelled( int start, int count );
  51.         virtual void unsetMisspelled( int start,  int count );
  52.     private:
  53.         class Private;
  54.         Private *d;
  55.     };
  56.  
  57. }
  58.  
  59. #endif
  60.