KTextEditor

katescripteditor.cpp
1/*
2 SPDX-FileCopyrightText: 2017 Dominik Haumann <dhaumann@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "katescripteditor.h"
8
9#include "kateglobal.h"
10
11#include <QApplication>
12#include <QClipboard>
13#include <QJSEngine>
14
15QString KateScriptEditor::clipboardText() const
16{
17 return QApplication::clipboard()->text();
18}
19
20QStringList KateScriptEditor::clipboardHistory() const
21{
22 const auto clipboardHistory = KTextEditor::EditorPrivate::self()->clipboardHistory();
23
24 QStringList res;
25 for (const auto &entry : clipboardHistory) {
26 res << entry.text;
27 }
28
29 return res;
30}
31
32void KateScriptEditor::setClipboardText(const QString &text)
33{
35}
36
37#include "moc_katescripteditor.cpp"
void copyToClipboard(const QString &text, const QString &fileName)
Copy text to clipboard an remember it in the history.
const QList< ClipboardEntry > & clipboardHistory() const
Clipboard history, filled with text we ever copied to clipboard via copyToClipboard.
Definition kateglobal.h:365
static KTextEditor::EditorPrivate * self()
Kate Part Internal stuff ;)
QString text(Mode mode) const const
QClipboard * clipboard()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.