1
// This module implements the QsciLexerXML class.
3
// Copyright (c) 2008 Riverbank Computing Limited <info@riverbankcomputing.com>
5
// This file is part of QScintilla.
7
// This file may be used under the terms of the GNU General Public
8
// License versions 2.0 or 3.0 as published by the Free Software
9
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
10
// included in the packaging of this file. Alternatively you may (at
11
// your option) use any later version of the GNU General Public
12
// License if such license has been publicly approved by Riverbank
13
// Computing Limited (or its successors, if any) and the KDE Free Qt
14
// Foundation. In addition, as a special exception, Riverbank gives you
15
// certain additional rights. These rights are described in the Riverbank
16
// GPL Exception version 1.1, which can be found in the file
17
// GPL_EXCEPTION.txt in this package.
19
// Please review the following information to ensure GNU General
20
// Public Licensing requirements will be met:
21
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
22
// you are unsure which license is appropriate for your use, please
23
// review the following information:
24
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
25
// or contact the sales department at sales@riverbankcomputing.com.
27
// This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
28
// INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
29
// A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
32
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
33
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36
#include "Qsci/qscilexerxml.h"
43
QsciLexerXML::QsciLexerXML(QObject *parent)
44
: QsciLexerHTML(parent)
50
QsciLexerXML::~QsciLexerXML()
55
// Returns the language name.
56
const char *QsciLexerXML::language() const
62
// Returns the lexer name.
63
const char *QsciLexerXML::lexer() const
69
// Returns the foreground colour of the text for a style.
70
QColor QsciLexerXML::defaultColor(int style) const
75
return QColor(0x00,0x00,0x00);
82
return QColor(0x00,0x00,0x80);
85
case UnknownAttribute:
86
return QColor(0x00,0x80,0x80);
89
return QColor(0x00,0x7f,0x7f);
91
case HTMLDoubleQuotedString:
92
case HTMLSingleQuotedString:
93
return QColor(0x7f,0x00,0x7f);
99
return QColor(0x80,0x00,0x80);
103
return QColor(0x80,0x80,0x00);
107
case SGMLDoubleQuotedString:
109
return QColor(0x80,0x00,0x00);
112
return QColor(0x60,0x80,0x60);
115
return QColor(0x00,0x66,0x00);
117
case SGMLSingleQuotedString:
118
return QColor(0x99,0x33,0x00);
121
return QColor(0x33,0x66,0xff);
124
return QColor(0x33,0x33,0x33);
126
case SGMLBlockDefault:
127
return QColor(0x00,0x00,0x66);
130
return QsciLexerHTML::defaultColor(style);
134
// Returns the end-of-line fill for a style.
135
bool QsciLexerXML::defaultEolFill(int style) const
140
return QsciLexerHTML::defaultEolFill(style);
144
// Returns the font of the text for a style.
145
QFont QsciLexerXML::defaultFont(int style) const
154
#if defined(Q_OS_WIN)
155
f = QFont("Times New Roman",11);
157
f = QFont("Bitstream Charter",10);
164
f = QsciLexer::defaultFont(style);
169
f = QsciLexerHTML::defaultFont(style);
176
// Returns the set of keywords.
177
const char *QsciLexerXML::keywords(int set) const
180
return QsciLexerHTML::keywords(set);
186
// Returns the background colour of the text for a style.
187
QColor QsciLexerXML::defaultPaper(int style) const
192
return QColor(0xff,0xf0,0xf0);
197
case SGMLDoubleQuotedString:
198
case SGMLSingleQuotedString:
202
return QColor(0xef,0xef,0xff);
205
return QColor(0xff,0x66,0x66);
207
case SGMLBlockDefault:
208
return QColor(0xcc,0xcc,0xe0);
211
return QsciLexerHTML::defaultPaper(style);