46 #ifndef USE_INTERNET_CONFIG 52 # include <sys/types.h> 53 # include <sys/stat.h> 54 # include <sys/fcntl.h> 69 #include <private/qt_mac_p.h> 73 #include <QuickTime/QuickTime.h> 111 (*globalDraggedTypesList()) +=
types;
116 return (*globalDraggedTypesList());
182 globalMimeList()->append(
this);
192 globalMimeList()->removeAll(
this);
242 qWarning(
"QMacPasteboardMimeAny: Cannot handle multiple member data");
333 return QLatin1String(
"com.apple.traditional-mac-plain-text");
339 if (flav ==
QLatin1String(
"com.apple.traditional-mac-plain-text"))
352 qWarning(
"QMacPasteboardMimePlainText: Cannot handle multiple member data");
356 QCFString str(CFStringCreateWithBytes(kCFAllocatorDefault,
357 reinterpret_cast<const UInt8 *>(firstData.
constData()),
358 firstData.
size(), CFStringGetSystemEncoding(),
false));
371 ret.
append(
string.toLatin1());
426 qWarning(
"QMacPasteboardMimeUnicodeText: Cannot handle multiple member data");
431 QCFString str(CFStringCreateWithBytes(kCFAllocatorDefault,
432 reinterpret_cast<const UInt8 *>(firstData.
constData()),
433 firstData.
size(), CFStringGetSystemEncoding(),
false));
435 }
else if (flavor ==
QLatin1String(
"public.utf16-plain-text")) {
449 ret.
append(
string.toUtf8());
495 if (data.
count() > 1)
496 qWarning(
"QMacPasteboardMimeHTMLText: Cannot handle multiple member data");
514 typedef ComponentResult (*PtrGraphicsImportSetDataHandle)(GraphicsImportComponent, Handle);
515 typedef ComponentResult (*PtrGraphicsImportCreateCGImage)(GraphicsImportComponent,
CGImageRef*, UInt32);
516 typedef ComponentResult (*PtrGraphicsExportSetInputCGImage)(GraphicsExportComponent,
CGImageRef);
517 typedef ComponentResult (*PtrGraphicsExportSetOutputHandle)(GraphicsExportComponent, Handle);
518 typedef ComponentResult (*PtrGraphicsExportDoExport)(GraphicsExportComponent,
unsigned long *);
520 static PtrGraphicsImportSetDataHandle ptrGraphicsImportSetDataHandle = 0;
521 static PtrGraphicsImportCreateCGImage ptrGraphicsImportCreateCGImage = 0;
522 static PtrGraphicsExportSetInputCGImage ptrGraphicsExportSetInputCGImage = 0;
523 static PtrGraphicsExportSetOutputHandle ptrGraphicsExportSetOutputHandle = 0;
524 static PtrGraphicsExportDoExport ptrGraphicsExportDoExport = 0;
526 static bool resolveMimeQuickTimeSymbols()
528 static bool triedResolve =
false;
531 ptrGraphicsImportSetDataHandle =
reinterpret_cast<PtrGraphicsImportSetDataHandle
>(library.
resolve(
"GraphicsImportSetDataHandle"));
532 ptrGraphicsImportCreateCGImage =
reinterpret_cast<PtrGraphicsImportCreateCGImage
>(library.
resolve(
"GraphicsImportCreateCGImage"));
533 ptrGraphicsExportSetInputCGImage =
reinterpret_cast<PtrGraphicsExportSetInputCGImage
>(library.
resolve(
"GraphicsExportSetInputCGImage"));
534 ptrGraphicsExportSetOutputHandle =
reinterpret_cast<PtrGraphicsExportSetOutputHandle
>(library.
resolve(
"GraphicsExportSetOutputHandle"));
535 ptrGraphicsExportDoExport =
reinterpret_cast<PtrGraphicsExportDoExport
>(library.
resolve(
"GraphicsExportDoExport"));
539 return ptrGraphicsImportSetDataHandle != 0
540 && ptrGraphicsImportCreateCGImage != 0 && ptrGraphicsExportSetInputCGImage != 0
541 && ptrGraphicsExportSetOutputHandle != 0 && ptrGraphicsExportDoExport != 0;
556 QString QMacPasteboardMimePict::convertorName()
575 bool QMacPasteboardMimePict::canConvert(
const QString &mime,
QString flav)
585 qWarning(
"QMacPasteboardMimePict: Cannot handle multiple member data");
587 if (!resolveMimeQuickTimeSymbols())
595 Handle pic = NewHandle(a.
size() + 512);
598 GraphicsImportComponent graphicsImporter;
599 ComponentResult result = OpenADefaultComponent(GraphicsImporterComponentType,
600 kQTFileTypePicture, &graphicsImporter);
603 result = ptrGraphicsImportSetDataHandle(graphicsImporter, pic);
605 result = ptrGraphicsImportCreateCGImage(graphicsImporter, &cgImage,
606 kGraphicsImportCreateCGImageUsingCurrentSettings);
609 CloseComponent(graphicsImporter);
618 if (!resolveMimeQuickTimeSymbols())
624 Handle pic = NewHandle(0);
625 GraphicsExportComponent graphicsExporter;
626 ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType,
627 kQTFileTypePicture, &graphicsExporter);
629 unsigned long sizeWritten;
630 result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage);
632 result = ptrGraphicsExportSetOutputHandle(graphicsExporter, pic);
634 result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten);
636 CloseComponent(graphicsExporter);
639 int size = GetHandleSize((Handle)pic);
641 QByteArray ar(reinterpret_cast<char *>(*pic + 512), size - 512);
689 qWarning(
"QMacPasteboardMimeTiff: Cannot handle multiple member data");
696 reinterpret_cast<const UInt8 *>(a.
constData()),
697 a.
size(), kCFAllocatorNull);
699 image = CGImageSourceCreateImageAtIndex(imageSource, 0, 0);
714 #if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4) 718 if (imageDestination != 0) {
722 keys[0] = kCGImagePropertyPixelWidth;
723 keys[1] = kCGImagePropertyPixelHeight;
724 int width = img.
width();
725 int height = img.
height();
726 values[0] = CFNumberCreate(0, kCFNumberIntType, &width);
727 values[1] = CFNumberCreate(0, kCFNumberIntType, &height);
728 options = CFDictionaryCreate(0, reinterpret_cast<const void **>(keys),
729 reinterpret_cast<const void **>(values), 2,
730 &kCFTypeDictionaryKeyCallBacks,
731 &kCFTypeDictionaryValueCallBacks);
732 CGImageDestinationAddImage(imageDestination, cgimage, options);
733 CGImageDestinationFinalize(imageDestination);
737 CFRangeMake(0, ar.
size()),
738 reinterpret_cast<UInt8 *>(ar.
data()));
744 Handle tiff = NewHandle(0);
745 if (resolveMimeQuickTimeSymbols()) {
746 GraphicsExportComponent graphicsExporter;
747 ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType,
748 kQTFileTypeTIFF, &graphicsExporter);
750 unsigned long sizeWritten;
751 result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage);
753 result = ptrGraphicsExportSetOutputHandle(graphicsExporter, tiff);
755 result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten);
757 CloseComponent(graphicsExporter);
760 int size = GetHandleSize((Handle)tiff);
761 QByteArray ar(reinterpret_cast<char *>(*tiff), size);
790 return QCFString(UTTypeCreatePreferredIdentifierForTag(kUTTagClassOSType, CFSTR(
"furl"), 0));
796 if (flav ==
QCFString(UTTypeCreatePreferredIdentifierForTag(kUTTagClassOSType, CFSTR(
"furl"), 0)))
804 && flav ==
QCFString(UTTypeCreatePreferredIdentifierForTag(kUTTagClassOSType, CFSTR(
"furl"), 0));
812 for(
int i = 0; i < data.
size(); ++i) {
828 for(
int i = 0; i < urls.
size(); ++i) {
885 for (
int i=0; i<data.
size(); ++i) {
902 for(
int i=0; i<urls.
size(); ++i) {
957 for (
int i=0; i<data.
size(); ++i)
978 int registerMimeType(
const QString &mime);
979 bool loadMimeRegistry();
983 current_max =
'QT00';
985 ~QMacPasteboardMimeQt3Any() {
996 static bool qt_mac_openMimeRegistry(
bool global, QIODevice::OpenMode mode,
QFile &file)
1016 bool success = fd != -1;
1025 return file.
open(mode);
1032 while(!stream.
atEnd()) {
1037 registry.
insert(mime, mactype);
1041 bool QMacPasteboardMimeQt3Any::loadMimeRegistry()
1043 if(!library_file.isOpen()) {
1047 qt_mac_loadMimeRegistry(global, mime_registry, current_max);
1051 qWarning(
"QMacPasteboardMimeAnyQt3Mime: Failure to open mime resources %s -- %s", library_file.fileName().toLatin1().constData(),
1052 library_file.errorString().toLatin1().constData());
1059 if(!mime_registry_loaded.isNull() && mime_registry_loaded == fi.
lastModified())
1062 qt_mac_loadMimeRegistry(library_file, mime_registry, current_max);
1066 int QMacPasteboardMimeQt3Any::registerMimeType(
const QString &mime)
1068 if(!mime_registry.contains(mime)) {
1069 if(!loadMimeRegistry()) {
1070 qWarning(
"QMacPasteboardMimeAnyQt3Mime: Internal error");
1073 if(!mime_registry.contains(mime)) {
1074 if(!library_file.isOpen()) {
1076 qWarning(
"QMacPasteboardMimeAnyQt3Mime: Failure to open %s -- %s", library_file.fileName().toLatin1().constData(),
1077 library_file.errorString().toLatin1().constData());
1081 int ret = ++current_max;
1084 stream << mime <<
endl;
1085 stream << ret <<
endl;
1086 mime_registry.insert(mime, ret);
1087 library_file.
flush();
1091 return mime_registry[
mime];
1094 QString QMacPasteboardMimeQt3Any::convertorName()
1101 const int os_flav = registerMimeType(mime);
1103 QCFString(UTCreateStringForOSType(os_flav)));
1105 const int type_count = CFArrayGetCount(ids);
1118 const int os_flav = UTGetOSTypeFromString(UTTypeCopyPreferredTagWithClass(
QCFString(flav), kUTTagClassOSType));
1120 it != mime_registry.constEnd(); ++
it) {
1121 if(
it.value() == os_flav)
1127 bool QMacPasteboardMimeQt3Any::canConvert(
const QString &mime,
QString flav)
1130 const int os_flav = UTGetOSTypeFromString(UTTypeCopyPreferredTagWithClass(
QCFString(flav), kUTTagClassOSType));
1131 if(mime_registry.contains(mime) && mime_registry[
mime] == os_flav)
1138 qWarning(
"QMacPasteboardMimeAnyQt3Mime: Cannot write anything!");
1164 if(globalMimeList()->
isEmpty()) {
1173 new QMacPasteboardMimePict;
1185 new QMacPasteboardMimeQt3Any;
1198 MimeList *mimes = globalMimeList();
1200 #ifdef DEBUG_MIME_MAPS 1201 qDebug(
"QMacPasteboardMime::convertor: seeing if %s (%d) can convert %s to %d[%c%c%c%c] [%d]",
1202 (*it)->convertorName().toLatin1().constData(),
1204 flav, (flav >> 24) & 0xFF, (flav >> 16) & 0xFF, (flav >> 8) & 0xFF, (flav) & 0xFF,
1205 (*it)->canConvert(mime,flav));
1206 for(
int i = 0; i < (*it)->countFlavors(); ++i) {
1207 int f = (*it)->flavor(i);
1208 qDebug(
" %d) %d[%c%c%c%c] [%s]", i, f,
1209 (f >> 24) & 0xFF, (f >> 16) & 0xFF, (f >> 8) & 0xFF, (f) & 0xFF,
1210 (*it)->convertorName().toLatin1().constData());
1213 if(((*it)->type & t) && (*it)->canConvert(mime, flav))
1223 MimeList *mimes = globalMimeList();
1225 #ifdef DEBUG_MIME_MAPS 1226 qDebug(
"QMacMIme::flavorToMime: attempting %s (%d) for flavor %d[%c%c%c%c] [%s]",
1227 (*it)->convertorName().toLatin1().constData(),
1228 (*it)->type & t, flav, (flav >> 24) & 0xFF, (flav >> 16) & 0xFF, (flav >> 8) & 0xFF, (flav) & 0xFF,
1232 if((*it)->type & t) {
1233 QString mimeType = (*it)->mimeFor(flav);
1247 MimeList *mimes = globalMimeList();
The QVariant class acts like a union for the most common Qt data types.
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
QString fileName() const
Returns the name set by setFileName() or to the QFile constructors.
const struct __CFString * CFStringRef
static void cleanup_mimes()
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
QString convertorName()
Returns a name for the convertor.
CFStringRef qt_mac_mime_typeUTI
QString convertorName()
Returns a name for the convertor.
#define QT_END_NAMESPACE
This macro expands to.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QString readLine(qint64 maxlen=0)
Reads one line of text from the stream, and returns it as a QString.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
char * data()
Returns a pointer to the data stored in the byte array.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
static QList< QMacPasteboardMime * > all(uchar)
Returns a list of all currently defined QMacPasteboardMime objects of type t.
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
#define it(className, varName)
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
void qAddPostRoutine(QtCleanUpFunction p)
virtual QString mimeFor(QString flav)=0
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
bool open(OpenMode flags)
Opens the file using OpenMode mode, returning true if successful; otherwise false.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QString & replace(int i, int len, QChar after)
The QByteArray class provides an array of bytes.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
static void initialize()
This is an internal function.
int length() const
Returns the number of characters in this string.
QString & prepend(QChar c)
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
const QStringList & qEnabledDraggedTypes()
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the list.
static QString toQString(CFStringRef cfstr)
CGImageRef qt_mac_createCGImageFromQImage(const QImage &img, const QImage **imagePtr=0)
The QList::const_iterator class provides an STL-style const iterator for QList and QQueue...
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
void setPath(const QString &path)
Sets the path of the URL to path.
struct CGImage * CGImageRef
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
QMacPasteboardMimeTypeName()
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
The QUrl class provides a convenient interface for working with URLs.
The QString class provides a Unicode character string.
QString host() const
Returns the host of the URL if it is defined; otherwise an empty string is returned.
QString normalized(NormalizationForm mode) const Q_REQUIRED_RESULT
Returns the string in the given Unicode normalization mode.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
void setHost(const QString &host)
Sets the host of the URL to host.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QMacPasteboardMimeFileUri()
~QMacPasteboardMimeTypeName()
The QChar class provides a 16-bit Unicode character.
QString convertorName()
Returns a name for the convertor.
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
static QPixmap fromMacCGImageRef(CGImageRef image)
Returns a QPixmap that is equivalent to the given image.
QString path() const
Returns the path of the URL.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
QString convertorName()
Returns a name for the convertor.
bool exists() const
Returns true if the file specified by fileName() exists; otherwise returns false. ...
Q_CORE_EXPORT void qDebug(const char *,...)
virtual QString flavorFor(const QString &mime)=0
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
virtual QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)=0
Returns data converted from MIME type mime to Mac UTI flav.
void append(const T &t)
Inserts value at the end of the list.
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
T takeFirst()
Removes the first item in the list and returns it.
int size() const
Returns the number of characters in this string.
static QMacPasteboardMime * convertor(uchar, const QString &mime, QString flav)
Returns the most-recently created QMacPasteboardMime of type t that can convert between the mime and ...
virtual ~QMacPasteboardMime()
Destroys a conversion object, removing it from the global list of available convertors.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
ScrapFlavorType qt_mac_mime_type
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Q_CORE_EXPORT void qWarning(const char *,...)
QList< QMacPasteboardMime * > MimeList
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
virtual QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)=0
Returns data converted from Mac UTI flav to MIME type mime.
QMacPasteboardMimeUnicodeText()
QString convertorName()
Returns a name for the convertor.
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
QString convertorName()
Returns a name for the convertor.
QUrl toUrl() const
Returns the variant as a QUrl if the variant has type() Url ; otherwise returns an invalid QUrl...
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QByteArray toEncoded(FormattingOptions options=None) const
Returns the encoded representation of the URL if it's valid; otherwise an empty QByteArray is returne...
T & first()
Returns a reference to the first item in the list.
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
virtual bool canConvert(const QString &mime, QString flav)=0
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
QString scheme() const
Returns the scheme of the URL.
int width() const
Returns the width of the image.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
QString convertorName()
Returns a name for the convertor.
static bool closingDown()
Returns true if the application objects are being destroyed; otherwise returns false.
The QDateTime class provides date and time functions.
The QFile class provides an interface for reading from and writing to files.
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
static QString flavorToMime(uchar, QString flav)
Returns a MIME type of type t for flav, or 0 if none exists.
The QTextStream class provides a convenient interface for reading and writing text.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QMacPasteboardMimePlainText()
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QString toLower() const Q_REQUIRED_RESULT
Returns a lowercase copy of the string.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
int size() const
Returns the number of items in the list.
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
QMacPasteboardMimeVCard()
virtual bool reset()
Seeks to the start of input for random-access devices.
int height() const
Returns the height of the image.
T qvariant_cast(const QVariant &)
int size() const
Returns the number of bytes in this byte array.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
void setScheme(const QString &scheme)
Sets the scheme of the URL to scheme.
void flush()
Flushes any buffered data waiting to be written to the device.
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
static const MacVersion MacintoshVersion
the version of the Macintosh operating system on which the application is run (Mac only)...
QVariant convertToMime(const QString &mime, QList< QByteArray > data, QString flav)
Returns data converted from Mac UTI flav to MIME type mime.
QString convertorName()
Returns a name for the convertor.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
bool atEnd() const
Returns true if there is no more data to be read from the QTextStream; otherwise returns false...
static QUrl fromEncoded(const QByteArray &url)
Parses input and returns the corresponding QUrl.
QMacPasteboardMimeHTMLText()
The QFileInfo class provides system-independent file information.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
void qRegisterDraggedTypes(const QStringList &types)
Registers the given types as custom pasteboard types.
virtual void close()
Calls QFile::flush() and closes the file.
#define qPrintable(string)
The QMacPasteboardMime class converts between a MIME type and a.
QList< QByteArray > convertFromMime(const QString &mime, QVariant data, QString flav)
Returns data converted from MIME type mime to Mac UTI flav.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QMacPasteboardMime(char)
Constructs a new conversion object of type t, adding it to the globally accessed list of available co...
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QString mimeFor(QString flav)
Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav...
QString convertorName()
Returns a name for the convertor.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
void setFileName(const QString &name)
Sets the name of the file.
QString flavorFor(const QString &mime)
Returns the Mac UTI used for MIME type mime, or 0 if this convertor does not support mime...
int open(const char *, int,...)
The QLibrary class loads shared libraries at runtime.
virtual QString convertorName()=0
Returns a name for the convertor.
The QList class is a template class that provides lists.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the list...
static QString homePath()
Returns the absolute path of the user's home directory.
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
bool canConvert(const QString &mime, QString flav)
Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false...
Q_CORE_EXPORT QTextStream & endl(QTextStream &s)
QDateTime lastModified() const
Returns the date and time when the file was last modified.