TQMimeSource Class

Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# TQMimeSource Class Reference

The TQMimeSource class is an abstraction of objects which provide formatted data of a certain MIME type. More...

`#include <ntqmime.h>`

Inherited by TQDragObject and TQDropEvent.

List of all member functions.

## Public Members

- TQMimeSource ()
- virtual ~TQMimeSource ()
- virtual const char * format ( int i = 0 ) const = 0
- virtual bool provides ( const char * mimeType ) const
- virtual TQByteArray encodedData ( const char * ) const = 0
- int serialNumber () const

## Detailed Description

The TQMimeSource class is an abstraction of objects which provide formatted data of a certain MIME type.

Drag-and-drop and clipboard use this abstraction.

See also IANA list of MIME media types, Drag And Drop Classes, Input/Output and Networking, and Miscellaneous Classes.

## Member Function Documentation

### TQMimeSource::TQMimeSource ()

Constructs a mime source and assigns a globally unique serial number to it.

See also serialNumber().

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

Provided to ensure that subclasses destroy themselves correctly.

### TQByteArray TQMimeSource::encodedData ( const char * ) const`[pure virtual]`

Returns the encoded data of this object in the specified MIME format.

Subclasses must reimplement this function.

Reimplemented in TQStoredDrag, TQDropEvent, and TQIconDrag.

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

Returns the i-th supported MIME format, or 0.

Reimplemented in TQDropEvent.

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

Returns true if the object can provide the data in format mimeType; otherwise returns false.

If you inherit from TQMimeSource, for consistency reasons it is better to implement the more abstract canDecode() functions such as TQTextDrag::canDecode() and TQImageDrag::canDecode().

Example: iconview/simple_dd/main.cpp.

Reimplemented in TQDropEvent.

### int TQMimeSource::serialNumber () const

Returns the mime source's globally unique serial number.

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