QWindowsMime(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QWindowsMime πŸ’–

okay so bestie, welcome to QWindowsMime β€” that's the Qt 3 class (manual page qwindowsmime.3qt, iykyk) that literally translates between open-standard MIME types and Windows Clipboard formats. it's giving ambassador energy. it's giving bridge-between-two-worlds. let's get into it 🫢


✨ NAME ✨

QWindowsMime β€” maps open-standard MIME to Window Clipboard formats 🌈


🌸 SYNOPSIS 🌸

#include <qmime.h>

πŸ‘‘ Public Members

QWindowsMime ()
virtual ~QWindowsMime ()
virtual const char * convertorName () = 0
virtual int countCf () = 0
virtual int cf ( int index ) = 0
virtual bool canConvert ( const char * mime, int cf ) = 0
virtual const char * mimeFor ( int cf ) = 0
virtual int cfFor ( const char * mime ) = 0
virtual QByteArray convertToMime ( QByteArray data, const char * mime,
    int cf ) = 0
virtual QByteArray convertFromMime ( QByteArray data, const char * mime,
    int cf ) = 0

πŸ¦‹ Static Public Members

void initialize ()
QPtrList<QWindowsMime> all ()
QWindowsMime * convertor ( const char * mime, int cf )
const char * cfToMime ( int cf )

πŸ’… DESCRIPTION πŸ’…

so the QWindowsMime class maps open-standard MIME to Window Clipboard formats. that's the whole vibe. that's the mission. πŸŽ€

Qt's drag-and-drop and clipboard facilities use the MIME standard. on X11 this maps trivially to the Xdnd protocol β€” no drama, no notes. but on Windows? chaos. some applications use MIME types to describe clipboard formats, sure, but others use arbitrary non-standardized naming conventions, or unnamed built-in formats of Windows. it's a whole mess, bestie 😭

so here's the slay: by instantiating subclasses of QWindowsMime that provide conversions between Windows Clipboard and MIME formats, you can convert proprietary clipboard formats to MIME formats. you're basically the translator at the party. main character energy fr fr. ✨

Qt has predefined support for the following Windows Clipboard formats:

  • CF_UNICODETEXT β€” converted to "text/plain;charset=ISO-10646-UCS-2" and supported by QTextDrag.
  • CF_TEXT β€” converted to "text/plain;charset=system" or "text/plain" and supported by QTextDrag.
  • CF_DIB β€” converted to "image/*", where * is a Qt image format, and supported by QImageDrag.
  • CF_HDROP β€” converted to "text/uri-list", and supported by QUriDrag.

an example use of this class would be to map the Windows Metafile clipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-wmf". and like… that conversion might simply be adding or removing a header, or even just passing on the data. no cap. see the Drag-and-Drop documentation for more information on choosing and definition MIME types. πŸ“š

you can check if a MIME type is convertible using canConvert() and can perform conversions with convertToMime() and convertFromMime(). obsessed with a clean API honestly.

See also Drag And Drop Classes, Input/Output and Networking, and Miscellaneous Classes. πŸ’œ


🧚 MEMBER FUNCTION DOCUMENTATION 🧚

QWindowsMime::QWindowsMime ()

Constructs a new conversion object, adding it to the globally accessed list of available convertors. new convertor just dropped πŸ’…

QWindowsMime::~QWindowsMime () [virtual]

Destroys a conversion object, removing it from the global list of available convertors. okay bye bestie, you were iconic 🫢

QPtrList<QWindowsMime> QWindowsMime::all () [static]

Returns a list of all currently defined QWindowsMime objects. the whole squad, assembled 🌈

bool QWindowsMime::canConvert ( const char * mime, int cf ) [pure virtual]

Returns TRUE if the convertor can convert (both ways) between mime and cf; otherwise returns FALSE.

All subclasses must reimplement this pure virtual function. no skipping, bestie, it's required. 😀

int QWindowsMime::cf ( int index ) [pure virtual]

Returns the Windows Clipboard format supported by this convertor that is ordinarily at position index. This means that cf(0) returns the first Windows Clipboard format supported, and cf(countCf()-1) returns the last. If index is out of range the return value is undefined.

⚠️ undefined return value means exactly that β€” do not go poking around out of range, it's giving cursed. πŸ’€
All subclasses must reimplement this pure virtual function.

int QWindowsMime::cfFor ( const char * mime ) [pure virtual]

Returns the Windows Clipboard type used for MIME type mime, or 0 if this convertor does not support mime.

All subclasses must reimplement this pure virtual function.

const char * QWindowsMime::cfToMime ( int cf ) [static]

Returns a MIME type for cf, or 0 if none exists. short king of a function honestly 🌸

QByteArray QWindowsMime::convertFromMime ( QByteArray data, const char * mime, int cf ) [pure virtual]

Returns data converted from MIME type mime to Windows Clipboard format cf.

Note that Windows Clipboard formats must all be self-terminating. The return value may contain trailing data.

All subclasses must reimplement this pure virtual function.

QByteArray QWindowsMime::convertToMime ( QByteArray data, const char * mime, int cf ) [pure virtual]

Returns data converted from Windows Clipboard format cf to MIME type mime.

Note that Windows Clipboard formats must all be self-terminating. The input data may contain trailing data.

All subclasses must reimplement this pure virtual function.

QWindowsMime * QWindowsMime::convertor ( const char * mime, int cf ) [static]

Returns the most-recently created QWindowsMime that can convert between the mime and cf formats. Returns 0 if no such convertor exists. newest convertor on the block gets the job πŸŽ€

const char * QWindowsMime::convertorName () [pure virtual]

Returns a name for the convertor. name your child, bestie πŸ’–

All subclasses must reimplement this pure virtual function.

int QWindowsMime::countCf () [pure virtual]

Returns the number of Windows Clipboard formats supported by this convertor.

All subclasses must reimplement this pure virtual function.

void QWindowsMime::initialize () [static]

This is an internal function. πŸ™ˆ nothing to see here, move along, iykyk.

const char * QWindowsMime::mimeFor ( int cf ) [pure virtual]

Returns the MIME type used for Windows Clipboard format cf, or 0 if this convertor does not support cf.

All subclasses must reimplement this pure virtual function.

🌟 SEE ALSO 🌟


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


⭐ AUTHOR ⭐

Generated automatically from the source code. (yes, a robot wrote it. iconic of them.)


πŸ’€ BUGS πŸ’€

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. 🫢 (fr fr, they mean it.)

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (not me reading the man page anyway πŸ™ˆ)

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qwindowsmime.3qt) and the Qt version (3.3.8). thank you bestie, you're doing the lord's work ✨


okay that's the whole page, you made it, slay πŸ’– this one came from Trolltech AS and it's dated 2 February 2007 β€” Qt version 3.3.8 era, and the manual page is qwindowsmime.3qt. go forth and convert clipboard formats, queen. πŸ‘‘πŸ¦‹

πŸ“¦ where this page comes from