Mercurial > octave
comparison libgui/languages/build_ts/octave-qsci/Qsci/qsciabstractapis.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 module defines interface to the QsciAbstractAPIs 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 QSCIABSTRACTAPIS_H | |
22 #define QSCIABSTRACTAPIS_H | |
23 | |
24 #include <QList> | |
25 #include <QObject> | |
26 #include <QStringList> | |
27 | |
28 #include <Qsci/qsciglobal.h> | |
29 #include <Qsci/qsciscintilla.h> | |
30 | |
31 | |
32 class QsciLexer; | |
33 | |
34 | |
35 //! \brief The QsciAbstractAPIs class represents the interface to the textual | |
36 //! API information used in call tips and for auto-completion. A sub-class | |
37 //! will provide the actual implementation of the interface. | |
38 //! | |
39 //! API information is specific to a particular language lexer but can be | |
40 //! shared by multiple instances of the lexer. | |
41 class QSCINTILLA_EXPORT QsciAbstractAPIs : public QObject | |
42 { | |
43 Q_OBJECT | |
44 | |
45 public: | |
46 //! Constructs a QsciAbstractAPIs instance attached to lexer \a lexer. \a | |
47 //! lexer becomes the instance's parent object although the instance can | |
48 //! also be subsequently attached to other lexers. | |
49 QsciAbstractAPIs(QsciLexer *lexer); | |
50 | |
51 //! Destroy the QsciAbstractAPIs instance. | |
52 virtual ~QsciAbstractAPIs(); | |
53 | |
54 //! Return the lexer that the instance is attached to. | |
55 QsciLexer *lexer() const; | |
56 | |
57 //! Update the list \a list with API entries derived from \a context. \a | |
58 //! context is the list of words in the text preceding the cursor position. | |
59 //! The characters that make up a word and the characters that separate | |
60 //! words are defined by the lexer. The last word is a partial word and | |
61 //! may be empty if the user has just entered a word separator. | |
62 virtual void updateAutoCompletionList(const QStringList &context, | |
63 QStringList &list) = 0; | |
64 | |
65 //! This is called when the user selects the entry \a selection from the | |
66 //! auto-completion list. A sub-class can use this as a hint to provide | |
67 //! more specific API entries in future calls to | |
68 //! updateAutoCompletionList(). The default implementation does nothing. | |
69 virtual void autoCompletionSelected(const QString &selection); | |
70 | |
71 //! Return the call tips valid for the context \a context. (Note that the | |
72 //! last word of the context will always be empty.) \a commas is the number | |
73 //! of commas the user has typed after the context and before the cursor | |
74 //! position. The exact position of the list of call tips can be adjusted | |
75 //! by specifying a corresponding left character shift in \a shifts. This | |
76 //! is normally done to correct for any displayed context according to \a | |
77 //! style. | |
78 //! | |
79 //! \sa updateAutoCompletionList() | |
80 virtual QStringList callTips(const QStringList &context, int commas, | |
81 QsciScintilla::CallTipsStyle style, QList<int> &shifts) = 0; | |
82 | |
83 private: | |
84 QsciLexer *lex; | |
85 | |
86 QsciAbstractAPIs(const QsciAbstractAPIs &); | |
87 QsciAbstractAPIs &operator=(const QsciAbstractAPIs &); | |
88 }; | |
89 | |
90 #endif |