summaryrefslogtreecommitdiff
path: root/prototype_2016/third_party/fluid/core/clipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'prototype_2016/third_party/fluid/core/clipboard.cpp')
-rw-r--r--prototype_2016/third_party/fluid/core/clipboard.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/prototype_2016/third_party/fluid/core/clipboard.cpp b/prototype_2016/third_party/fluid/core/clipboard.cpp
new file mode 100644
index 0000000..79280d3
--- /dev/null
+++ b/prototype_2016/third_party/fluid/core/clipboard.cpp
@@ -0,0 +1,54 @@
1/*
2 * This file is part of Fluid.
3 *
4 * Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
5 * Copyright (C) 2017 Michael Spencer <sonrisesoftware@gmail.com>
6 *
7 * $BEGIN_LICENSE:MPL2$
8 *
9 * This Source Code Form is subject to the terms of the Mozilla Public
10 * License, v. 2.0. If a copy of the MPL was not distributed with this
11 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 *
13 * $END_LICENSE$
14 */
15
16#include "clipboard.h"
17
18#include <QGuiApplication>
19
20/*!
21 \qmltype Clipboard
22 \inqmlmodule Fluid.Core
23 \ingroup fluidcore
24
25 \brief Clipboard.
26*/
27
28Clipboard::Clipboard(QObject *parent)
29 : QObject(parent)
30 , m_clipboard(QGuiApplication::clipboard())
31{
32 connect(m_clipboard, &QClipboard::dataChanged, this, &Clipboard::textChanged);
33}
34
35/*!
36 \qmlproperty string Clipboard::text
37
38 This property holds the clipboard text.
39*/
40
41QString Clipboard::text() const
42{
43 return m_clipboard->text();
44}
45
46void Clipboard::clear()
47{
48 m_clipboard->clear();
49}
50
51void Clipboard::setText(const QString &text)
52{
53 m_clipboard->setText(text);
54}