Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 4606

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- q3mimefactory.cpp -->
  <title>Qt 4.8: Q3MimeSourceFactory Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li>Qt3SupportLight</li>
<li>Q3MimeSourceFactory</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">Q3MimeSourceFactory Class Reference</h1>
<!-- $$$Q3MimeSourceFactory-brief -->
<p>The Q3MimeSourceFactory class is an extensible provider of mime-typed data. <a href="#details">More...</a></p>
<!-- @@@Q3MimeSourceFactory -->
<pre class="cpp"> <span class="preprocessor">#include &lt;Q3MimeSourceFactory&gt;</span></pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See <a href="porting4.html#qmimesourcefactory">Porting to Qt 4</a> for more information.</p>
<ul>
<li><a href="q3mimesourcefactory-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#Q3MimeSourceFactory">Q3MimeSourceFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#dtor.Q3MimeSourceFactory">~Q3MimeSourceFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#addFilePath">addFilePath</a></b> ( const QString &amp; <i>p</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual const QMimeSource * </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#data">data</a></b> ( const QString &amp; <i>abs_name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QMimeSource * </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#data-2">data</a></b> ( const QString &amp; <i>abs_or_rel_name</i>, const QString &amp; <i>context</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QStringList </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#filePath">filePath</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QString </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#makeAbsolute">makeAbsolute</a></b> ( const QString &amp; <i>abs_or_rel_name</i>, const QString &amp; <i>context</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setData">setData</a></b> ( const QString &amp; <i>abs_name</i>, QMimeSource * <i>data</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a></b> ( const QString &amp; <i>ext</i>, const char * <i>mimetype</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setFilePath">setFilePath</a></b> ( const QStringList &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setFilePath-2">setFilePath</a></b> ( const QString &amp; <i>path</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setImage">setImage</a></b> ( const QString &amp; <i>abs_name</i>, const QImage &amp; <i>image</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setPixmap">setPixmap</a></b> ( const QString &amp; <i>abs_name</i>, const QPixmap &amp; <i>pixmap</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setText">setText</a></b> ( const QString &amp; <i>abs_name</i>, const QString &amp; <i>text</i> )</td></tr>
</table>
<a name="static-public-members"></a>
<h2>Static Public Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#addFactory">addFactory</a></b> ( Q3MimeSourceFactory * <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q3MimeSourceFactory * </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#removeFactory">removeFactory</a></b> ( Q3MimeSourceFactory * <i>f</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#setDefaultFactory">setDefaultFactory</a></b> ( Q3MimeSourceFactory * <i>factory</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Q3MimeSourceFactory * </td><td class="memItemRight bottomAlign"><b><a href="q3mimesourcefactory.html#takeDefaultFactory">takeDefaultFactory</a></b> ()</td></tr>
</table>
<a name="details"></a>
<!-- $$$Q3MimeSourceFactory-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The Q3MimeSourceFactory class is an extensible provider of mime-typed data.</p>
<p>A Q3MimeSourceFactory provides an abstract interface to a collection of information. Each piece of information is represented by a <a href="qmimesource.html" class="obsolete">QMimeSource</a> object which can be examined and converted to concrete data types by functions such as <a href="q3imagedrag.html#canDecode">Q3ImageDrag::canDecode</a>() and <a href="q3imagedrag.html#decode">Q3ImageDrag::decode</a>().</p>
<p>The base Q3MimeSourceFactory can be used in two ways: as an abstraction of a collection of files or as specifically stored data. For it to access files, call <a href="q3mimesourcefactory.html#setFilePath">setFilePath</a>() before accessing data. For stored data, call <a href="q3mimesourcefactory.html#setData">setData</a>() for each item (there are also convenience functions, e.g&#x2e; <a href="q3mimesourcefactory.html#setText">setText</a>(), <a href="q3mimesourcefactory.html#setImage">setImage</a>() and <a href="q3mimesourcefactory.html#setPixmap">setPixmap</a>(), that simply call <a href="q3mimesourcefactory.html#setData">setData</a>() with appropriate parameters).</p>
<p>The rich text widgets, <a href="qtextedit.html">QTextEdit</a> and <a href="qtextbrowser.html">QTextBrowser</a>, use Q3MimeSourceFactory to resolve references such as images or links within rich text documents. They either access the default factory (see <a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>()) or their own. Other classes that are capable of displaying rich text (such as <a href="qlabel.html">QLabel</a>, <a href="qwhatsthis.html">QWhatsThis</a> or <a href="qmessagebox.html">QMessageBox</a>) always use the default factory.</p>
<p>A factory can also be used as a container to store data associated with a name. This technique is useful whenever rich text contains images that are stored in the program itself, not loaded from the hard disk. Your program may, for example, define some image data as:</p>
<pre class="cpp"> <span class="keyword">static</span> <span class="keyword">const</span> <span class="type">char</span><span class="operator">*</span> myimage_data<span class="operator">[</span><span class="operator">]</span><span class="operator">=</span>{
 <span class="string">&quot;...&quot;</span><span class="operator">,</span>
 <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
 <span class="string">&quot;...&quot;</span>};</pre>
<p>To be able to use this image within some rich text, for example inside a <a href="qlabel.html">QLabel</a>, you must create a <a href="qimage.html">QImage</a> from the raw data and insert it into the factory with a unique name:</p>
<pre class="cpp"> <span class="type">Q3MimeSourceFactory</span><span class="operator">::</span><a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>()<span class="operator">-</span><span class="operator">&gt;</span><a href="q3mimesourcefactory.html#setImage">setImage</a>(<span class="string">&quot;myimage&quot;</span><span class="operator">,</span> <span class="type"><a href="qimage.html">QImage</a></span>(myimage_data));</pre>
<p>Now you can create a rich text <a href="qlabel.html">QLabel</a> with</p>
<pre class="cpp"> <span class="type"><a href="qlabel.html">QLabel</a></span><span class="operator">*</span> label <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qlabel.html">QLabel</a></span>(
     <span class="string">&quot;Rich text with embedded image:&lt;img source=\&quot;myimage\&quot;&gt;&quot;</span>
     <span class="string">&quot;Isn't that &lt;em&gt;cute&lt;/em&gt;?&quot;</span>);</pre>
<p>When no longer needed, you can clear the data from the factory:</p>
<pre class="cpp"> <span class="keyword">delete</span> label;
 <span class="type">Q3MimeSourceFactory</span><span class="operator">::</span><a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>()<span class="operator">-</span><span class="operator">&gt;</span><a href="q3mimesourcefactory.html#setData">setData</a>(<span class="string">&quot;myimage&quot;</span><span class="operator">,</span> <span class="number">0</span>);</pre>
</div>
<!-- @@@Q3MimeSourceFactory -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Q3MimeSourceFactory[overload1]$$$Q3MimeSourceFactory -->
<h3 class="fn"><a name="Q3MimeSourceFactory"></a>Q3MimeSourceFactory::<span class="name">Q3MimeSourceFactory</span> ()</h3>
<p>Constructs a <a href="q3mimesourcefactory.html" class="compat">Q3MimeSourceFactory</a> that has no file path and no stored content.</p>
<!-- @@@Q3MimeSourceFactory -->
<!-- $$$~Q3MimeSourceFactory[overload1]$$$~Q3MimeSourceFactory -->
<h3 class="fn"><a name="dtor.Q3MimeSourceFactory"></a>Q3MimeSourceFactory::<span class="name">~Q3MimeSourceFactory</span> ()<tt> [virtual]</tt></h3>
<p>Destroys the <a href="q3mimesourcefactory.html" class="compat">Q3MimeSourceFactory</a>, deleting all stored content.</p>
<!-- @@@~Q3MimeSourceFactory -->
<!-- $$$addFactory[overload1]$$$addFactoryQ3MimeSourceFactory* -->
<h3 class="fn"><a name="addFactory"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">addFactory</span> ( <span class="type">Q3MimeSourceFactory</span> * <i>f</i> )<tt> [static]</tt></h3>
<p>Adds the <a href="q3mimesourcefactory.html" class="compat">Q3MimeSourceFactory</a> <i>f</i> to the list of available mimesource factories. If the <a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>() can't resolve a <a href="q3mimesourcefactory.html#data">data</a>() it iterates over the list of installed mimesource factories until the data can be resolved.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#removeFactory">removeFactory</a>().</p>
<!-- @@@addFactory -->
<!-- $$$addFilePath[overload1]$$$addFilePathconstQString& -->
<h3 class="fn"><a name="addFilePath"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">addFilePath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>p</i> )</h3>
<p>Adds another search path, <i>p</i> to the existing search paths.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#setFilePath">setFilePath</a>().</p>
<!-- @@@addFilePath -->
<!-- $$$data[overload1]$$$dataconstQString& -->
<h3 class="fn"><a name="data"></a>const <span class="type"><a href="qmimesource.html">QMimeSource</a></span> * Q3MimeSourceFactory::<span class="name">data</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_name</i> ) const<tt> [virtual]</tt></h3>
<p>Returns a reference to the data associated with <i>abs_name</i>. The return value remains valid only until the next data() or <a href="q3mimesourcefactory.html#setData">setData</a>() call, so you should immediately decode the result.</p>
<p>If there is no data associated with <i>abs_name</i> in the factory's store, the factory tries to access the local filesystem. If <i>abs_name</i> isn't an absolute file name, the factory will search for it in all defined paths (see <a href="q3mimesourcefactory.html#setFilePath">setFilePath</a>()).</p>
<p>The factory understands all the image formats supported by <a href="qimagereader.html">QImageReader</a>. Any other mime types are determined by the file name extension. The default settings are</p>
<pre class="cpp"> <a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a>(<span class="string">&quot;html&quot;</span><span class="operator">,</span> <span class="string">&quot;text/html;charset=iso8859-1&quot;</span>);
 <a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a>(<span class="string">&quot;htm&quot;</span><span class="operator">,</span> <span class="string">&quot;text/html;charset=iso8859-1&quot;</span>);
 <a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a>(<span class="string">&quot;txt&quot;</span><span class="operator">,</span> <span class="string">&quot;text/plain&quot;</span>);
 <a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a>(<span class="string">&quot;xml&quot;</span><span class="operator">,</span> <span class="string">&quot;text/xml;charset=UTF-8&quot;</span>);</pre>
