Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Modules  ·  Fonctions  · 

QWindowsMime Class

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

 #include <QWindowsMime>

Public Functions

QWindowsMime()
virtual ~QWindowsMime()
virtual bool canConvertFromMime(const FORMATETC & formatetc, const QMimeData * mimeData) const = 0
virtual bool canConvertToMime(const QString & mimeType, IDataObject * pDataObj) const = 0
virtual bool convertFromMime(const FORMATETC & formatetc, const QMimeData * mimeData, STGMEDIUM * pmedium) const = 0
virtual QVariant convertToMime(const QString & mimeType, IDataObject * pDataObj, QVariant::Type preferredType) const = 0
virtual QVector<FORMATETC> formatsForMime(const QString & mimeType, const QMimeData * mimeData) const = 0
virtual QString mimeForFormat(const FORMATETC & formatetc) const = 0

Static Public Members

int registerMimeType(const QString & mime)

Detailed Description

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

Qt's drag-and-drop and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol, but on Windows although some applications use MIME types to describe clipboard formats, others use arbitrary non-standardized naming conventions, or 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:

Windows FormatEquivalent MIME type
CF_UNICODETEXTtext/plain
CF_TEXTtext/plain
CF_DIBimage/xyz, where xyz is a Qt image format
CF_HDROPtext/uri-list
CF_INETURLtext/uri-list
CF_HTMLtext/html

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. This conversion might simply be adding or removing a header, or even just passing on the data. See Drag and Drop for more information on choosing and definition MIME types.

You can check if a MIME type is convertible using canConvertFromMime() and can perform conversions with convertToMime() and convertFromMime().

See also QWindowsMimeConverter.

Member Function Documentation

QWindowsMime::QWindowsMime()

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

QWindowsMime::~QWindowsMime() [virtual]

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

bool QWindowsMime::canConvertFromMime(const FORMATETC & formatetc, const QMimeData * mimeData) const [pure virtual]

Returns true if the converter can convert from the mimeData to the format specified in formatetc.

All subclasses must reimplement this pure virtual function.

bool QWindowsMime::canConvertToMime(const QString & mimeType, IDataObject * pDataObj) const [pure virtual]

Returns true if the converter can convert to the mimeType from the available formats in pDataObj.

All subclasses must reimplement this pure virtual function.

bool QWindowsMime::convertFromMime(const FORMATETC & formatetc, const QMimeData * mimeData, STGMEDIUM * pmedium) const [pure virtual]

Convert the mimeData to the format specified in formatetc. The converted data should then be placed in pmedium structure.

Return true if the conversion was successful.

All subclasses must reimplement this pure virtual function.

QVariant QWindowsMime::convertToMime(const QString & mimeType, IDataObject * pDataObj, QVariant::Type preferredType) const [pure virtual]

Returns a QVariant containing the converted data for mimeType from pDataObj. If possible the QVariant should be of the preferredType to avoid needless conversions.

All subclasses must reimplement this pure virtual function.

QVector<FORMATETC> QWindowsMime::formatsForMime(const QString & mimeType, const QMimeData * mimeData) const [pure virtual]

Returns a QVector of FORMATETC structures representing the different windows clipboard formats that can be provided for the mimeType from the mimeData.

All subclasses must reimplement this pure virtual function.

QString QWindowsMime::mimeForFormat(const FORMATETC & formatetc) const [pure virtual]

Returns the mime type that will be created form the format specified in formatetc, or an empty string if this converter does not support formatetc.

All subclasses must reimplement this pure virtual function.

int QWindowsMime::registerMimeType(const QString & mime) [static]

Registers the MIME type mime, and returns an ID number identifying the format on Windows.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 5.0-snapshot
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web