Mercurial > octave
comparison libgui/languages/build_ts/octave-qsci/Qsci/qscilexeryaml.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 QsciLexerYAML 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 QSCILEXERYAML_H | |
22 #define QSCILEXERYAML_H | |
23 | |
24 #include <QObject> | |
25 | |
26 #include <Qsci/qsciglobal.h> | |
27 #include <Qsci/qscilexer.h> | |
28 | |
29 | |
30 //! \brief The QsciLexerYAML class encapsulates the Scintilla YAML lexer. | |
31 class QSCINTILLA_EXPORT QsciLexerYAML : public QsciLexer | |
32 { | |
33 Q_OBJECT | |
34 | |
35 public: | |
36 //! This enum defines the meanings of the different styles used by the | |
37 //! YAML lexer. | |
38 enum { | |
39 //! The default. | |
40 Default = 0, | |
41 | |
42 //! A comment. | |
43 Comment = 1, | |
44 | |
45 //! An identifier. | |
46 Identifier = 2, | |
47 | |
48 //! A keyword | |
49 Keyword = 3, | |
50 | |
51 //! A number. | |
52 Number = 4, | |
53 | |
54 //! A reference. | |
55 Reference = 5, | |
56 | |
57 //! A document delimiter. | |
58 DocumentDelimiter = 6, | |
59 | |
60 //! A text block marker. | |
61 TextBlockMarker = 7, | |
62 | |
63 //! A syntax error marker. | |
64 SyntaxErrorMarker = 8, | |
65 | |
66 //! An operator. | |
67 Operator = 9 | |
68 }; | |
69 | |
70 //! Construct a QsciLexerYAML with parent \a parent. \a parent is | |
71 //! typically the QsciScintilla instance. | |
72 QsciLexerYAML(QObject *parent = 0); | |
73 | |
74 //! Destroys the QsciLexerYAML instance. | |
75 virtual ~QsciLexerYAML(); | |
76 | |
77 //! Returns the name of the language. | |
78 const char *language() const; | |
79 | |
80 //! Returns the name of the lexer. Some lexers support a number of | |
81 //! languages. | |
82 const char *lexer() const; | |
83 | |
84 //! Returns the foreground colour of the text for style number \a style. | |
85 //! | |
86 //! \sa defaultPaper() | |
87 QColor defaultColor(int style) const; | |
88 | |
89 //! Returns the end-of-line fill for style number \a style. | |
90 bool defaultEolFill(int style) const; | |
91 | |
92 //! Returns the font for style number \a style. | |
93 QFont defaultFont(int style) const; | |
94 | |
95 //! Returns the background colour of the text for style number \a style. | |
96 //! | |
97 //! \sa defaultColor() | |
98 QColor defaultPaper(int style) const; | |
99 | |
100 //! Returns the set of keywords for the keyword set \a set recognised | |
101 //! by the lexer as a space separated string. | |
102 const char *keywords(int set) const; | |
103 | |
104 //! Returns the descriptive name for style number \a style. If the | |
105 //! style is invalid for this language then an empty QString is returned. | |
106 //! This is intended to be used in user preference dialogs. | |
107 QString description(int style) const; | |
108 | |
109 //! Causes all properties to be refreshed by emitting the propertyChanged() | |
110 //! signal as required. | |
111 void refreshProperties(); | |
112 | |
113 //! Returns true if multi-line comment blocks can be folded. | |
114 //! | |
115 //! \sa setFoldComments() | |
116 bool foldComments() const; | |
117 | |
118 public slots: | |
119 //! If \a fold is true then multi-line comment blocks can be folded. | |
120 //! The default is false. | |
121 //! | |
122 //! \sa foldComments() | |
123 virtual void setFoldComments(bool fold); | |
124 | |
125 protected: | |
126 //! The lexer's properties are read from the settings \a qs. \a prefix | |
127 //! (which has a trailing '/') should be used as a prefix to the key of | |
128 //! each setting. true is returned if there is no error. | |
129 //! | |
130 bool readProperties(QSettings &qs,const QString &prefix); | |
131 | |
132 //! The lexer's properties are written to the settings \a qs. | |
133 //! \a prefix (which has a trailing '/') should be used as a prefix to | |
134 //! the key of each setting. true is returned if there is no error. | |
135 //! | |
136 bool writeProperties(QSettings &qs,const QString &prefix) const; | |
137 | |
138 private: | |
139 void setCommentProp(); | |
140 | |
141 bool fold_comments; | |
142 | |
143 QsciLexerYAML(const QsciLexerYAML &); | |
144 QsciLexerYAML &operator=(const QsciLexerYAML &); | |
145 }; | |
146 | |
147 #endif |