7#include <QtGui/private/qinternalmimedata_p.h>
8#include <QtCore/qbytearraymatcher.h>
9#include <QtCore/qmap.h>
10#include <QtCore/qurl.h>
11#include <QtCore/qdir.h>
12#include <QtCore/qdebug.h>
13#include <QtCore/qbuffer.h>
14#include <QtGui/qimagereader.h>
15#include <QtGui/qimagewriter.h>
28#define BMP_LCS_sRGB 0x73524742
29#define BMP_LCS_GM_IMAGES 0x00000004L
71 msg +=
": Unable to convert DIB image. The image converter plugin for '";
73 msg +=
"' is not available. Available formats: ";
111 if (!
d->isWritable())
121 ZeroMemory(&bi,
sizeof(bi));
140 d->write(
reinterpret_cast<const char*
>(&bi), bi.
bV5Size);
161 memset(
buf, 0,
size_t(bpl_bmp));
162 for (
int y=
image.height()-1;
y>=0;
y--) {
164 const QRgb *
p =
reinterpret_cast<const QRgb *
>(
image.constScanLine(
y));
182 d->write(
reinterpret_cast<const char *
>(
buf), bpl_bmp);
196 return formatetc.cfFormat;
202 formatetc.cfFormat = CLIPFORMAT(cf);
203 formatetc.dwAspect = DVASPECT_CONTENT;
204 formatetc.lindex = -1;
205 formatetc.ptd =
nullptr;
206 formatetc.tymed = TYMED_HGLOBAL;
212 HGLOBAL hData = GlobalAlloc(0, SIZE_T(
data.size()));
216 void *
out = GlobalLock(hData);
219 pmedium->tymed = TYMED_HGLOBAL;
220 pmedium->hGlobal = hData;
221 pmedium->pUnkForRelease =
nullptr;
229 formatetc.lindex = lindex;
231 if (pDataObj->GetData(&formatetc, &
s) == S_OK) {
232 const void *
val = GlobalLock(
s.hGlobal);
235 GlobalUnlock(
s.hGlobal);
236 ReleaseStgMedium(&
s);
239 formatetc.tymed = TYMED_ISTREAM;
240 if (pDataObj->GetData(&formatetc, &
s) == S_OK) {
242 ULONG actualRead = 0;
243 LARGE_INTEGER
pos = {{0, 0}};
245 HRESULT hr =
s.pstm->Seek(
pos, STREAM_SEEK_SET,
nullptr);
246 while(SUCCEEDED(hr)){
247 hr =
s.pstm->Read(szBuffer,
sizeof(szBuffer), &actualRead);
248 if (SUCCEEDED(hr) && actualRead > 0) {
251 if (actualRead !=
sizeof(szBuffer))
255 ReleaseStgMedium(&
s);
264 if (pDataObj->QueryGetData(&formatetc) != S_OK){
265 formatetc.tymed = TYMED_ISTREAM;
266 return pDataObj->QueryGetData(&formatetc) == S_OK;
271#ifndef QT_NO_DEBUG_STREAM
276 d <<
"FORMATETC(cfFormat=" <<
tc.cfFormat <<
' ';
277 switch (
tc.cfFormat) {
297 d <<
"CF_UNICODETEXT";
300 d <<
"CF_ENHMETAFILE";
306 d <<
", dwAspect=" <<
tc.dwAspect <<
", lindex=" <<
tc.lindex
307 <<
", tymed=" <<
tc.tymed <<
", ptd=" <<
tc.ptd <<
')';
318 IEnumFORMATETC *enumFormatEtc;
319 if (SUCCEEDED(dataObj->EnumFormatEtc(DATADIR_GET, &enumFormatEtc)) && enumFormatEtc) {
322 if (SUCCEEDED(enumFormatEtc->Reset())) {
323 while (SUCCEEDED(enumFormatEtc->Next(1, formatEtc, &fetched)) && fetched)
324 d << formatEtc[0] <<
',';
325 enumFormatEtc->Release();
349 int cf =
getCf(formatetc);
350 return (cf == CF_UNICODETEXT || (cf == CF_TEXT && GetACP() != CP_UTF8)) &&
mimeData->
hasText();
362 int cf =
getCf(formatetc);
369 const char*
d =
data.data();
370 const int s =
data.size();
373 for (
int i=0;
i<
s;
i++) {
385 if (
j+3 >= maxsize) {
386 maxsize += maxsize/4;
394 if (cf == CF_UNICODETEXT) {
399 int maxsize =
s +
s/40 + 3;
403 for (
int i=0;
i <
s; ++
i) {
407 if (*u == u
'\n' && !cr)
412 if (ri+3 >= maxsize) {
413 maxsize += maxsize/4;
419 const int byteLength =
res.length() * int(
sizeof(
ushort));
421 memcpy(
r.data(),
res.unicode(),
size_t(byteLength));
432 return mimeType.startsWith(u
"text/plain")
439 int cf =
getCf(formatetc);
440 if (cf == CF_UNICODETEXT || cf == CF_TEXT)
441 return u
"text/plain"_s;
450 formatics +=
setCf(CF_UNICODETEXT);
451 if (GetACP() != CP_UTF8)
452 formatics +=
setCf(CF_TEXT);
464 if (!
data.isEmpty()) {
469 if (!
data.isEmpty()) {
470 const char*
d =
data.data();
475 for (
unsigned i = 0;
i <
s; ++
i) {
484 if (preferredType.
id() == QMetaType::QString)
487 ret = std::move(
str).toUtf8();
529 if (
getCf(formatetc) == CF_HDROP) {
532 size_t size =
sizeof(DROPFILES) + 2;
542 auto*
d =
reinterpret_cast<DROPFILES *
>(
result.data());
543 d->pFiles =
sizeof(DROPFILES);
544 GetCursorPos(&
d->pt);
546 char *
files = (
reinterpret_cast<char*
>(
d)) +
d->pFiles;
549 auto *
f =
reinterpret_cast<wchar_t *
>(
files);
551 const auto l = size_t(
fileNames.at(
i).length());
560 if (
getCf(formatetc) == CF_INETURL_W) {
563 if (!urls.isEmpty()) {
572 if (
getCf(formatetc) == CF_INETURL) {
576 result = urls.at(0).toString().toLocal8Bit();
593 if (
getCf(formatetc) == CF_HDROP ||
getCf(formatetc) == CF_INETURL_W ||
getCf(formatetc) == CF_INETURL)
594 format = u
"text/uri-list"_s;
603 formatics +=
setCf(CF_HDROP);
605 formatics +=
setCf(CF_INETURL_W);
607 formatics +=
setCf(CF_INETURL);
622 const auto *hdrop =
reinterpret_cast<const DROPFILES *
>(
data.constData());
624 const auto *filesw =
reinterpret_cast<const wchar_t *
>(
data.constData() + hdrop->pFiles);
632 const char*
files =
reinterpret_cast<const char *
>(
data.constData() + hdrop->pFiles);
640 if (preferredType.
id() == QMetaType::QUrl && urls.
size() == 1)
644 }
else if (
canGetData(CF_INETURL_W, pDataObj)) {
649 }
else if (
canGetData(CF_INETURL, pDataObj)) {
687 formatetcs +=
setCf(CF_HTML);
693 if (
getCf(formatetc) == CF_HTML)
694 return u
"text/html"_s;
729 qCDebug(lcQpaMime) << __FUNCTION__ <<
"raw:" << html;
730 int start = startMatcher.indexIn(html);
731 int end = endMatcher.indexIn(html);
734 int startOffset =
start + 10;
736 while (html.
at(
i) !=
'\r' && html.
at(
i) !=
'\n')
743 int endOffset =
end + 8;
745 while (html.
at(
i) !=
'\r' && html.
at(
i) !=
'\n')
766 "StartHTML:0000000107\r\n"
767 "EndHTML:0000000000\r\n"
768 "StartFragment:0000000000\r\n"
769 "EndFragment:0000000000\r\n\r\n";
774 if (startFragmentMatcher.indexIn(
data) == -1)
775 result +=
"<!--StartFragment-->";
777 if (endFragmentMatcher.indexIn(
data) == -1)
778 result +=
"<!--EndFragment-->";
782 memcpy(
reinterpret_cast<char *
>(
result.data() + 53 -
pos.length()),
pos.constData(),
size_t(
pos.length()));
786 memcpy(
reinterpret_cast<char *
>(
result.data() + 79 -
pos.length()),
pos.constData(),
size_t(
pos.length()));
788 memcpy(
reinterpret_cast<char *
>(
result.data() + 103 -
pos.length()),
pos.constData(),
size_t(
pos.length()));
796#ifndef QT_NO_IMAGEFORMAT_BMP
811 bool hasOriginalDIBV5(IDataObject *pDataObj)
const;
817 CF_PNG = RegisterClipboardFormat(L
"PNG");
826 if (!
image.isNull() &&
image.hasAlphaChannel())
827 formatetcs +=
setCf(CF_DIBV5);
828 formatetcs +=
setCf(CF_DIB);
837 int cf =
getCf(formatetc);
838 if (cf == CF_DIB || cf == CF_DIBV5 || cf ==
int(CF_PNG))
839 return u
"application/x-qt-image"_s;
845 return mimeType == u
"application/x-qt-image"
851 int cf =
getCf(formatetc);
859 return cf == CF_DIBV5 || cf == CF_DIB
860 || (cf == int(CF_PNG) &&
image.hasAlphaChannel());
865 int cf =
getCf(formatetc);
866 if ((cf == CF_DIB || cf == CF_DIBV5 || cf ==
int(CF_PNG)) &&
mimeData->
hasImage()) {
877 }
else if (cf ==
int(CF_PNG)) {
893bool QWindowsMimeImage::hasOriginalDIBV5(IDataObject *pDataObj)
const
895 bool isSynthesized =
true;
896 IEnumFORMATETC *pEnum =
nullptr;
897 HRESULT res = pDataObj->EnumFormatEtc(1, &pEnum);
898 if (
res == S_OK && pEnum) {
900 while ((
res = pEnum->Next(1, &fc,
nullptr)) == S_OK) {
902 CoTaskMemFree(fc.ptd);
903 if (fc.cfFormat == CF_DIB)
905 if (fc.cfFormat == CF_DIBV5) {
906 isSynthesized =
false;
912 return !isSynthesized;
919 if (
mimeType != u
"application/x-qt-image")
923 const bool canGetDibV5 =
canGetData(CF_DIBV5, pDataObj);
924 const bool hasOrigDibV5 = canGetDibV5 ? hasOriginalDIBV5(pDataObj) :
false;
925 qCDebug(lcQpaMime) <<
"canGetDibV5:" << canGetDibV5 <<
"hasOrigDibV5:" << hasOrigDibV5;
927 qCDebug(lcQpaMime) <<
"Decoding DIBV5";
936 qCDebug(lcQpaMime) <<
"Decoding PNG";
939 if (
img.loadFromData(
data,
"PNG")) {
945 qCDebug(lcQpaMime) <<
"Decoding DIB";
987 return formatetc.tymed & TYMED_HGLOBAL
988 && outFormats.
contains(formatetc.cfFormat)
996 if (outFormats.
value(
getCf(formatetc)) == u
"text/html") {
1003 int maxsize =
s +
s/40 + 3;
1004 res.resize(maxsize);
1007 for (
int i=0;
i <
s; ++
i) {
1011 if (*u == u
'\n' && !cr)
1016 if (ri+3 >= maxsize) {
1017 maxsize += maxsize/4;
1018 res.resize(maxsize);
1023 const int byteLength =
res.length() * int(
sizeof(
ushort));
1025 memcpy(
r.data(),
res.unicode(),
size_t(byteLength));
1027 r[byteLength+1] = 0;
1030#if QT_CONFIG(draganddrop)
1044 formatetcs +=
setCf(mit.key());
1051 return mit != inFormats.
cend() &&
canGetData(mit.key(), pDataObj);
1059 if (!
data.isEmpty()) {
1060 qCDebug(lcQpaMime) << __FUNCTION__;
1061 if (
mimeType == u
"text/html" && preferredType ==
QMetaType(QMetaType::QString)) {
1105 if (ianaTypes.isEmpty()) {
1106 ianaTypes.append(u
"application/"_s);
1107 ianaTypes.append(u
"audio/"_s);
1108 ianaTypes.append(u
"example/"_s);
1109 ianaTypes.append(u
"image/"_s);
1110 ianaTypes.append(u
"message/"_s);
1111 ianaTypes.append(u
"model/"_s);
1112 ianaTypes.append(u
"multipart/"_s);
1113 ianaTypes.append(u
"text/"_s);
1114 ianaTypes.append(u
"video/"_s);
1117 if (excludeList.isEmpty()) {
1118 excludeList.append(u
"HTML Format"_s);
1119 excludeList.append(u
"UniformResourceLocator"_s);
1120 excludeList.append(u
"text/html"_s);
1121 excludeList.append(u
"text/plain"_s);
1122 excludeList.append(u
"text/uri-list"_s);
1123 excludeList.append(u
"application/x-qt-image"_s);
1124 excludeList.append(u
"application/x-color"_s);
1131#if QT_CONFIG(draganddrop)
1132 return formatetc.tymed & TYMED_HGLOBAL
1133 && (
formats.contains(formatetc.cfFormat)
1138 return formatetc.tymed & TYMED_HGLOBAL
1139 &&
formats.contains(formatetc.cfFormat);
1145#if QT_CONFIG(draganddrop)
1164 formatetcs +=
setCf(mit.key());
1183 const int beginPos =
mimeType.indexOf(u
";index=");
1184 if (beginPos > -1) {
1185 const int endPos =
mimeType.indexOf(u
';', beginPos + 1);
1186 const int indexStartPos = beginPos + 7;
1201 const UINT cf = RegisterClipboardFormat(
reinterpret_cast<const wchar_t *
> (clipFormat.
utf16()));
1219 const UINT cf = RegisterClipboardFormat(
reinterpret_cast<const wchar_t *
> (clipFormat.
utf16()));
1226 if (!
data.isEmpty())
1240#if QT_CONFIG(draganddrop)
1243 else if ((formatetc.cfFormat >= 0xC000)){
1247 bool ianaType =
false;
1248 int sz = ianaTypes.size();
1249 for (
int i = 0;
i < sz;
i++) {
1283 ensureInitialized();
1284 for (
int i = m_mimes.
size()-1;
i >= 0; --
i) {
1286 return m_mimes.
at(
i);
1293 qCDebug(lcQpaMime) <<
"QWindowsMimeConverter::allMimesForFormats()";
1294 ensureInitialized();
1296 LPENUMFORMATETC FAR fmtenum;
1297 HRESULT hr = pDataObj->EnumFormatEtc(DATADIR_GET, &fmtenum);
1299 if (hr == NOERROR) {
1301 while (S_OK == fmtenum->Next(1, &fmtetc,
nullptr)) {
1302 for (
int i= m_mimes.
size() - 1;
i >= 0; --
i) {
1312 CoTaskMemFree(fmtetc.ptd);
1322 ensureInitialized();
1323 qCDebug(lcQpaMime) << __FUNCTION__ << formatetc;
1324 for (
int i = m_mimes.
size()-1;
i >= 0; --
i) {
1326 return m_mimes.
at(
i);
1333 ensureInitialized();
1335#if !QT_CONFIG(draganddrop)
1341 for (
int i = m_mimes.
size() - 1;
i >= 0; --
i)
1348void QWindowsMimeRegistry::ensureInitialized()
const
1350 if (m_internalMimeCount == 0) {
1351 m_internalMimeCount = -1;
1352#ifndef QT_NO_IMAGEFORMAT_BMP
1360 m_internalMimeCount = m_mimes.
size();
1367 wchar_t buf[256] = {0};
1368 return GetClipboardFormatName(UINT(cf),
buf, 255)
1373 IDataObject *pDataObj,
1379 if (converter->canConvertToMime(
format, pDataObj)) {
1380 const QVariant dataV = converter->convertToMime(
format, pDataObj, preferredType);
1382 qCDebug(lcQpaMime) << __FUNCTION__ << mimeTypes <<
"\nFormat: "
1383 <<
format << pDataObj <<
" returns " << dataV;
1391 qCDebug(lcQpaMime) << __FUNCTION__ <<
"fails" << mimeTypes << pDataObj << preferredType.
id();
1397 ensureInitialized();
1411 const UINT
f = RegisterClipboardFormat(
reinterpret_cast<const wchar_t *
> (
mimeType.utf16()));
1413 qErrnoWarning(
"QWindowsMimeRegistry::registerMimeType: Failed to register clipboard format "
\inmodule QtCore \reentrant
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QMetaType preferredType) const override
Returns a QVariant containing the converted data for mimeType from pDataObj.
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
char at(qsizetype i) const
Returns the byte at index position i in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
void clear()
Clears the contents of the byte array and makes it null.
QByteArray mid(qsizetype index, qsizetype len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
QByteArray & replace(qsizetype index, qsizetype len, const char *s, qsizetype alen)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore\reentrant
static QString toNativeSeparators(const QString &pathName)
\inmodule QtCore \reentrant
The QImageReader class provides a format independent interface for reading images from files or other...
bool canRead() const
Returns true if an image can be read for the device (i.e., the image format is supported,...
static QList< QByteArray > supportedImageFormats()
Returns the list of image formats supported by QImageReader.
QImage read()
Reads an image from the device.
The QImageWriter class provides a format independent interface for writing images to files or other d...
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
bool canWrite() const
Returns true if QImageWriter can write the image; i.e., the image format is supported and the assigne...
static bool hasFormatHelper(const QString &mimeType, const QMimeData *data)
static QByteArray renderDataHelper(const QString &mimeType, const QMimeData *data)
static bool canReadData(const QString &mimeType)
static QStringList formatsHelper(const QMimeData *data)
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QMetaType preferredType) const override
Returns a QVariant containing the converted data for mimeType from pDataObj.
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
bool contains(const Key &key) const
const_iterator cend() const
const_iterator cbegin() const
Key key(const T &value, const Key &defaultKey=Key()) const
bool hasUrls() const
Returns true if the object can return a list of urls; otherwise returns false.
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
bool hasText() const
Returns true if the object can return plain text (MIME type text/plain); otherwise returns false.
QString html() const
Returns a string if the data stored in the object is HTML (MIME type text/html); otherwise returns an...
QList< QUrl > urls() const
Returns a list of URLs contained within the MIME data object.
virtual QStringList formats() const
Returns a list of formats supported by the object.
QString text() const
Returns a plain text (MIME type text/plain) representation of the data.
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString & replace(qsizetype i, qsizetype len, QChar after)
const ushort * utf16() const
Returns the QString as a '\0\'-terminated array of unsigned shorts.
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QByteArray toLocal8Bit() const &
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
QByteArray toUtf8() const &
qsizetype length() const
Returns the number of characters in this string.
const QChar * unicode() const
Returns a Unicode representation of the string.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
QString toLocalFile() const
Returns the path of this URL formatted as a local file path.
bool isValid() const
Returns true if the storage type of this variant is not QMetaType::UnknownType; otherwise returns fal...
The QWindowsMimeConverter class maps open-standard MIME to Window Clipboard formats.
virtual QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const =0
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
virtual bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const =0
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
static int registerMimeType(const QString &mimeType)
Registers the MIME type mimeType, and returns an ID number identifying the format on Windows.
virtual QString mimeForFormat(const FORMATETC &formatetc) const =0
Returns the mime type that will be created form the format specified in formatetc,...
virtual bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const =0
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QMetaType preferredType) const override
Returns a QVariant containing the converted data for mimeType from pDataObj.
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
QVariant convertToMime(const QString &mime, IDataObject *pDataObj, QMetaType preferredType) const override
Returns a QVariant containing the converted data for mimeType from pDataObj.
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
static int registerMimeType(const QString &mime)
Registers the MIME type mime, and returns an ID number identifying the format on Windows.
static QString clipboardFormatName(int cf)
QVariant convertToMime(const QStringList &mimeTypes, IDataObject *pDataObj, QMetaType preferredType, QString *format=nullptr) const
QWindowsMimeConverter * converterFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const
void registerMime(QWindowsMimeConverter *mime)
QStringList allMimesForFormats(IDataObject *pDataObj) const
QList< FORMATETC > allFormatsForMime(const QMimeData *mimeData) const
QWindowsMimeConverter QWindowsMimeConverter
QWindowsMimeConverter * converterToMime(const QString &mimeType, IDataObject *pDataObj) const
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
QVariant convertToMime(const QString &mime, LPDATAOBJECT pDataObj, QMetaType preferredType) const override
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
QList< FORMATETC > formatsForMime(const QString &mimeType, const QMimeData *mimeData) const override
Returns a QList of FORMATETC structures representing the different windows clipboard formats that can...
QString mimeForFormat(const FORMATETC &formatetc) const override
Returns the mime type that will be created form the format specified in formatetc,...
bool canConvertToMime(const QString &mimeType, IDataObject *pDataObj) const override
Returns true if the converter can convert to the mimeType from the available formats in pDataObj.
QVariant convertToMime(const QString &mime, LPDATAOBJECT pDataObj, QMetaType preferredType) const override
bool canConvertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData) const override
Returns true if the converter can convert from the mimeData to the format specified in formatetc.
bool convertFromMime(const FORMATETC &formatetc, const QMimeData *mimeData, STGMEDIUM *pmedium) const override
Convert the mimeData to the format specified in formatetc.
qDeleteAll(list.begin(), list.end())
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
size_t qstrlen(const char *str)
constexpr QStaticByteArrayMatcher< N > qMakeStaticByteArrayMatcher(const char(&pattern)[N]) noexcept
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
#define qCDebug(category,...)
GLboolean GLboolean GLboolean b
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat alpha
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr int qBlue(QRgb rgb)
constexpr int qAlpha(QRgb rgb)
#define qPrintable(string)
static int toInt(const QChar &qc, int R)
#define BMP_LCS_GM_IMAGES
static QByteArray msgConversionError(const char *func, const char *format)
static bool canGetData(int cf, IDataObject *pDataObj)
static FORMATETC setCf(int cf)
static bool isCustomMimeType(const QString &mimeType)
static QByteArray writeDib(const QImage &img)
static QByteArray getData(int cf, IDataObject *pDataObj, int lindex=-1)
static QString customMimeType(const QString &mimeType, int *lindex=nullptr)
static bool readDib(QBuffer &buffer, QImage &img)
QDebug operator<<(QDebug d, const FORMATETC &tc)
static const char dibFormatC[]
static const char x_qt_windows_mime[]
static bool qt_write_dibv5(QDataStream &s, QImage image)
static int getCf(const FORMATETC &formatetc)
static bool setData(const QByteArray &data, STGMEDIUM *pmedium)
QTextStream out(stdout)
[7]
QUrl url("example.com")
[constructor-url-reference]
application x qt windows mime
[2]