1 /*
2  * DQt - D bindings for the Qt Toolkit
3  *
4  * GNU Lesser General Public License Usage
5  * This file may be used under the terms of the GNU Lesser
6  * General Public License version 3 as published by the Free Software
7  * Foundation and appearing in the file LICENSE.LGPL3 included in the
8  * packaging of this file. Please review the following information to
9  * ensure the GNU Lesser General Public License version 3 requirements
10  * will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
11  */
12 module qt.gui.clipboard;
13 extern(C++):
14 
15 import qt.config;
16 import qt.helpers;
17 version(QT_NO_CLIPBOARD){}else
18 {
19     import qt.core.mimedata;
20     import qt.core.object;
21     import qt.core.string;
22     import qt.gui.image;
23     import qt.gui.pixmap;
24 }
25 
26 version(QT_NO_CLIPBOARD){}else
27 {
28 
29 
30 /// Binding for C++ class [QClipboard](https://doc.qt.io/qt-6/qclipboard.html).
31 class /+ Q_GUI_EXPORT +/ QClipboard : QObject
32 {
33     mixin(Q_OBJECT);
34 private:
35     /+ explicit +/this(QObject parent);
36     ~this();
37 
38 public:
39     enum Mode { Clipboard, Selection, FindBuffer, LastMode = Mode.FindBuffer }
40 
41     final void clear(Mode mode = Mode.Clipboard);
42 
43     final bool supportsSelection() const;
44     final bool supportsFindBuffer() const;
45 
46     final bool ownsSelection() const;
47     final bool ownsClipboard() const;
48     final bool ownsFindBuffer() const;
49 
50     final QString text(Mode mode = Mode.Clipboard) const;
51     final QString text(ref QString subtype, Mode mode = Mode.Clipboard) const;
52     final void setText(ref const(QString) , Mode mode = Mode.Clipboard);
53 
54     mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{
55     final const(QMimeData) mimeData(Mode mode = Mode.Clipboard ) const;
56     }));
57     final void setMimeData(QMimeData data, Mode mode = Mode.Clipboard);
58 
59     final QImage image(Mode mode = Mode.Clipboard) const;
60     final QPixmap pixmap(Mode mode = Mode.Clipboard) const;
61     final void setImage(ref const(QImage) , Mode mode  = Mode.Clipboard);
62     final void setPixmap(ref const(QPixmap) , Mode mode  = Mode.Clipboard);
63 
64 /+ Q_SIGNALS +/public:
65     @QSignal final void changed(Mode mode);
66     @QSignal final void selectionChanged();
67     @QSignal final void findBufferChanged();
68     @QSignal final void dataChanged();
69 
70 protected:
71     /+ friend class QApplication; +/
72     /+ friend class QApplicationPrivate; +/
73     /+ friend class QGuiApplication; +/
74     /+ friend class QBaseApplication; +/
75     /+ friend class QDragManager; +/
76     /+ friend class QPlatformClipboard; +/
77 
78 private:
79     /+ Q_DISABLE_COPY(QClipboard) +/
80 
81     final bool supportsMode(Mode mode) const;
82     final bool ownsMode(Mode mode) const;
83     final void emitChanged(Mode mode);
84     mixin(CREATE_CONVENIENCE_WRAPPERS);
85 }
86 
87 }
88