com.trolltech.qt.gui
Class QIconEngine

java.lang.Object
  extended by com.trolltech.qt.internal.QSignalEmitterInternal
      extended by com.trolltech.qt.QSignalEmitter
          extended by com.trolltech.qt.QtJambiObject
              extended by com.trolltech.qt.gui.QIconEngine
All Implemented Interfaces:
QtJambiInterface
Direct Known Subclasses:
QIconEngineV2

public abstract class QIconEngine
extends QtJambiObject

The QIconEngine class provides an abstract base class for QIcon renderers. Use QIconEngineV2 instead.

An icon engine provides the rendering functions for a QIcon. Each icon has a corresponding icon engine that is responsible for drawing the icon with a requested size, mode and state.

The icon is rendered by the paint() function, and the icon can additionally be obtained as a pixmap with the pixmap() function (the default implementation simply uses paint() to achieve this). The addPixmap() function can be used to add new pixmaps to the icon engine, and is used by QIcon to add specialized custom pixmaps.

The paint(), pixmap(), and addPixmap() functions are all virtual, and can therefore be reimplemented in subclasses of QIconEngine.

See also:
QIconEngineV2, and QIconEnginePlugin.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter
QSignalEmitter.AbstractSignal, QSignalEmitter.PrivateSignal0, QSignalEmitter.PrivateSignal1, QSignalEmitter.PrivateSignal2, QSignalEmitter.PrivateSignal3, QSignalEmitter.PrivateSignal4, QSignalEmitter.PrivateSignal5, QSignalEmitter.PrivateSignal6, QSignalEmitter.PrivateSignal7, QSignalEmitter.PrivateSignal8, QSignalEmitter.PrivateSignal9, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9
 
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal
 
Field Summary
 
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
currentSender
 
Constructor Summary
QIconEngine()
          This is an overloaded method provided for convenience.
 
Method Summary
 QSize actualSize(QSize size, QIcon.Mode mode, QIcon.State state)
          Returns the actual size of the icon the engine provides for the requested size, mode and state.
 void addFile(java.lang.String fileName, QSize size, QIcon.Mode mode, QIcon.State state)
          Called by QIcon::addFile().
 void addPixmap(QPixmap pixmap, QIcon.Mode mode, QIcon.State state)
          Called by QIcon::addPixmap().
abstract  void paint(QPainter painter, QRect rect, QIcon.Mode mode, QIcon.State state)
          Uses the given painter to paint the icon with the required mode and state into the rectangle rect.
 QPixmap pixmap(QSize size, QIcon.Mode mode, QIcon.State state)
          Returns the icon as a pixmap with the required size, mode, and state.
 
Methods inherited from class com.trolltech.qt.QtJambiObject
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr
 
Methods inherited from class com.trolltech.qt.QSignalEmitter
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread
 
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal
__qt_signalInitialization
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.trolltech.qt.QtJambiInterface
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership
 

Constructor Detail

QIconEngine

public QIconEngine()
This is an overloaded method provided for convenience.

Method Detail

actualSize

public QSize actualSize(QSize size,
                        QIcon.Mode mode,
                        QIcon.State state)
Returns the actual size of the icon the engine provides for the requested size, mode and state. The default implementation returns the given size.


addFile

public void addFile(java.lang.String fileName,
                    QSize size,
                    QIcon.Mode mode,
                    QIcon.State state)
Called by QIcon::addFile(). Adds a specialized pixmap from the file with the given fileName, size, mode and state. The default pixmap-based engine stores any supplied file names, and it loads the pixmaps on demand instead of using scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra files.


addPixmap

public void addPixmap(QPixmap pixmap,
                      QIcon.Mode mode,
                      QIcon.State state)
Called by QIcon::addPixmap(). Adds a specialized pixmap for the given mode and state. The default pixmap-based engine stores any supplied pixmaps, and it uses them instead of scaled pixmaps if the size of a pixmap matches the size of icon requested. Custom icon engines that implement scalable vector formats are free to ignores any extra pixmaps.


paint

public abstract void paint(QPainter painter,
                           QRect rect,
                           QIcon.Mode mode,
                           QIcon.State state)
Uses the given painter to paint the icon with the required mode and state into the rectangle rect.


pixmap

public QPixmap pixmap(QSize size,
                      QIcon.Mode mode,
                      QIcon.State state)
Returns the icon as a pixmap with the required size, mode, and state. The default implementation creates a new pixmap and calls paint() to fill it.