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:378
static KTextEditor::EditorPrivate * self()
Kate Part Internal stuff ;)
QString text(QClipboard::Mode mode) const const
QClipboard * clipboard()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Feb 24 2024 20:00:58 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.