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  ·  Fonctions  · 

QWindowsMime Class Reference

The QWindowsMime class maps open-standard MIME to 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 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:

  • 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". 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.

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

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.

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 ) [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.

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.

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.

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.

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

Returns a name for the convertor.

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.

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.


This file is part of the Qt toolkit. Copyright © 1995-2005 Trolltech. All Rights Reserved.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 68
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le blog Digia au hasard

Logo

Créer des applications avec un style Metro avec Qt, exemples en QML et C++, un article de Digia Qt traduit par Thibaut Cuvelier

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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 3.3
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