You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qt3/doc/html/qmacmime.html

182 lines
9.0 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qmime_mac.cpp:64 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QMacMime Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QMacMime Class Reference</h1>
<p>The QMacMime class maps open-standard MIME to Mac flavors.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qmime-h.html">qmime.h</a>&gt;</tt>
<p><a href="qmacmime-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QMacMime"><b>QMacMime</b></a> ( char&nbsp;t )</li>
<li class=fn>virtual <a href="#~QMacMime"><b>~QMacMime</b></a> ()</li>
<li class=fn>virtual const char * <a href="#convertorName"><b>convertorName</b></a> () = 0</li>
<li class=fn>virtual int <a href="#countFlavors"><b>countFlavors</b></a> () = 0</li>
<li class=fn>virtual int <a href="#flavor"><b>flavor</b></a> ( int&nbsp;index ) = 0</li>
<li class=fn>virtual bool <a href="#canConvert"><b>canConvert</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav ) = 0</li>
<li class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int&nbsp;flav ) = 0</li>
<li class=fn>virtual int <a href="#flavorFor"><b>flavorFor</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime ) = 0</li>
<li class=fn>virtual QByteArray <a href="#convertToMime"><b>convertToMime</b></a> ( QValueList&lt;QByteArray&gt;&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav ) = 0</li>
<li class=fn>virtual QValueList&lt;QByteArray&gt; <a href="#convertFromMime"><b>convertFromMime</b></a> ( QByteArray&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav ) = 0</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>QPtrList&lt;QMacMime&gt; <a href="#all"><b>all</b></a> ( QMacMimeType&nbsp;t )</li>
<li class=fn>QMacMime * <a href="#convertor"><b>convertor</b></a> ( QMacMimeType&nbsp;t, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )</li>
<li class=fn>const char * <a href="#flavorToMime"><b>flavorToMime</b></a> ( QMacMimeType&nbsp;t, int&nbsp;flav )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The QMacMime class maps open-standard MIME to Mac flavors.
<p> Qt's drag-and-drop and clipboard facilities use the MIME standard.
On X11, this maps trivially to the Xdnd protocol, but on Mac
although some applications use MIME types to describe clipboard
formats, others use arbitrary non-standardized naming conventions,
or unnamed built-in Mac formats.
<p> By instantiating subclasses of QMacMime that provide conversions
between Mac flavors and MIME formats, you can convert proprietary
clipboard formats to MIME formats.
<p> Qt has predefined support for the following Mac flavors:
<ul>
<li> kScrapFlavorTypeUnicode - converted to "text/plain;charset=ISO-10646-UCS-2"
and supported by <a href="qtextdrag.html">QTextDrag</a>.
<li> kScrapFlavorTypeText - converted to "text/plain;charset=system" or "text/plain"
and supported by QTextDrag.
<li> kScrapFlavorTypePicture - converted to "image/format", where format is
a <a href="qimage.html#outputFormats">Qt image format</a>,
and supported by <a href="qimagedrag.html">QImageDrag</a>.
<li> kDragFlavorTypeHFS - converted to "text/uri-list",
and supported by <a href="quridrag.html">QUriDrag</a>.
</ul>
<p> You can check if a MIME type is convertible using <a href="#canConvert">canConvert</a>() and
can perform conversions with <a href="#convertToMime">convertToMime</a>() and <a href="#convertFromMime">convertFromMime</a>().
<p>See also <a href="draganddrop.html">Drag And Drop Classes</a>, <a href="io.html">Input/Output and Networking</a>, and <a href="misc.html">Miscellaneous Classes</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QMacMime"></a>QMacMime::QMacMime ( char&nbsp;t )
</h3>
Constructs a new conversion object of type <em>t</em>, adding it to the
globally accessed list of available convertors.
<h3 class=fn><a name="~QMacMime"></a>QMacMime::~QMacMime ()<tt> [virtual]</tt>
</h3>
Destroys a conversion object, removing it from the global
list of available convertors.
<h3 class=fn><a href="qptrlist.html">QPtrList</a>&lt;QMacMime&gt; <a name="all"></a>QMacMime::all ( QMacMimeType&nbsp;t )<tt> [static]</tt>
</h3>
Returns a list of all currently defined QMacMime objects of type <em>t</em>.
<h3 class=fn>bool <a name="canConvert"></a>QMacMime::canConvert ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )<tt> [pure virtual]</tt>
</h3>
<p> Returns TRUE if the convertor can convert (both ways) between
<em>mime</em> and <em>flav</em>; otherwise returns FALSE.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn><a href="qvaluelist.html">QValueList</a>&lt;QByteArray&gt; <a name="convertFromMime"></a>QMacMime::convertFromMime ( <a href="qbytearray.html">QByteArray</a>&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )<tt> [pure virtual]</tt>
</h3>
<p> Returns <em>data</em> converted from MIME type <em>mime</em>
to Mac flavor <em>flav</em>.
<p> Note that Mac flavors must all be self-terminating. The return
value may contain trailing data.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="convertToMime"></a>QMacMime::convertToMime ( <a href="qvaluelist.html">QValueList</a>&lt;QByteArray&gt;&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )<tt> [pure virtual]</tt>
</h3>
<p> Returns <em>data</em> converted from Mac flavor <em>flav</em> to MIME type <em>mime</em>.
<p> Note that Mac flavors must all be self-terminating. The input <em>data</em> may contain trailing data.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn><a href="qmacmime.html">QMacMime</a>&nbsp;* <a name="convertor"></a>QMacMime::convertor ( QMacMimeType&nbsp;t, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )<tt> [static]</tt>
</h3>
Returns the most-recently created QMacMime of type <em>t</em> that can convert
between the <em>mime</em> and <em>flav</em> formats. Returns 0 if no such convertor
exists.
<h3 class=fn>const char * <a name="convertorName"></a>QMacMime::convertorName ()<tt> [pure virtual]</tt>
</h3>
<p> Returns a name for the convertor.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn>int <a name="countFlavors"></a>QMacMime::countFlavors ()<tt> [pure virtual]</tt>
</h3>
<p> Returns the number of Mac flavors supported by this convertor.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn>int <a name="flavor"></a>QMacMime::flavor ( int&nbsp;index )<tt> [pure virtual]</tt>
</h3>
<p> Returns the Mac flavor supported by this convertor that is
ordinarily at position <em>index</em>. This means that <a href="#flavor">flavor</a>(0) returns
the first Mac flavor supported, and flavor(countFlavors()-1) returns
the last. If <em>index</em> is out of range the return value is undefined.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn>int <a name="flavorFor"></a>QMacMime::flavorFor ( const&nbsp;char&nbsp;*&nbsp;mime )<tt> [pure virtual]</tt>
</h3>
<p> Returns the Mac flavor used for MIME type <em>mime</em>, or 0 if this
convertor does not support <em>mime</em>.
<p> All subclasses must reimplement this pure virtual function.
<h3 class=fn>const char * <a name="flavorToMime"></a>QMacMime::flavorToMime ( QMacMimeType&nbsp;t, int&nbsp;flav )<tt> [static]</tt>
</h3>
Returns a MIME type of type <em>t</em> for <em>flav</em>, or 0 if none exists.
<h3 class=fn>const char * <a name="mimeFor"></a>QMacMime::mimeFor ( int&nbsp;flav )<tt> [pure virtual]</tt>
</h3>
<p> Returns the MIME type used for Mac flavor <em>flav</em>, or 0 if this
convertor does not support <em>flav</em>.
<p> All subclasses must reimplement this pure virtual function.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>