Classes - Annotated - Tree - Functions - Home - Structure

QWindowsMime Class Reference

The QWindowsMime class maps open-standard MIME types with Window Clipboard formats. More...

#include <qmime.h>

List of all member functions.

Public Members

Static Public Members


Detailed Description

The QWindowsMime class maps open-standard MIME types with Window Clipboard formats.

The drag-and-drop and clipboard facilities of Qt use the MIME standard. On X11, this maps trivially to the Xdnd protocol, but on Windows only some applications use MIME types to describe the clipboard formats, while others use arbitrary non-standardized naming conventions, or completely unnamed built-in formats of Windows.

By instantiating subclasses of QWindowsMime that provide conversions between Windows Clipboard and MIME formats, you can convert proprietary clipboard formats to MIME formats.

Qt has predefined support for the following Windows Clipboard formats:

An example usage of this class would be to map the Windows Metafile clipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-wmf". This conversion might simply be adding or removing a header, or even just passing on the data. See the Drag-and-Drop documentation for more information on choosing and definition MIME types.


Member Function Documentation

QWindowsMime::QWindowsMime ()

Constructs a new conversion object, adding it to the globally accessed list of available convertors.

QWindowsMime::~QWindowsMime () [virtual]

Destroys a conversion object, removing it from the global list of available convertors.

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

Returns a list of all currently defined QWindowsMime objects.

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

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

All subclasses must reimplement this purely virtual function.

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

Returns the Windows Clipboard formats supported by this convertor that is ordinarily at index. So cf(0) returns the first Windows Clipboard format supported, cf(countCf()-1) returns the last. Return values out of range are undefined.

All subclasses must reimplement this purely virtual function.

int QWindowsMime::cfFor ( const char * mime ) [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 purely virtual function.

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

Returns a MIME type for cf, or 0 if none exists.

QByteArray QWindowsMime::convertFromMime ( QByteArray data, const char * mime, int cf ) [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 purely virtual function.

QByteArray QWindowsMime::convertToMime ( QByteArray data, const char * mime, int cf ) [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 purely virtual function.

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

Returns the most-recently created QWindowsMime that can convert between mime and cf formats. Returns 0 if no such convertor exists.

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

Returns a name for the convertor.

All subclasses must reimplement this purely virtual function.

int QWindowsMime::countCf () [virtual]

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

All subclasses must reimplement this purely virtual function.

void QWindowsMime::initialize () [static]

This is an internal function.

const char * QWindowsMime::mimeFor ( int cf ) [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 purely virtual function.

int QWindowsMime::registerMimeType ( const char * mime ) [static]

This is an internal function.

Search the documentation, FAQ, qt-interest archive and more (uses www.trolltech.com):


This file is part of the Qt toolkit, copyright © 1995-2001 Trolltech, all rights reserved.


Copyright © 2001 TrolltechTrademarks
Qt version 3.0.0-beta1-beta1