File indexing completed on 2025-01-18 10:07:57
0001
0002
0003
0004 #ifndef QCLIPBOARD_H
0005 #define QCLIPBOARD_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qobject.h>
0009
0010 QT_BEGIN_NAMESPACE
0011
0012
0013 #ifndef QT_NO_CLIPBOARD
0014
0015 class QMimeData;
0016 class QImage;
0017 class QPixmap;
0018
0019 class Q_GUI_EXPORT QClipboard : public QObject
0020 {
0021 Q_OBJECT
0022 private:
0023 explicit QClipboard(QObject *parent);
0024 ~QClipboard();
0025
0026 public:
0027 enum Mode { Clipboard, Selection, FindBuffer, LastMode = FindBuffer };
0028
0029 void clear(Mode mode = Clipboard);
0030
0031 bool supportsSelection() const;
0032 bool supportsFindBuffer() const;
0033
0034 bool ownsSelection() const;
0035 bool ownsClipboard() const;
0036 bool ownsFindBuffer() const;
0037
0038 QString text(Mode mode = Clipboard) const;
0039 QString text(QString& subtype, Mode mode = Clipboard) const;
0040 void setText(const QString &, Mode mode = Clipboard);
0041
0042 const QMimeData *mimeData(Mode mode = Clipboard ) const;
0043 void setMimeData(QMimeData *data, Mode mode = Clipboard);
0044
0045 QImage image(Mode mode = Clipboard) const;
0046 QPixmap pixmap(Mode mode = Clipboard) const;
0047 void setImage(const QImage &, Mode mode = Clipboard);
0048 void setPixmap(const QPixmap &, Mode mode = Clipboard);
0049
0050 Q_SIGNALS:
0051 void changed(QClipboard::Mode mode);
0052 void selectionChanged();
0053 void findBufferChanged();
0054 void dataChanged();
0055
0056 protected:
0057 friend class QApplication;
0058 friend class QApplicationPrivate;
0059 friend class QGuiApplication;
0060 friend class QBaseApplication;
0061 friend class QDragManager;
0062 friend class QPlatformClipboard;
0063
0064 private:
0065 Q_DISABLE_COPY(QClipboard)
0066
0067 bool supportsMode(Mode mode) const;
0068 bool ownsMode(Mode mode) const;
0069 void emitChanged(Mode mode);
0070 };
0071
0072 #endif
0073
0074 QT_END_NAMESPACE
0075
0076 #endif