Mercurial > octave
comparison libgui/languages/build_ts/octave-qsci/Qsci/qscilexerxml.h @ 31537:5ceb4bfcdb0f stable
add tools and files for updating the gui's language files for translation
* libgui/languages/build_ts/README.md: readme for updating language files
* libgui/languages/build_ts/octave-qsci: QScintilla source files for
languages without translation provided by QScintilla
* libgui/languages/build_ts/octave-qt: Qt source files for languages
without translation provided by Qt
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Thu, 24 Nov 2022 06:48:25 +0100 |
parents | |
children | dd5ece3664ed |
comparison
equal
deleted
inserted
replaced
31535:4b80982e0af8 | 31537:5ceb4bfcdb0f |
---|---|
1 // This defines the interface to the QsciLexerXML class. | |
2 // | |
3 // Copyright (c) 2019 Riverbank Computing Limited <info@riverbankcomputing.com> | |
4 // | |
5 // This file is part of QScintilla. | |
6 // | |
7 // This file may be used under the terms of the GNU General Public License | |
8 // version 3.0 as published by the Free Software Foundation and appearing in | |
9 // the file LICENSE included in the packaging of this file. Please review the | |
10 // following information to ensure the GNU General Public License version 3.0 | |
11 // requirements will be met: http://www.gnu.org/copyleft/gpl.html. | |
12 // | |
13 // If you do not wish to use this file under the terms of the GPL version 3.0 | |
14 // then you may purchase a commercial license. For more information contact | |
15 // info@riverbankcomputing.com. | |
16 // | |
17 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | |
18 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
19 | |
20 | |
21 #ifndef QSCILEXERXML_H | |
22 #define QSCILEXERXML_H | |
23 | |
24 #include <QObject> | |
25 | |
26 #include <Qsci/qsciglobal.h> | |
27 #include <Qsci/qscilexerhtml.h> | |
28 | |
29 | |
30 //! \brief The QsciLexerXML class encapsulates the Scintilla XML lexer. | |
31 class QSCINTILLA_EXPORT QsciLexerXML : public QsciLexerHTML | |
32 { | |
33 Q_OBJECT | |
34 | |
35 public: | |
36 //! Construct a QsciLexerXML with parent \a parent. \a parent is typically | |
37 //! the QsciScintilla instance. | |
38 QsciLexerXML(QObject *parent = 0); | |
39 | |
40 //! Destroys the QsciLexerXML instance. | |
41 virtual ~QsciLexerXML(); | |
42 | |
43 //! Returns the name of the language. | |
44 const char *language() const; | |
45 | |
46 //! Returns the name of the lexer. Some lexers support a number of | |
47 //! languages. | |
48 const char *lexer() const; | |
49 | |
50 //! Returns the foreground colour of the text for style number \a style. | |
51 //! | |
52 //! \sa defaultPaper() | |
53 QColor defaultColor(int style) const; | |
54 | |
55 //! Returns the end-of-line fill for style number \a style. | |
56 bool defaultEolFill(int style) const; | |
57 | |
58 //! Returns the font for style number \a style. | |
59 QFont defaultFont(int style) const; | |
60 | |
61 //! Returns the background colour of the text for style number \a style. | |
62 //! | |
63 //! \sa defaultColor() | |
64 QColor defaultPaper(int style) const; | |
65 | |
66 //! Returns the set of keywords for the keyword set \a set recognised | |
67 //! by the lexer as a space separated string. | |
68 const char *keywords(int set) const; | |
69 | |
70 //! Causes all properties to be refreshed by emitting the | |
71 //! propertyChanged() signal as required. | |
72 void refreshProperties(); | |
73 | |
74 //! If \a allowed is true then scripts are styled. The default is true. | |
75 //! | |
76 //! \sa scriptsStyled() | |
77 void setScriptsStyled(bool styled); | |
78 | |
79 //! Returns true if scripts are styled. | |
80 //! | |
81 //! \sa setScriptsStyled() | |
82 bool scriptsStyled() const; | |
83 | |
84 protected: | |
85 //! The lexer's properties are read from the settings \a qs. \a prefix | |
86 //! (which has a trailing '/') should be used as a prefix to the key of | |
87 //! each setting. true is returned if there is no error. | |
88 //! | |
89 bool readProperties(QSettings &qs, const QString &prefix); | |
90 | |
91 //! The lexer's properties are written to the settings \a qs. | |
92 //! \a prefix (which has a trailing '/') should be used as a prefix to | |
93 //! the key of each setting. true is returned if there is no error. | |
94 //! | |
95 bool writeProperties(QSettings &qs, const QString &prefix) const; | |
96 | |
97 private: | |
98 void setScriptsProp(); | |
99 | |
100 bool scripts; | |
101 | |
102 QsciLexerXML(const QsciLexerXML &); | |
103 QsciLexerXML &operator=(const QsciLexerXML &); | |
104 }; | |
105 | |
106 #endif |