Mercurial > octave
comparison libgui/languages/build_ts/octave-qsci/Qsci/qscilexeravs.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 QsciLexerAVS 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 QSCILEXERAVS_H | |
22 #define QSCILEXERAVS_H | |
23 | |
24 #include <QObject> | |
25 | |
26 #include <Qsci/qsciglobal.h> | |
27 #include <Qsci/qscilexer.h> | |
28 | |
29 | |
30 //! \brief The QsciLexerAVS class encapsulates the Scintilla AVS lexer. | |
31 class QSCINTILLA_EXPORT QsciLexerAVS : public QsciLexer | |
32 { | |
33 Q_OBJECT | |
34 | |
35 public: | |
36 //! This enum defines the meanings of the different styles used by the | |
37 //! AVS lexer. | |
38 enum { | |
39 //! The default. | |
40 Default = 0, | |
41 | |
42 //! A block comment. | |
43 BlockComment = 1, | |
44 | |
45 //! A nested block comment. | |
46 NestedBlockComment = 2, | |
47 | |
48 //! A line comment. | |
49 LineComment = 3, | |
50 | |
51 //! A number. | |
52 Number = 4, | |
53 | |
54 //! An operator. | |
55 Operator = 5, | |
56 | |
57 //! An identifier | |
58 Identifier = 6, | |
59 | |
60 //! A string. | |
61 String = 7, | |
62 | |
63 //! A triple quoted string. | |
64 TripleString = 8, | |
65 | |
66 //! A keyword (as defined by keyword set number 1).. | |
67 Keyword = 9, | |
68 | |
69 //! A filter (as defined by keyword set number 2). | |
70 Filter = 10, | |
71 | |
72 //! A plugin (as defined by keyword set number 3). | |
73 Plugin = 11, | |
74 | |
75 //! A function (as defined by keyword set number 4). | |
76 Function = 12, | |
77 | |
78 //! A clip property (as defined by keyword set number 5). | |
79 ClipProperty = 13, | |
80 | |
81 //! A keyword defined in keyword set number 6. The class must be | |
82 //! sub-classed and re-implement keywords() to make use of this style. | |
83 KeywordSet6 = 14 | |
84 }; | |
85 | |
86 //! Construct a QsciLexerAVS with parent \a parent. \a parent is typically | |
87 //! the QsciScintilla instance. | |
88 QsciLexerAVS(QObject *parent = 0); | |
89 | |
90 //! Destroys the QsciLexerAVS instance. | |
91 virtual ~QsciLexerAVS(); | |
92 | |
93 //! Returns the name of the language. | |
94 const char *language() const; | |
95 | |
96 //! Returns the name of the lexer. Some lexers support a number of | |
97 //! languages. | |
98 const char *lexer() const; | |
99 | |
100 //! \internal Returns the style used for braces for brace matching. | |
101 int braceStyle() const; | |
102 | |
103 //! Returns the string of characters that comprise a word. | |
104 const char *wordCharacters() const; | |
105 | |
106 //! Returns the foreground colour of the text for style number \a style. | |
107 //! | |
108 //! \sa defaultPaper() | |
109 QColor defaultColor(int style) const; | |
110 | |
111 //! Returns the font for style number \a style. | |
112 QFont defaultFont(int style) const; | |
113 | |
114 //! Returns the set of keywords for the keyword set \a set recognised | |
115 //! by the lexer as a space separated string. | |
116 const char *keywords(int set) const; | |
117 | |
118 //! Returns the descriptive name for style number \a style. If the | |
119 //! style is invalid for this language then an empty QString is returned. | |
120 //! This is intended to be used in user preference dialogs. | |
121 QString description(int style) const; | |
122 | |
123 //! Causes all properties to be refreshed by emitting the propertyChanged() | |
124 //! signal as required. | |
125 void refreshProperties(); | |
126 | |
127 //! Returns true if multi-line comment blocks can be folded. | |
128 //! | |
129 //! \sa setFoldComments() | |
130 bool foldComments() const; | |
131 | |
132 //! Returns true if trailing blank lines are included in a fold block. | |
133 //! | |
134 //! \sa setFoldCompact() | |
135 bool foldCompact() const; | |
136 | |
137 public slots: | |
138 //! If \a fold is true then multi-line comment blocks can be folded. | |
139 //! The default is false. | |
140 //! | |
141 //! \sa foldComments() | |
142 virtual void setFoldComments(bool fold); | |
143 | |
144 //! If \a fold is true then trailing blank lines are included in a fold | |
145 //! block. The default is true. | |
146 //! | |
147 //! \sa foldCompact() | |
148 virtual void setFoldCompact(bool fold); | |
149 | |
150 protected: | |
151 //! The lexer's properties are read from the settings \a qs. \a prefix | |
152 //! (which has a trailing '/') should be used as a prefix to the key of | |
153 //! each setting. true is returned if there is no error. | |
154 //! | |
155 bool readProperties(QSettings &qs,const QString &prefix); | |
156 | |
157 //! The lexer's properties are written to the settings \a qs. | |
158 //! \a prefix (which has a trailing '/') should be used as a prefix to | |
159 //! the key of each setting. true is returned if there is no error. | |
160 //! | |
161 bool writeProperties(QSettings &qs,const QString &prefix) const; | |
162 | |
163 private: | |
164 void setCommentProp(); | |
165 void setCompactProp(); | |
166 | |
167 bool fold_comments; | |
168 bool fold_compact; | |
169 | |
170 QsciLexerAVS(const QsciLexerAVS &); | |
171 QsciLexerAVS &operator=(const QsciLexerAVS &); | |
172 }; | |
173 | |
174 #endif |