comparison libgui/languages/build_ts/octave-qsci/Qsci/qscimacro.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 QsciMacro 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 QSCIMACRO_H
22 #define QSCIMACRO_H
23
24 #include <QList>
25 #include <QObject>
26 #include <QString>
27
28 #include <Qsci/qsciglobal.h>
29
30
31 class QsciScintilla;
32
33
34 //! \brief The QsciMacro class represents a sequence of recordable editor
35 //! commands.
36 //!
37 //! Methods are provided to convert convert a macro to and from a textual
38 //! representation so that they can be easily written to and read from
39 //! permanent storage.
40 class QSCINTILLA_EXPORT QsciMacro : public QObject
41 {
42 Q_OBJECT
43
44 public:
45 //! Construct a QsciMacro with parent \a parent.
46 QsciMacro(QsciScintilla *parent);
47
48 //! Construct a QsciMacro from the printable ASCII representation \a asc,
49 //! with parent \a parent.
50 QsciMacro(const QString &asc, QsciScintilla *parent);
51
52 //! Destroy the QsciMacro instance.
53 virtual ~QsciMacro();
54
55 //! Clear the contents of the macro.
56 void clear();
57
58 //! Load the macro from the printable ASCII representation \a asc. Returns
59 //! true if there was no error.
60 //!
61 //! \sa save()
62 bool load(const QString &asc);
63
64 //! Return a printable ASCII representation of the macro. It is guaranteed
65 //! that only printable ASCII characters are used and that double quote
66 //! characters will not be used.
67 //!
68 //! \sa load()
69 QString save() const;
70
71 public slots:
72 //! Play the macro.
73 virtual void play();
74
75 //! Start recording user commands and add them to the macro.
76 virtual void startRecording();
77
78 //! Stop recording user commands.
79 virtual void endRecording();
80
81 private slots:
82 void record(unsigned int msg, unsigned long wParam, void *lParam);
83
84 private:
85 struct Macro {
86 unsigned int msg;
87 unsigned long wParam;
88 QByteArray text;
89 };
90
91 QsciScintilla *qsci;
92 QList<Macro> macro;
93
94 QsciMacro(const QsciMacro &);
95 QsciMacro &operator=(const QsciMacro &);
96 };
97
98 #endif