Changeset View
Changeset View
Standalone View
Standalone View
src/script/katescripteditor.h
- This file was added.
1 | /* This file is part of the KDE libraries. | ||||
---|---|---|---|---|---|
2 | * | ||||
3 | * Copyright (C) 2017 Dominik Haumann <dhaumann@kde.org> | ||||
4 | * | ||||
5 | * This library is free software; you can redistribute it and/or | ||||
6 | * modify it under the terms of the GNU Library General Public | ||||
7 | * License as published by the Free Software Foundation; either | ||||
8 | * version 2 of the License, or (at your option) any later version. | ||||
9 | * | ||||
10 | * This library is distributed in the hope that it will be useful, | ||||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||||
13 | * Library General Public License for more details. | ||||
14 | * | ||||
15 | * You should have received a copy of the GNU Library General Public License | ||||
16 | * along with this library; see the file COPYING.LIB. If not, write to | ||||
17 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||||
18 | * Boston, MA 02110-1301, USA. | ||||
19 | */ | ||||
20 | #ifndef KATE_SCRIPT_EDITOR_H | ||||
21 | #define KATE_SCRIPT_EDITOR_H | ||||
22 | | ||||
23 | #include <QObject> | ||||
24 | #include <QJSValue> | ||||
25 | | ||||
26 | #include <ktexteditor_export.h> | ||||
27 | | ||||
28 | namespace KTextEditor { class ViewPrivate; } | ||||
29 | class QJSEngine; | ||||
30 | | ||||
31 | /** | ||||
32 | * This class wraps the global editor instance KateGlobal, exposing some | ||||
33 | * helper methods such as the clipboard history etc. | ||||
34 | */ | ||||
35 | class KTEXTEDITOR_EXPORT KateScriptEditor : public QObject | ||||
36 | { | ||||
37 | Q_OBJECT | ||||
38 | | ||||
39 | public: | ||||
40 | KateScriptEditor(QJSEngine *engine, QObject *parent = nullptr); | ||||
41 | | ||||
42 | Q_INVOKABLE QString clipboardText() const; | ||||
43 | Q_INVOKABLE QStringList clipboardHistory() const; | ||||
44 | Q_INVOKABLE void setClipboardText(const QString &text); | ||||
45 | | ||||
46 | private: | ||||
47 | QJSEngine *m_engine = nullptr; | ||||
48 | }; | ||||
49 | | ||||
50 | #endif |