KDeclarative

clipboard.h
1 /*
2  SPDX-FileCopyrightText: 2014 Aleix Pol Gonzalez <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef CLIPBOARD_H
8 #define CLIPBOARD_H
9 
10 #include <QClipboard>
11 #include <QVariant>
12 
13 class ClipboardPrivate;
14 
15 class Clipboard : public QObject
16 {
17  Q_OBJECT
21  Q_PROPERTY(QClipboard::Mode mode READ mode WRITE setMode NOTIFY modeChanged)
22 
23 
26  Q_PROPERTY(QVariant content READ content WRITE setContent NOTIFY contentChanged)
27 
28 
31  Q_PROPERTY(QStringList formats READ formats NOTIFY contentChanged)
32 
33  public:
34  explicit Clipboard(QObject* parent = nullptr);
35 
36  QClipboard::Mode mode() const;
37  void setMode(QClipboard::Mode mode);
38 
39  Q_SCRIPTABLE QVariant contentFormat(const QString &format) const;
40  QVariant content() const;
41  void setContent(const QVariant &content);
42 
43  QStringList formats() const;
44 
45  Q_SCRIPTABLE void clear();
46 
47  Q_SIGNALS:
48  void modeChanged(QClipboard::Mode mode);
49  void contentChanged();
50 
51  private Q_SLOTS:
52  void clipboardChanged(QClipboard::Mode m);
53 
54  private:
55  QClipboard* m_clipboard;
56  QClipboard::Mode m_mode;
57 };
58 
59 #endif
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.