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