1
/***************************************************************************
2
* Copyright (C) 2006-2009 by Thomas Schweitzer *
3
* thomas-schweitzer(at)arcor.de *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License version 2.0 as *
7
* published by the Free Software Foundation. *
9
* This program is distributed in the hope that it will be useful, *
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12
* GNU General Public License for more details. *
14
* You should have received a copy of the GNU General Public License *
15
* along with this program in the file LICENSE.GPL; if not, write to the *
16
* Free Software Foundation, Inc., *
17
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18
***************************************************************************/
20
#ifndef UIGUIHIGHLIGHTER_H
21
#define UIGUIHIGHLIGHTER_H
26
#include <QCoreApplication>
27
#include <Qsci/qsciscintilla.h>
28
#include <Qsci/qscilexer.h>
29
#include <Qsci/qscilexerbash.h>
30
#include <Qsci/qscilexerbatch.h>
31
#include <Qsci/qscilexercmake.h>
32
#include <Qsci/qscilexercpp.h>
33
#include <Qsci/qscilexercsharp.h>
34
#include <Qsci/qscilexercss.h>
35
#include <Qsci/qscilexerd.h>
36
#include <Qsci/qscilexerdiff.h>
37
#if ( QSCINTILLA_VERSION >= 0x020300 )
38
#include <Qsci/qscilexerfortran.h>
39
#include <Qsci/qscilexerfortran77.h>
41
#include <Qsci/qscilexerhtml.h>
42
#include <Qsci/qscilexeridl.h>
43
#include <Qsci/qscilexerjava.h>
44
#include <Qsci/qscilexerjavascript.h>
45
#include <Qsci/qscilexerlua.h>
46
#include <Qsci/qscilexermakefile.h>
47
#if ( QSCINTILLA_VERSION >= 0x020300 )
48
#include <Qsci/qscilexerpascal.h>
50
#include <Qsci/qscilexerperl.h>
51
#if ( QSCINTILLA_VERSION >= 0x020300 )
52
#include <Qsci/qscilexerpostscript.h>
54
#include <Qsci/qscilexerpov.h>
55
#include <Qsci/qscilexerproperties.h>
56
#include <Qsci/qscilexerpython.h>
57
#include <Qsci/qscilexerruby.h>
58
#include <Qsci/qscilexersql.h>
59
#if ( QSCINTILLA_VERSION >= 0x020300 )
60
#include <Qsci/qscilexertcl.h>
62
#include <Qsci/qscilexertex.h>
63
#include <Qsci/qscilexervhdl.h>
64
#if ( QSCINTILLA_VERSION >= 0x020300 )
65
#include <Qsci/qscilexerxml.h>
66
#include <Qsci/qscilexeryaml.h>
70
class UiGuiHighlighter : public QObject
75
UiGuiHighlighter(QsciScintilla *parent);
76
void turnHighlightOff();
77
void turnHighlightOn();
79
bool readCurrentSettings(const char *prefix);
80
void writeCurrentSettings(const char *prefix);
81
QStringList getAvailableHighlighters();
84
bool highlightningIsOn;
85
QsciScintilla *qsciEditorParent;
86
QMap<int, QFont> fontForStyles;
87
QMap<int, QColor> colorForStyles;
90
QMap<QString, QStringList> mapHighlighternameToExtension;
93
//! The foreground color for style number \a style is set to \a color. If
94
//! \a style is -1 then the color is set for all styles.
95
void setColor(const QColor &color, int style = -1);
97
//! The font for style number \a style is set to \a font. If \a style is
98
//! -1 then the font is set for all styles.
99
void setFont(const QFont &font, int style = -1);
101
//! Sets the lexer that is responsible for the given \a extension.
102
int setLexerForExtension( QString extension );
104
void setLexerByName( QString lexerName );
106
void setHighlighterByAction(QAction* highlighterAction);
109
#endif // UIGUIHIGHLIGHTER_H