comparison libgui/languages/build_ts/octave-qsci/Qsci/qscicommandset.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 QsciCommandSet 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 QSCICOMMANDSET_H
22 #define QSCICOMMANDSET_H
23
24 #include <qglobal.h>
25
26 #include <QList>
27
28 #include <Qsci/qsciglobal.h>
29 #include <Qsci/qscicommand.h>
30
31
32 QT_BEGIN_NAMESPACE
33 class QSettings;
34 QT_END_NAMESPACE
35
36 class QsciScintilla;
37
38
39 //! \brief The QsciCommandSet class represents the set of all internal editor
40 //! commands that may have keys bound.
41 //!
42 //! Methods are provided to access the individual commands and to read and
43 //! write the current bindings from and to settings files.
44 class QSCINTILLA_EXPORT QsciCommandSet
45 {
46 public:
47 //! The key bindings for each command in the set are read from the
48 //! settings \a qs. \a prefix is prepended to the key of each entry.
49 //! true is returned if there was no error.
50 //!
51 //! \sa writeSettings()
52 bool readSettings(QSettings &qs, const char *prefix = "/Scintilla");
53
54 //! The key bindings for each command in the set are written to the
55 //! settings \a qs. \a prefix is prepended to the key of each entry.
56 //! true is returned if there was no error.
57 //!
58 //! \sa readSettings()
59 bool writeSettings(QSettings &qs, const char *prefix = "/Scintilla");
60
61 //! The commands in the set are returned as a list.
62 QList<QsciCommand *> &commands() {return cmds;}
63
64 //! The primary keys bindings for all commands are removed.
65 void clearKeys();
66
67 //! The alternate keys bindings for all commands are removed.
68 void clearAlternateKeys();
69
70 // Find the command that is bound to \a key.
71 QsciCommand *boundTo(int key) const;
72
73 // Find a specific command \a command.
74 QsciCommand *find(QsciCommand::Command command) const;
75
76 private:
77 friend class QsciScintilla;
78
79 QsciCommandSet(QsciScintilla *qs);
80 ~QsciCommandSet();
81
82 QsciScintilla *qsci;
83 QList<QsciCommand *> cmds;
84
85 QsciCommandSet(const QsciCommandSet &);
86 QsciCommandSet &operator=(const QsciCommandSet &);
87 };
88
89 #endif