3 * \file qt4/GuiClipboard.C
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
8 * \author Abdelrazak Younes
10 * Full author contact details are available in file CREDITS.
15 #include "GuiClipboard.h"
16 #include "qt_helpers.h"
20 #include <QApplication>
24 #include "support/lstrings.h"
25 using lyx::support::internalLineEnding;
26 using lyx::support::externalLineEnding;
33 docstring const GuiClipboard::get() const
35 QString const str = qApp->clipboard()->text(QClipboard::Clipboard);
36 lyxerr[Debug::ACTION] << "GuiClipboard::get: " << fromqstr(str)
41 return internalLineEnding(qstring_to_ucs4(str));
45 void GuiClipboard::put(docstring const & str)
47 lyxerr[Debug::ACTION] << "GuiClipboard::put: " << lyx::to_utf8(str) << endl;
49 qApp->clipboard()->setText(toqstr(externalLineEnding(str)),
50 QClipboard::Clipboard);
54 bool GuiClipboard::isInternal() const
56 return qApp->clipboard()->ownsClipboard();
59 } // namespace frontend