KWin
Loading...
Searching...
No Matches
clipboard.h
Go to the documentation of this file.
1/*
2 KWin - the KDE window manager
3 This file is part of the KDE project.
4
5 SPDX-FileCopyrightText: 2019 Roman Gilg <subdiff@gmail.com>
6
7 SPDX-License-Identifier: GPL-2.0-or-later
8*/
9#pragma once
10
11#include "selection.h"
12
13#include <memory>
14
15namespace KWin
16{
17
18class AbstractDataSource;
19
20namespace Xwl
21{
22class XwlDataSource;
23
28class Clipboard : public Selection
29{
30 Q_OBJECT
31
32public:
33 Clipboard(xcb_atom_t atom, QObject *parent);
34
35private:
36 void doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) override;
37 void x11OfferLost() override;
38 void x11OffersChanged(const QStringList &added, const QStringList &removed) override;
42 void wlSelectionChanged(AbstractDataSource *dsi);
47 void checkWlSource();
48
52 bool ownsSelection(AbstractDataSource *dsi) const;
53
54 QMetaObject::Connection m_checkConnection;
55
56 Q_DISABLE_COPY(Clipboard)
57 bool m_waitingForTargets = false;
58 std::unique_ptr<XwlDataSource> m_selectionSource;
59};
60
61} // namespace Xwl
62} // namespace KWin
The AbstractDataSource class abstracts the data that can be transferred to another client.
Clipboard(xcb_atom_t atom, QObject *parent)
Definition clipboard.cpp:29
xcb_atom_t atom() const
Definition selection.h:59