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"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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 <<a href="qmime-h.html">qmime.h</a>></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 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 index ) = 0</li>
|
---|
45 | <li class=fn>virtual bool <a href="#canConvert"><b>canConvert</b></a> ( const char * mime, int flav ) = 0</li>
|
---|
46 | <li class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int flav ) = 0</li>
|
---|
47 | <li class=fn>virtual int <a href="#flavorFor"><b>flavorFor</b></a> ( const char * mime ) = 0</li>
|
---|
48 | <li class=fn>virtual QByteArray <a href="#convertToMime"><b>convertToMime</b></a> ( QValueList<QByteArray> data, const char * mime, int flav ) = 0</li>
|
---|
49 | <li class=fn>virtual QValueList<QByteArray> <a href="#convertFromMime"><b>convertFromMime</b></a> ( QByteArray data, const char * mime, int flav ) = 0</li>
|
---|
50 | </ul>
|
---|
51 | <h2>Static Public Members</h2>
|
---|
52 | <ul>
|
---|
53 | <li class=fn>QPtrList<QMacMime> <a href="#all"><b>all</b></a> ( QMacMimeType t )</li>
|
---|
54 | <li class=fn>QMacMime * <a href="#convertor"><b>convertor</b></a> ( QMacMimeType t, const char * mime, int flav )</li>
|
---|
55 | <li class=fn>const char * <a href="#flavorToMime"><b>flavorToMime</b></a> ( QMacMimeType t, int flav )</li>
|
---|
56 | </ul>
|
---|
57 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
58 |
|
---|
59 |
|
---|
60 | The 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.
|
---|
65 | On X11, this maps trivially to the Xdnd protocol, but on Mac
|
---|
66 | although some applications use MIME types to describe clipboard
|
---|
67 | formats, others use arbitrary non-standardized naming conventions,
|
---|
68 | or unnamed built-in Mac formats.
|
---|
69 | <p> By instantiating subclasses of QMacMime that provide conversions
|
---|
70 | between Mac flavors and MIME formats, you can convert proprietary
|
---|
71 | clipboard 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"
|
---|
75 | and supported by <a href="qtextdrag.html">QTextDrag</a>.
|
---|
76 | <li> kScrapFlavorTypeText - converted to "text/plain;charset=system" or "text/plain"
|
---|
77 | and supported by QTextDrag.
|
---|
78 | <li> kScrapFlavorTypePicture - converted to "image/format", where format is
|
---|
79 | a <a href="qimage.html#outputFormats">Qt image format</a>,
|
---|
80 | and supported by <a href="qimagedrag.html">QImageDrag</a>.
|
---|
81 | <li> kDragFlavorTypeHFS - converted to "text/uri-list",
|
---|
82 | and 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
|
---|
85 | can 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 t )
|
---|
90 | </h3>
|
---|
91 | Constructs a new conversion object of type <em>t</em>, adding it to the
|
---|
92 | globally accessed list of available convertors.
|
---|
93 |
|
---|
94 | <h3 class=fn><a name="~QMacMime"></a>QMacMime::~QMacMime ()<tt> [virtual]</tt>
|
---|
95 | </h3>
|
---|
96 | Destroys a conversion object, removing it from the global
|
---|
97 | list of available convertors.
|
---|
98 |
|
---|
99 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QMacMime> <a name="all"></a>QMacMime::all ( QMacMimeType t )<tt> [static]</tt>
|
---|
100 | </h3>
|
---|
101 | Returns 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 char * mime, int 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><QByteArray> <a name="convertFromMime"></a>QMacMime::convertFromMime ( <a href="qbytearray.html">QByteArray</a> data, const char * mime, int flav )<tt> [pure virtual]</tt>
|
---|
111 | </h3>
|
---|
112 |
|
---|
113 | <p> Returns <em>data</em> converted from MIME type <em>mime</em>
|
---|
114 | to Mac flavor <em>flav</em>.
|
---|
115 | <p> Note that Mac flavors must all be self-terminating. The return
|
---|
116 | value 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><QByteArray> data, const char * mime, int 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> * <a name="convertor"></a>QMacMime::convertor ( QMacMimeType t, const char * mime, int flav )<tt> [static]</tt>
|
---|
127 | </h3>
|
---|
128 | Returns the most-recently created QMacMime of type <em>t</em> that can convert
|
---|
129 | between the <em>mime</em> and <em>flav</em> formats. Returns 0 if no such convertor
|
---|
130 | exists.
|
---|
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 index )<tt> [pure virtual]</tt>
|
---|
145 | </h3>
|
---|
146 |
|
---|
147 | <p> Returns the Mac flavor supported by this convertor that is
|
---|
148 | ordinarily at position <em>index</em>. This means that <a href="#flavor">flavor</a>(0) returns
|
---|
149 | the first Mac flavor supported, and flavor(countFlavors()-1) returns
|
---|
150 | the 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 char * 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
|
---|
157 | convertor 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 t, int flav )<tt> [static]</tt>
|
---|
161 | </h3>
|
---|
162 | Returns 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 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
|
---|
168 | convertor does not support <em>flav</em>.
|
---|
169 | <p> All subclasses must reimplement this pure virtual function.
|
---|
170 |
|
---|
171 | <!-- eof -->
|
---|
172 | <hr><p>
|
---|
173 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
174 | Copyright © 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 © 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>
|
---|