| Classes - Annotated - Tree - Functions - Home - Structure

# QMimeSource Class Reference

An abstract piece of formatted data. More...

`#include <qmime.h>`

Inherited by QDragObject and QDropEvent.

List of all member functions.

## Public Members

- virtual ~QMimeSource ()
- virtual const char* format ( int n = 0 ) const
- virtual bool provides ( const char * ) const
- virtual QByteArray encodedData ( const char * ) const

## Detailed Description

An abstract piece of formatted data.

Drag-and-drop and clipboard use this abstraction.

See also IANA list of MIME media types

## Member Function Documentation

### QMimeSource::~QMimeSource () `[virtual]`

Provided to ensure subclasses destruct correctly.

### QByteArray QMimeSource::encodedData ( const char * ) const `[virtual]`

Returns the encoded payload of this object, in the specified MIME format.

Subclasses must reimplement this function.

Reimplemented in QDropEvent.

### const char * QMimeSource::format ( int i = 0 ) const `[virtual]`

Returns the ith format, or NULL.

Reimplemented in QTextDrag, QImageDrag, QDropEvent and QStoredDrag.

### bool QMimeSource::provides ( const char * mimeType ) const `[virtual]`

Returns TRUE if the object can provide the data in format mimeType. The default implementation iterates over format().

Note that it is often better to use the more-abstract canDecode() functions such as QTextDrag::canDecode() and QImageDrag::canDecode().

Reimplemented in QDropEvent.

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

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