UniversalIndentGUI 1.2.0
UiGuiHighlighter.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2006-2012 by Thomas Schweitzer                          *
00003  *   thomas-schweitzer(at)arcor.de                                         *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License version 2.0 as   *
00007  *   published by the Free Software Foundation.                            *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU General Public License     *
00015  *   along with this program in the file LICENSE.GPL; if not, write to the *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00018  ***************************************************************************/
00019 
00020 #ifndef UIGUIHIGHLIGHTER_H
00021 #define UIGUIHIGHLIGHTER_H
00022 
00023 #include <QObject>
00024 #include <QMap>
00025 #include <QFont>
00026 #include <QColor>
00027 
00028 class QAction;
00029 class QSettings;
00030 
00031 class QsciScintilla;
00032 class QsciLexer;
00033 
00034 
00035 class UiGuiHighlighter : public QObject
00036 {
00037     Q_OBJECT
00038 
00039 public:
00040     UiGuiHighlighter(QsciScintilla *parent);
00041     void turnHighlightOff();
00042     void turnHighlightOn();
00043 
00044     bool readCurrentSettings(const char *prefix);
00045     void writeCurrentSettings(const char *prefix);
00046     QStringList getAvailableHighlighters();
00047 
00048 public slots:
00051     void setColor(const QColor &color, int style = -1);
00052 
00055     void setFont(const QFont &font, int style = -1);
00056 
00058     int setLexerForExtension( QString extension );
00059 
00060     void setLexerByName( QString lexerName );
00061 
00062     void setHighlighterByAction(QAction* highlighterAction);
00063 
00064 private:
00065     bool _highlightningIsOn;
00066     QsciScintilla *_qsciEditorParent;
00067     QMap<int, QFont> _fontForStyles;
00068     QMap<int, QColor> _colorForStyles;
00069     QsciLexer* _lexer;
00070     QSettings *_settings;
00071     QMap<QString, QStringList> _mapHighlighternameToExtension;
00072 };
00073 
00074 #endif  // UIGUIHIGHLIGHTER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines