Qt:Документация 4.3.2/qmacpasteboardmime

Материал из Wiki.crossplatform.ru

Версия от 10:23, 14 ноября 2008; Root (Обсуждение | вклад)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

[править] QMacPasteboardMime Class Reference
[модуль QtGui ]

The QMacPasteboardMime class maps open-standard MIME to Mac flavors. More...

 #include <QMacPasteboardMime>

This class was introduced in Qt 4.2.

[править] Открытые функции

[править] Статические открытые члены

  • QList<QMacPasteboardMime *> all ( uchar t )
  • QMacPasteboardMime * convertor ( uchar t, const QString & mime, QString flav )
  • QString flavorToMime ( uchar t, QString flav )

[править] Подробное описание

The QMacPasteboardMime class maps open-standard MIME to Mac flavors.

Qt's drag and drop support and clipboard facilities use the MIME standard. On X11, this maps trivially to the Xdnd protocol, but on Mac although some applications use MIME types to describe clipboard formats, others use arbitrary non-standardized naming conventions, or unnamed built-in Mac formats.

By instantiating subclasses of QMacPasteboardMime that provide conversions between Mac flavors and MIME formats, you can convert proprietary clipboard formats to MIME formats.

Qt has predefined support for the following Mac flavors:

  • kScrapFlavorTypeUnicode - converted to "text/plain;charset=ISO-10646-UCS-2"
  • kScrapFlavorTypeText - converted to "text/plain;charset=system" or "text/plain"
  • kScrapFlavorTypePicture - converted to "application/x-qt-image"
  • typeFileURL - converted to "text/uri-list"

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


[править] Описание функций-членов

[править]
QMacPasteboardMime::QMacPasteboardMime ( char t )

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

[править]
QMacPasteboardMime::~QMacPasteboardMime () [virtual]

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

[править]
QList<QMacPasteboardMime *> QMacPasteboardMime::all ( uchar t ) [static]

Returns a list of all currently defined QMacPasteboardMime objects of type t.

[править]
bool QMacPasteboardMime::canConvert ( const QString & mime, QString flav ) [pure virtual]

Returns true if the convertor can convert (both ways) between mime and flav; otherwise returns false.

All subclasses must reimplement this pure virtual function.

[править]
QList< QByteArray> QMacPasteboardMime::convertFromMime ( const QString & mime, QVariant data, QString flav ) [pure virtual]

Returns data converted from MIME type mime to Mac UTI flav.

Note that Mac flavors must all be self-terminating. The return value may contain trailing data.

All subclasses must reimplement this pure virtual function.

[править]
QVariant QMacPasteboardMime::convertToMime ( const QString & mime, QList< QByteArray> data, QString flav ) [pure virtual]

Returns data converted from Mac UTI flav to MIME type mime.

Note that Mac flavors must all be self-terminating. The input data may contain trailing data.

All subclasses must reimplement this pure virtual function.

[править]
QMacPasteboardMime * QMacPasteboardMime::convertor ( uchar t, const QString & mime, QString flav ) [static]

Returns the most-recently created QMacPasteboardMime of type t that can convert between the mime and flav formats. Returns 0 if no such convertor exists.

[править]
QString QMacPasteboardMime::convertorName () [pure virtual]

Returns a name for the convertor.

All subclasses must reimplement this pure virtual function.

[править]
QString QMacPasteboardMime::flavorFor ( const QString & mime ) [pure virtual]

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

All subclasses must reimplement this pure virtual function.

[править]
QString QMacPasteboardMime::flavorToMime ( uchar t, QString flav ) [static]

Returns a MIME type of type t for flav, or 0 if none exists.

[править]
QString QMacPasteboardMime::mimeFor ( QString flav ) [pure virtual]

Returns the MIME UTI used for Mac flavor flav, or 0 if this convertor does not support flav.

All subclasses must reimplement this pure virtual function.


Copyright © 2007 Trolltech Trademarks
Qt 4.3.2