Image Formats NG
Public Member Functions | List of all members
ImageIOHandlerPlugin Class Referenceabstract

Base class for image handler plugins. More...

Inherits QObject.

Inherited by DdsHandlerPlugin, DefaultHandlerPlugin, JpegHandlerPlugin, PngHandlerPlugin, and TestHandlerPlugin.

Public Member Functions

 ImageIOHandlerPlugin ()
 Constructs a new object with the given parent.
 
virtual QByteArray name () const =0
 Returns the name of this plugin.
 
virtual ImageFormatInfo::Capabilities capabilities (QIODevice *device, const QMimeType &mimeType) const =0
 Returns the capabilities of the plugin, based on the data in the device and the mime type mimeType. More...
 
virtual QVector< QByteArray > supportedSubTypes (const QMimeType &mimeType) const
 Returns the list of the subtypes that can be used when writing image with the given mimeType.
 
virtual ImageOptionsSet supportedOptions (const QMimeType &mimeType, const QByteArray &subType) const
 Returns true the list of supported options by the handler for the mimeType and subType. More...
 
virtual ImageIOHandlercreate (QIODevice *device, const QMimeType &mimeType)=0
 Creates and returns a QImageIOHandler subclass, with device and mimeType set. More...
 

Detailed Description

Base class for image handler plugins.

Plugins serves as factories for ImageIOHandler objects.

Member Function Documentation

◆ capabilities()

ImageFormatInfo::Capabilities ImageIOHandlerPlugin::capabilities ( QIODevice *  device,
const QMimeType &  mimeType 
) const
pure virtual

Returns the capabilities of the plugin, based on the data in the device and the mime type mimeType.

If device is 0, it should simply report whether the format can be read or written. Otherwise, it should attempt to determine whether the given mime type can be read from or written to device. It should do this without changing the state of device (typically by using QIODevice::peek()).

◆ create()

ImageIOHandler * ImageIOHandlerPlugin::create ( QIODevice *  device,
const QMimeType &  mimeType 
)
pure virtual

Creates and returns a QImageIOHandler subclass, with device and mimeType set.

The mimeType must come from the values listed in the "MimeTypes" entry in the plugin metadata.

◆ supportedOptions()

ImageOptionsSet ImageIOHandlerPlugin::supportedOptions ( const QMimeType &  mimeType,
const QByteArray &  subType 
) const
virtual

Returns true the list of supported options by the handler for the mimeType and subType.

You should return read options for the empty subtype and write options for the specific non-empty subtype. If handler doesn't support subtypes, return write options for the empty subtype too.