Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.trolltech.qt.gui
Class QImageIOPlugin

    java.lang.Object
      com.trolltech.qt.QSignalEmitter
          com.trolltech.qt.QtJambiObject
              com.trolltech.qt.core.QObject
                  com.trolltech.qt.gui.QImageIOPlugin

All Implemented Interfaces:
  QAbstractFactoryInterface, QAbstractImageIOHandlerFactoryInterface, QtJambiInterface

    public abstract class QImageIOPlugin

extends QObject
implements QAbstractImageIOHandlerFactoryInterface, QAbstractFactoryInterface

The `QImageIOPlugin` class defines an interface for writing an image format plugin. `QImageIOPlugin` is a factory for creating `QImageIOHandler` objects, which are used internally by `QImageReader` and `QImageWriter` to add support for different image formats to Qt.

Writing an image I/O plugin is achieved by subclassing this base class, reimplementing the pure virtual functions `capabilities()`, `create()`, and `keys()`, and exporting the class with the Q_EXPORT_PLUGIN2() macro. See How to Create Qt Plugins for details.

An image format plugin can support three capabilities: reading (`CanRead` ), writing (`CanWrite` ) and incremental reading (`CanReadIncremental` ). Reimplement `capabilities()` in you subclass to expose the capabilities of your image format.

`create()` should create an instance of your `QImageIOHandler` subclass, with the provided device and format properly set, and return this handler. You must also reimplement `keys()` so that Qt knows which image formats your plugin supports.

Different plugins can support different capabilities. For example, you may have one plugin that supports reading the GIF format, and another that supports writing. Qt will select the correct plugin for the job, depending on the return value of `capabilities()`. If several plugins support the same capability, Qt will select one arbitrarily.

See also:
  `QImageIOHandler`, and How to Create Qt Plugins.

Nested Class Summary
`static class` | `QImageIOPlugin.Capabilities` This is a flags class for com.trolltech.qt.gui.QImageIOPlugin.Capability
`static class` | `QImageIOPlugin.Capability` This enum describes the capabilities of a `QImageIOPlugin`.

Nested classes/interfaces inherited from class com.trolltech.qt.QtJambiObject
`QtJambiObject.QPrivateConstructor`

Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
`QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I>`

Constructor Summary
`` | `QImageIOPlugin()` Constructs an image plugin with the given `parent`.
`` | `QImageIOPlugin(QObject parent)` Constructs an image plugin with the given `parent`.
`protected` | `QImageIOPlugin(QtJambiObject.QPrivateConstructor p)` This method is internal to Qt Jambi.

Method Summary
`long` | `__qt_cast_to_QAbstractFactory(long ptr)` This method is internal to Qt Jambi.
`long` | `__qt_cast_to_QAbstractImageIOHandlerFactory(long ptr)` This method is internal to Qt Jambi.
`abstract QImageIOPlugin.Capabilities` | `capabilities(QIODevice device, QByteArray format)` Returns the capabilities on the plugin, based on the data in `device` and the format `format`.
`abstract QImageIOHandler` | `create(QIODevice device, QByteArray format)` Creates and returns a `QImageIOHandler` subclass, with `device` and `format` set.
`static QImageIOPlugin` | `fromNativePointer(QNativePointer nativePointer)` This method returns the QImageIOPlugin instance pointed to by `nativePointer`.
`abstract java.util.List<java.lang.String>` | `keys()` Returns the list of image keys this plugin supports.

Methods inherited from class com.trolltech.qt.core.QObject
`blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, toString, userProperty`

Methods inherited from class com.trolltech.qt.QtJambiObject
`disableGarbageCollection, dispose, disposed, equals, finalize, nativeId, nativePointer, reassignNativeResources, reenableGarbageCollection, setJavaOwnership, tr, tr, tr`

Methods inherited from class com.trolltech.qt.QSignalEmitter
`__qt_signalInitialization, disconnect, disconnect, signalSender`

Methods inherited from class java.lang.Object
`clone, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface com.trolltech.qt.QtJambiInterface
`disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership`

Constructor Detail

### QImageIOPlugin

    public QImageIOPlugin()

  Constructs an image plugin with the given `parent`. This is invoked automatically by the Q_EXPORT_PLUGIN2() macro.

### QImageIOPlugin

    public QImageIOPlugin(QObject parent)

  Constructs an image plugin with the given `parent`. This is invoked automatically by the Q_EXPORT_PLUGIN2() macro.

### QImageIOPlugin

    protected QImageIOPlugin(QtJambiObject.QPrivateConstructor p)

  This method is internal to Qt Jambi.

Method Detail

### capabilities

    public abstract QImageIOPlugin.Capabilities capabilities(QIODevice device,
                                                             QByteArray format)

  Returns the capabilities on the plugin, based on the data in `device` and the format `format`. For example, if the `QImageIOHandler` supports the BMP format, and the data in the device starts with the characters "BM", this function should return `CanRead` . If `format` is "bmp" and the handler supports both reading and writing, this function should return `CanRead` | `CanWrite` .

### create

    public abstract QImageIOHandler create(QIODevice device,
                                           QByteArray format)

  Creates and returns a `QImageIOHandler` subclass, with `device` and `format` set. The `format` must come from the list returned by `keys()`. Format names are case sensitive.

See also:
  `keys()`.

  Specified by:
    `create` in interface `QAbstractImageIOHandlerFactoryInterface`

### keys

    public abstract java.util.List<java.lang.String> keys()

  Returns the list of image keys this plugin supports.

  These keys are usually the names of the image formats that are implemented in the plugin (e.g., "jpg" or "gif").

See also:
  `capabilities()`.

  Specified by:
    `keys` in interface `QAbstractFactoryInterface`
  Specified by:
    `keys` in interface `QAbstractImageIOHandlerFactoryInterface`

### fromNativePointer

    public static QImageIOPlugin fromNativePointer(QNativePointer nativePointer)

  This method returns the QImageIOPlugin instance pointed to by `nativePointer`.

### __qt_cast_to_QAbstractImageIOHandlerFactory

    public long __qt_cast_to_QAbstractImageIOHandlerFactory(long ptr)

  This method is internal to Qt Jambi.

  Specified by:
    `__qt_cast_to_QAbstractImageIOHandlerFactory` in interface `QAbstractImageIOHandlerFactoryInterface`

### __qt_cast_to_QAbstractFactory

    public long __qt_cast_to_QAbstractFactory(long ptr)

  This method is internal to Qt Jambi.

  Specified by:
    `__qt_cast_to_QAbstractFactory` in interface `QAbstractFactoryInterface`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

A HREF="../../../../com/trolltech/qt/gui/QAbstractImageIOHandlerFactoryInterface.html#__qt_cast_to_QAbstractImageIOHandlerFactory(long)">__qt_cast_to_QAbstractImageIOHandlerFactory in interface `QAbstractImageIOHandlerFactoryInterface`

### __qt_cast_to_QAbstractFactory

    public long __qt_cast_to_QAbstractFactory(long ptr)

  This method is internal to Qt Jambi.

  Specified by:
    ``