Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4324

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- qimageiohandler.cpp -->
<head>
  <title>Qt 4.6: QImageIOPlugin Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QImageIOPlugin"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QImageIOPlugin Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QImageIOPlugin class defines an interface for writing an image format plugin. <a href="#details">More...</a></p>
<pre> #include &lt;QImageIOPlugin&gt;</pre><p>Inherits <a href="qobject.html">QObject</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qimageioplugin-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-types"></a>
<h2>Public Types</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">flags </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#Capability-enum">Capabilities</a></b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#Capability-enum">Capability</a></b> { CanRead, CanWrite, CanReadIncremental }</td></tr>
</table>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#QImageIOPlugin">QImageIOPlugin</a></b> ( QObject * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#dtor.QImageIOPlugin">~QImageIOPlugin</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual Capabilities </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#capabilities">capabilities</a></b> ( QIODevice * <i>device</i>, const QByteArray &amp; <i>format</i> ) const = 0</td></tr>
</table>
<hr />
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual QImageIOHandler * </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#create">create</a></b> ( QIODevice * <i>device</i>, const QByteArray &amp; <i>format</i> = QByteArray() ) const = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QStringList </td><td class="memItemRight" valign="bottom"><b><a href="qimageioplugin.html#keys">keys</a></b> () const = 0</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
<li><div class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QImageIOPlugin class defines an interface for writing an image format plugin.</p>
<p>QImageIOPlugin is a factory for creating <a href="qimageiohandler.html">QImageIOHandler</a> objects, which are used internally by <a href="qimagereader.html">QImageReader</a> and <a href="qimagewriter.html">QImageWriter</a> to add support for different image formats to Qt.</p>
<p>Writing an image I/O plugin is achieved by subclassing this base class, reimplementing the pure virtual functions <a href="qimageioplugin.html#capabilities">capabilities</a>(), <a href="qimageioplugin.html#create">create</a>(), and <a href="qimageioplugin.html#keys">keys</a>(), and exporting the class with the <a href="qtplugin.html#Q_EXPORT_PLUGIN2">Q_EXPORT_PLUGIN2</a>() macro. See <a href="plugins-howto.html">How to Create Qt Plugins</a> for details.</p>
<p>An image format plugin can support three capabilities: reading (<a href="qimageioplugin.html#Capability-enum">CanRead</a>), writing (<a href="qimageioplugin.html#Capability-enum">CanWrite</a>) and <i>incremental</i> reading (<a href="qimageioplugin.html#Capability-enum">CanReadIncremental</a>). Reimplement <a href="qimageioplugin.html#capabilities">capabilities</a>() in you subclass to expose the capabilities of your image format.</p>
<p><a href="qimageioplugin.html#create">create</a>() should create an instance of your <a href="qimageiohandler.html">QImageIOHandler</a> subclass, with the provided device and format properly set, and return this handler. You must also reimplement <a href="qimageioplugin.html#keys">keys</a>() so that Qt knows which image formats your plugin supports.</p>
<p>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 <a href="qimageioplugin.html#capabilities">capabilities</a>(). If several plugins support the same capability, Qt will select one arbitrarily.</p>
<p>See also <a href="qimageiohandler.html">QImageIOHandler</a> and <a href="plugins-howto.html">How to Create Qt Plugins</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<a name="//apple_ref/cpp/tag/QImageIOPlugin/Capability"></a>
<a name="//apple_ref/cpp/econst/QImageIOPlugin/CanRead"></a>
<a name="//apple_ref/cpp/econst/QImageIOPlugin/CanWrite"></a>
<a name="//apple_ref/cpp/econst/QImageIOPlugin/CanReadIncremental"></a>
<a name="//apple_ref/cpp/tdef/QImageIOPlugin/Capabilities"></a>
<h3 class="flags"><a name="Capability-enum"></a>enum QImageIOPlugin::Capability<br />flags QImageIOPlugin::Capabilities</h3>
<p>This enum describes the capabilities of a <a href="qimageioplugin.html">QImageIOPlugin</a>.</p>
<p><table class="valuelist" border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QImageIOPlugin::CanRead</tt></td><td align="center" valign="top"><tt>0x1</tt></td><td valign="top">The plugin can read images.</td></tr>
<tr><td valign="top"><tt>QImageIOPlugin::CanWrite</tt></td><td align="center" valign="top"><tt>0x2</tt></td><td valign="top">The plugin can write images.</td></tr>
<tr><td valign="top"><tt>QImageIOPlugin::CanReadIncremental</tt></td><td align="center" valign="top"><tt>0x4</tt></td><td valign="top">The plugin can read images incrementally.</td></tr>
</table></p>
<p>The Capabilities type is a typedef for <a href="qflags.html">QFlags</a>&lt;Capability&gt;. It stores an OR combination of Capability values.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QImageIOPlugin/QImageIOPlugin"></a>
<h3 class="fn"><a name="QImageIOPlugin"></a>QImageIOPlugin::QImageIOPlugin ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
<p>Constructs an image plugin with the given <i>parent</i>. This is invoked automatically by the <a href="qtplugin.html#Q_EXPORT_PLUGIN2">Q_EXPORT_PLUGIN2</a>() macro.</p>
<a name="//apple_ref/cpp/instm/QImageIOPlugin/~QImageIOPlugin"></a>
<h3 class="fn"><a name="dtor.QImageIOPlugin"></a>QImageIOPlugin::~QImageIOPlugin ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the picture format plugin.</p>
<p>You never have to call this explicitly. Qt destroys a plugin automatically when it is no longer used.</p>
<a name="//apple_ref/cpp/instm/QImageIOPlugin/capabilities"></a>
<h3 class="fn"><a name="capabilities"></a><a href="qimageioplugin.html#Capability-enum">Capabilities</a> QImageIOPlugin::capabilities ( <a href="qiodevice.html">QIODevice</a> * <i>device</i>, const <a href="qbytearray.html">QByteArray</a> &amp; <i>format</i> ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the capabilities on the plugin, based on the data in <i>device</i> and the format <i>format</i>. For example, if the <a href="qimageiohandler.html">QImageIOHandler</a> supports the BMP format, and the data in the device starts with the characters &quot;BM&quot;, this function should return <a href="qimageioplugin.html#Capability-enum">CanRead</a>. If <i>format</i> is &quot;bmp&quot; and the handler supports both reading and writing, this function should return <a href="qimageioplugin.html#Capability-enum">CanRead</a> | <a href="qimageioplugin.html#Capability-enum">CanWrite</a>.</p>
<a name="//apple_ref/cpp/instm/QImageIOPlugin/create"></a>
<h3 class="fn"><a name="create"></a><a href="qimageiohandler.html">QImageIOHandler</a> * QImageIOPlugin::create ( <a href="qiodevice.html">QIODevice</a> * <i>device</i>, const <a href="qbytearray.html">QByteArray</a> &amp; <i>format</i> = QByteArray() ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Creates and returns a <a href="qimageiohandler.html">QImageIOHandler</a> subclass, with <i>device</i> and <i>format</i> set. The <i>format</i> must come from the list returned by <a href="qimageioplugin.html#keys">keys</a>(). Format names are case sensitive.</p>
<p>See also <a href="qimageioplugin.html#keys">keys</a>().</p>
<a name="//apple_ref/cpp/instm/QImageIOPlugin/keys"></a>
<h3 class="fn"><a name="keys"></a><a href="qstringlist.html">QStringList</a> QImageIOPlugin::keys () const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the list of image keys this plugin supports.</p>
<p>These keys are usually the names of the image formats that are implemented in the plugin (e.g&#x2e;, &quot;jpg&quot; or &quot;gif&quot;).</p>
<p>See also <a href="qimageioplugin.html#capabilities">capabilities</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>