<p>The effect of these is that file names ending in &quot;txt&quot; will be treated as text encoded in the local encoding; those ending in &quot;xml&quot; will be treated as text encoded in Unicode UTF-8 encoding. The text/html type is treated specially, since the encoding can be specified in the html file itself. &quot;html&quot; or &quot;htm&quot; will be treated as text encoded in the encoding specified by the html meta tag, if none could be found, the charset of the mime type will be used. The text subtype (&quot;html&quot;, &quot;plain&quot;, or &quot;xml&quot;) does not affect the factory, but users of the factory may behave differently. We recommend creating &quot;xml&quot; files where practical. These files can be viewed regardless of the runtime encoding and can encode any Unicode characters without resorting to encoding definitions inside the file.</p>
<p>Any file data that is not recognized will be retrieved as a <a href="qmimesource.html" class="obsolete">QMimeSource</a> providing the &quot;application/octet-stream&quot; mime type, meaning uninterpreted binary data.</p>
<p>You can add further extensions or change existing ones with subsequent calls to <a href="q3mimesourcefactory.html#setExtensionType">setExtensionType</a>(). If the extension mechanism is not sufficient for your problem domain, you can inherit <a href="q3mimesourcefactory.html" class="compat">Q3MimeSourceFactory</a> and reimplement this function to perform some more specialized mime-type detection. The same applies if you want to use the mime source factory to access URL referenced data over a network.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#setData">setData</a>().</p>
<!-- @@@data -->
<!-- $$$data$$$dataconstQString&constQString& -->
<h3 class="fn"><a name="data-2"></a>const <span class="type"><a href="qmimesource.html">QMimeSource</a></span> * Q3MimeSourceFactory::<span class="name">data</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_or_rel_name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>context</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>A convenience function. See data(const <a href="qstring.html">QString</a>&amp; abs_name). The file name is given in <i>abs_or_rel_name</i> and the path is in <i>context</i>.</p>
<!-- @@@data -->
<!-- $$$defaultFactory[overload1]$$$defaultFactory -->
<h3 class="fn"><a name="defaultFactory"></a><span class="type">Q3MimeSourceFactory</span> * Q3MimeSourceFactory::<span class="name">defaultFactory</span> ()<tt> [static]</tt></h3>
<p>Returns the application-wide default mime source factory. This factory is used by rich text rendering classes such as <a href="porting4.html#qsimplerichtext">QSimpleRichText</a>, <a href="qwhatsthis.html">QWhatsThis</a> and <a href="qmessagebox.html">QMessageBox</a> to resolve named references within rich text documents. It serves also as the initial factory for the more complex render widgets, <a href="qtextedit.html">QTextEdit</a> and <a href="qtextbrowser.html">QTextBrowser</a>.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#setDefaultFactory">setDefaultFactory</a>().</p>
<!-- @@@defaultFactory -->
<!-- $$$filePath[overload1]$$$filePath -->
<h3 class="fn"><a name="filePath"></a><span class="type"><a href="qstringlist.html">QStringList</a></span> Q3MimeSourceFactory::<span class="name">filePath</span> () const<tt> [virtual]</tt></h3>
<p>Returns the currently set search paths.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#setFilePath">setFilePath</a>().</p>
<!-- @@@filePath -->
<!-- $$$makeAbsolute[overload1]$$$makeAbsoluteconstQString&constQString& -->
<h3 class="fn"><a name="makeAbsolute"></a><span class="type"><a href="qstring.html">QString</a></span> Q3MimeSourceFactory::<span class="name">makeAbsolute</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_or_rel_name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>context</i> ) const<tt> [virtual]</tt></h3>
<p>Converts the absolute or relative data item name <i>abs_or_rel_name</i> to an absolute name, interpreted within the context (path) of the data item named <i>context</i> (this must be an absolute name).</p>
<!-- @@@makeAbsolute -->
<!-- $$$removeFactory[overload1]$$$removeFactoryQ3MimeSourceFactory* -->
<h3 class="fn"><a name="removeFactory"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">removeFactory</span> ( <span class="type">Q3MimeSourceFactory</span> * <i>f</i> )<tt> [static]</tt></h3>
<p>Removes the mimesource factory <i>f</i> from the list of available mimesource factories.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#addFactory">addFactory</a>().</p>
<!-- @@@removeFactory -->
<!-- $$$setData[overload1]$$$setDataconstQString&QMimeSource* -->
<h3 class="fn"><a name="setData"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setData</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_name</i>, <span class="type"><a href="qmimesource.html">QMimeSource</a></span> * <i>data</i> )<tt> [virtual]</tt></h3>
<p>Sets <i>data</i> to be the data item associated with the absolute name <i>abs_name</i>. Note that the ownership of <i>data</i> is transferred to the factory: do not delete or access the pointer after passing it to this function.</p>
<p>Passing 0 for data removes previously stored data.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#data">data</a>().</p>
<!-- @@@setData -->
<!-- $$$setDefaultFactory[overload1]$$$setDefaultFactoryQ3MimeSourceFactory* -->
<h3 class="fn"><a name="setDefaultFactory"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setDefaultFactory</span> ( <span class="type">Q3MimeSourceFactory</span> * <i>factory</i> )<tt> [static]</tt></h3>
<p>Sets the default <i>factory</i>, destroying any previously set mime source provider. The ownership of the factory is transferred to Qt.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>().</p>
<!-- @@@setDefaultFactory -->
<!-- $$$setExtensionType[overload1]$$$setExtensionTypeconstQString&constchar* -->
<h3 class="fn"><a name="setExtensionType"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setExtensionType</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>ext</i>, const <span class="type">char</span> * <i>mimetype</i> )<tt> [virtual]</tt></h3>
<p>Sets the mime-type to be associated with the file name extension, <i>ext</i> to <i>mimetype</i>. This determines the mime-type for files found via the paths set by <a href="q3mimesourcefactory.html#setFilePath">setFilePath</a>().</p>
<!-- @@@setExtensionType -->
<!-- $$$setFilePath[overload1]$$$setFilePathconstQStringList& -->
<h3 class="fn"><a name="setFilePath"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setFilePath</span> ( const <span class="type"><a href="qstringlist.html">QStringList</a></span> &amp; <i>path</i> )<tt> [virtual]</tt></h3>
<p>Sets the list of directories that will be searched when named data is requested to those given in the string list <i>path</i>.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#filePath">filePath</a>().</p>
<!-- @@@setFilePath -->
<!-- $$$setFilePath$$$setFilePathconstQString& -->
<h3 class="fn"><a name="setFilePath-2"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setFilePath</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>path</i> )</h3>
<p>Sets the list of directories that will be searched when named data is requested to those given in the string list <i>path</i>.</p>
<p><b>See also </b><a href="q3mimesourcefactory.html#filePath">filePath</a>().</p>
<!-- @@@setFilePath -->
<!-- $$$setImage[overload1]$$$setImageconstQString&constQImage& -->
<h3 class="fn"><a name="setImage"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setImage</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_name</i>, const <span class="type"><a href="qimage.html">QImage</a></span> &amp; <i>image</i> )<tt> [virtual]</tt></h3>
<p>Sets <i>image</i> to be the data item associated with the absolute name <i>abs_name</i>.</p>
<p>Equivalent to setData(abs_name, new <a href="q3imagedrag.html" class="compat">Q3ImageDrag</a>(image)).</p>
<!-- @@@setImage -->
<!-- $$$setPixmap[overload1]$$$setPixmapconstQString&constQPixmap& -->
<h3 class="fn"><a name="setPixmap"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setPixmap</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_name</i>, const <span class="type"><a href="qpixmap.html">QPixmap</a></span> &amp; <i>pixmap</i> )<tt> [virtual]</tt></h3>
<p>Sets <i>pixmap</i> to be the data item associated with the absolute name <i>abs_name</i>.</p>
<!-- @@@setPixmap -->
<!-- $$$setText[overload1]$$$setTextconstQString&constQString& -->
<h3 class="fn"><a name="setText"></a><span class="type">void</span> Q3MimeSourceFactory::<span class="name">setText</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>abs_name</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )<tt> [virtual]</tt></h3>
<p>Sets <i>text</i> to be the data item associated with the absolute name <i>abs_name</i>.</p>
<p>Equivalent to setData(abs_name, new <a href="q3textdrag.html" class="compat">Q3TextDrag</a>(text)).</p>
<!-- @@@setText -->
<!-- $$$takeDefaultFactory[overload1]$$$takeDefaultFactory -->
<h3 class="fn"><a name="takeDefaultFactory"></a><span class="type">Q3MimeSourceFactory</span> * Q3MimeSourceFactory::<span class="name">takeDefaultFactory</span> ()<tt> [static]</tt></h3>
<p>Sets the <a href="q3mimesourcefactory.html#defaultFactory">defaultFactory</a>() to 0 and returns the previous one.</p>
<!-- @@@takeDefaultFactory -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2015 The Qt Company Ltd.
      Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Qt and respective logos are trademarks of The Qt Company Ltd 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>