source: trunk/doc/html/qmacmime.html@ 208

Last change on this file since 208 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 9.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qmime_mac.cpp:64 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QMacMime Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<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>
33
34<p>The QMacMime class maps open-standard MIME to Mac flavors.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qmime-h.html">qmime.h</a>&gt;</tt>
37<p><a href="qmacmime-members.html">List of all member functions.</a>
38<h2>Public Members</h2>
39<ul>
40<li class=fn><a href="#QMacMime"><b>QMacMime</b></a> ( char&nbsp;t )</li>
41<li class=fn>virtual <a href="#~QMacMime"><b>~QMacMime</b></a> ()</li>
42<li class=fn>virtual const char * <a href="#convertorName"><b>convertorName</b></a> () = 0</li>
43<li class=fn>virtual int <a href="#countFlavors"><b>countFlavors</b></a> () = 0</li>
44<li class=fn>virtual int <a href="#flavor"><b>flavor</b></a> ( int&nbsp;index ) = 0</li>
45<li class=fn>virtual bool <a href="#canConvert"><b>canConvert</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav ) = 0</li>
46<li class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int&nbsp;flav ) = 0</li>
47<li class=fn>virtual int <a href="#flavorFor"><b>flavorFor</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime ) = 0</li>
48<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>
49<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>
50</ul>
51<h2>Static Public Members</h2>
52<ul>
53<li class=fn>QPtrList&lt;QMacMime&gt; <a href="#all"><b>all</b></a> ( QMacMimeType&nbsp;t )</li>
54<li class=fn>QMacMime * <a href="#convertor"><b>convertor</b></a> ( QMacMimeType&nbsp;t, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )</li>
55<li class=fn>const char * <a href="#flavorToMime"><b>flavorToMime</b></a> ( QMacMimeType&nbsp;t, int&nbsp;flav )</li>
56</ul>
57<hr><a name="details"></a><h2>Detailed Description</h2>
58
59
60The QMacMime class maps open-standard MIME to Mac flavors.
61
62
63
64<p> Qt's drag-and-drop and clipboard facilities use the MIME standard.
65On X11, this maps trivially to the Xdnd protocol, but on Mac
66although some applications use MIME types to describe clipboard
67formats, others use arbitrary non-standardized naming conventions,
68or unnamed built-in Mac formats.
69<p> By instantiating subclasses of QMacMime that provide conversions
70between Mac flavors and MIME formats, you can convert proprietary
71clipboard formats to MIME formats.
72<p> Qt has predefined support for the following Mac flavors:
73<ul>
74<li> kScrapFlavorTypeUnicode - converted to "text/plain;charset=ISO-10646-UCS-2"
75and supported by <a href="qtextdrag.html">QTextDrag</a>.
76<li> kScrapFlavorTypeText - converted to "text/plain;charset=system" or "text/plain"
77and supported by QTextDrag.
78<li> kScrapFlavorTypePicture - converted to "image/format", where format is
79a <a href="qimage.html#outputFormats">Qt image format</a>,
80and supported by <a href="qimagedrag.html">QImageDrag</a>.
81<li> kDragFlavorTypeHFS - converted to "text/uri-list",
82and supported by <a href="quridrag.html">QUriDrag</a>.
83</ul>
84<p> You can check if a MIME type is convertible using <a href="#canConvert">canConvert</a>() and
85can perform conversions with <a href="#convertToMime">convertToMime</a>() and <a href="#convertFromMime">convertFromMime</a>().
86<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>.
87
88<hr><h2>Member Function Documentation</h2>
89<h3 class=fn><a name="QMacMime"></a>QMacMime::QMacMime ( char&nbsp;t )
90</h3>
91Constructs a new conversion object of type <em>t</em>, adding it to the
92globally accessed list of available convertors.
93
94<h3 class=fn><a name="~QMacMime"></a>QMacMime::~QMacMime ()<tt> [virtual]</tt>
95</h3>
96Destroys a conversion object, removing it from the global
97list of available convertors.
98
99<h3 class=fn><a href="qptrlist.html">QPtrList</a>&lt;QMacMime&gt; <a name="all"></a>QMacMime::all ( QMacMimeType&nbsp;t )<tt> [static]</tt>
100</h3>
101Returns a list of all currently defined QMacMime objects of type <em>t</em>.
102
103<h3 class=fn>bool <a name="canConvert"></a>QMacMime::canConvert ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;flav )<tt> [pure virtual]</tt>
104</h3>
105
106<p> Returns TRUE if the convertor can convert (both ways) between
107<em>mime</em> and <em>flav</em>; otherwise returns FALSE.
108<p> All subclasses must reimplement this pure virtual function.
109
110<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>
111</h3>
112
113<p> Returns <em>data</em> converted from MIME type <em>mime</em>
114to Mac flavor <em>flav</em>.
115<p> Note that Mac flavors must all be self-terminating. The return
116value may contain trailing data.
117<p> All subclasses must reimplement this pure virtual function.
118
119<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>
120</h3>
121
122<p> Returns <em>data</em> converted from Mac flavor <em>flav</em> to MIME type <em>mime</em>.
123<p> Note that Mac flavors must all be self-terminating. The input <em>data</em> may contain trailing data.
124<p> All subclasses must reimplement this pure virtual function.
125
126<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>
127</h3>
128Returns the most-recently created QMacMime of type <em>t</em> that can convert
129between the <em>mime</em> and <em>flav</em> formats. Returns 0 if no such convertor
130exists.
131
132<h3 class=fn>const char * <a name="convertorName"></a>QMacMime::convertorName ()<tt> [pure virtual]</tt>
133</h3>
134
135<p> Returns a name for the convertor.
136<p> All subclasses must reimplement this pure virtual function.
137
138<h3 class=fn>int <a name="countFlavors"></a>QMacMime::countFlavors ()<tt> [pure virtual]</tt>
139</h3>
140
141<p> Returns the number of Mac flavors supported by this convertor.
142<p> All subclasses must reimplement this pure virtual function.
143
144<h3 class=fn>int <a name="flavor"></a>QMacMime::flavor ( int&nbsp;index )<tt> [pure virtual]</tt>
145</h3>
146
147<p> Returns the Mac flavor supported by this convertor that is
148ordinarily at position <em>index</em>. This means that <a href="#flavor">flavor</a>(0) returns
149the first Mac flavor supported, and flavor(countFlavors()-1) returns
150the last. If <em>index</em> is out of range the return value is undefined.
151<p> All subclasses must reimplement this pure virtual function.
152
153<h3 class=fn>int <a name="flavorFor"></a>QMacMime::flavorFor ( const&nbsp;char&nbsp;*&nbsp;mime )<tt> [pure virtual]</tt>
154</h3>
155
156<p> Returns the Mac flavor used for MIME type <em>mime</em>, or 0 if this
157convertor does not support <em>mime</em>.
158<p> All subclasses must reimplement this pure virtual function.
159
160<h3 class=fn>const char * <a name="flavorToMime"></a>QMacMime::flavorToMime ( QMacMimeType&nbsp;t, int&nbsp;flav )<tt> [static]</tt>
161</h3>
162Returns a MIME type of type <em>t</em> for <em>flav</em>, or 0 if none exists.
163
164<h3 class=fn>const char * <a name="mimeFor"></a>QMacMime::mimeFor ( int&nbsp;flav )<tt> [pure virtual]</tt>
165</h3>
166
167<p> Returns the MIME type used for Mac flavor <em>flav</em>, or 0 if this
168convertor does not support <em>flav</em>.
169<p> All subclasses must reimplement this pure virtual function.
170
171<!-- eof -->
172<hr><p>
173This file is part of the <a href="index.html">Qt toolkit</a>.
174Copyright &copy; 1995-2007
175<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
176<table width=100% cellspacing=0 border=0><tr>
177<td>Copyright &copy; 2007
178<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
179<td align=right><div align=right>Qt 3.3.8</div>
180</table></div></address></body>
181</html>
Note: See TracBrowser for help on using the repository browser.