4#if !defined(QT_NO_CLIPBOARD)
20 be_clipboard->StartWatching(BMessenger(
this));
26 be_clipboard->StopWatching(BMessenger(
this));
28 delete m_userMimeData;
29 delete m_systemMimeData;
38 return m_userMimeData;
40 if (!be_clipboard->Lock())
43 if (!m_systemMimeData)
46 m_systemMimeData->
clear();
48 const BMessage *clipboard = be_clipboard->Data();
54 for (
int i = 0; clipboard->GetInfo(B_MIME_TYPE,
i, &
name, &
type, &
count) == B_OK;
i++) {
55 const void *
data =
nullptr;
58 const status_t status = clipboard->FindData(
name, B_MIME_TYPE, &
data, &dataLen);
59 if (dataLen && (status == B_OK)) {
61 if (
format ==
"text/plain"_L1) {
63 }
else if (
format ==
"text/html"_L1) {
72 be_clipboard->Unlock();
74 return m_systemMimeData;
90 if (!be_clipboard->Lock())
93 be_clipboard->Clear();
95 BMessage *clipboard = be_clipboard->Data();
100 clipboard->AddData(
format.toUtf8(), B_MIME_TYPE,
data,
data.count());
105 if (be_clipboard->Commit() != B_OK)
106 qWarning(
"Unable to store mime data on clipboard");
108 be_clipboard->Unlock();
129 if (
message->what == B_CLIPBOARD_CHANGED) {
130 delete m_userMimeData;
131 m_userMimeData =
nullptr;
136 BHandler::MessageReceived(
message);
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
Mode
\keyword clipboard mode
bool ownsMode(QClipboard::Mode mode) const override
bool supportsMode(QClipboard::Mode mode) const override
QMimeData * mimeData(QClipboard::Mode mode=QClipboard::Clipboard) override
void MessageReceived(BMessage *message) override
void setMimeData(QMimeData *data, QClipboard::Mode mode=QClipboard::Clipboard) override
void setHtml(const QString &html)
Sets html as the HTML (MIME type text/html) used to represent the data.
void setData(const QString &mimetype, const QByteArray &data)
Sets the data associated with the MIME type given by mimeType to the specified data.
void setText(const QString &text)
Sets text as the plain text (MIME type text/plain) used to represent the data.
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType.
void clear()
Removes all the MIME type and data entries in the object.
virtual QStringList formats() const
Returns a list of formats supported by the object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
#define Q_FOREACH(variable, container)
GLenum GLenum GLsizei count
GLuint GLsizei const GLchar * message
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format