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_win.cpp:52 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>QWindowsMime 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>QWindowsMime Class Reference</h1>
|
---|
33 |
|
---|
34 | <p>The QWindowsMime class maps open-standard MIME to Window Clipboard formats.
|
---|
35 | <a href="#details">More...</a>
|
---|
36 | <p><tt>#include <<a href="qmime-h.html">qmime.h</a>></tt>
|
---|
37 | <p><a href="qwindowsmime-members.html">List of all member functions.</a>
|
---|
38 | <h2>Public Members</h2>
|
---|
39 | <ul>
|
---|
40 | <li class=fn><a href="#QWindowsMime"><b>QWindowsMime</b></a> ()</li>
|
---|
41 | <li class=fn>virtual <a href="#~QWindowsMime"><b>~QWindowsMime</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="#countCf"><b>countCf</b></a> () = 0</li>
|
---|
44 | <li class=fn>virtual int <a href="#cf"><b>cf</b></a> ( int index ) = 0</li>
|
---|
45 | <li class=fn>virtual bool <a href="#canConvert"><b>canConvert</b></a> ( const char * mime, int cf ) = 0</li>
|
---|
46 | <li class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int cf ) = 0</li>
|
---|
47 | <li class=fn>virtual int <a href="#cfFor"><b>cfFor</b></a> ( const char * mime ) = 0</li>
|
---|
48 | <li class=fn>virtual QByteArray <a href="#convertToMime"><b>convertToMime</b></a> ( QByteArray data, const char * mime, int cf ) = 0</li>
|
---|
49 | <li class=fn>virtual QByteArray <a href="#convertFromMime"><b>convertFromMime</b></a> ( QByteArray data, const char * mime, int cf ) = 0</li>
|
---|
50 | </ul>
|
---|
51 | <h2>Static Public Members</h2>
|
---|
52 | <ul>
|
---|
53 | <li class=fn>void <a href="#initialize"><b>initialize</b></a> ()</li>
|
---|
54 | <li class=fn>QPtrList<QWindowsMime> <a href="#all"><b>all</b></a> ()</li>
|
---|
55 | <li class=fn>QWindowsMime * <a href="#convertor"><b>convertor</b></a> ( const char * mime, int cf )</li>
|
---|
56 | <li class=fn>const char * <a href="#cfToMime"><b>cfToMime</b></a> ( int cf )</li>
|
---|
57 | </ul>
|
---|
58 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
59 |
|
---|
60 |
|
---|
61 | The QWindowsMime class maps open-standard MIME to Window Clipboard formats.
|
---|
62 |
|
---|
63 |
|
---|
64 |
|
---|
65 | <p> Qt's drag-and-drop and clipboard facilities use the MIME standard.
|
---|
66 | On X11, this maps trivially to the Xdnd protocol, but on Windows
|
---|
67 | although some applications use MIME types to describe clipboard
|
---|
68 | formats, others use arbitrary non-standardized naming conventions,
|
---|
69 | or unnamed built-in formats of Windows.
|
---|
70 | <p> By instantiating subclasses of QWindowsMime that provide conversions
|
---|
71 | between Windows Clipboard and MIME formats, you can convert
|
---|
72 | proprietary clipboard formats to MIME formats.
|
---|
73 | <p> Qt has predefined support for the following Windows Clipboard formats:
|
---|
74 | <ul>
|
---|
75 | <li> CF_UNICODETEXT - converted to "text/plain;charset=ISO-10646-UCS-2"
|
---|
76 | and supported by <a href="qtextdrag.html">QTextDrag</a>.
|
---|
77 | <li> CF_TEXT - converted to "text/plain;charset=system" or "text/plain"
|
---|
78 | and supported by QTextDrag.
|
---|
79 | <li> CF_DIB - converted to "image/*", where * is
|
---|
80 | a <a href="qimage.html#outputFormats">Qt image format</a>,
|
---|
81 | and supported by <a href="qimagedrag.html">QImageDrag</a>.
|
---|
82 | <li> CF_HDROP - converted to "text/uri-list",
|
---|
83 | and supported by <a href="quridrag.html">QUriDrag</a>.
|
---|
84 | </ul>
|
---|
85 | <p> An example use of this class would be to map the Windows Metafile
|
---|
86 | clipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-wmf".
|
---|
87 | This conversion might simply be adding or removing a header, or even
|
---|
88 | just passing on the data. See the
|
---|
89 | <a href="dnd.html">Drag-and-Drop documentation</a> for more information
|
---|
90 | on choosing and definition MIME types.
|
---|
91 | <p> You can check if a MIME type is convertible using <a href="#canConvert">canConvert</a>() and
|
---|
92 | can perform conversions with <a href="#convertToMime">convertToMime</a>() and <a href="#convertFromMime">convertFromMime</a>().
|
---|
93 | <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>.
|
---|
94 |
|
---|
95 | <hr><h2>Member Function Documentation</h2>
|
---|
96 | <h3 class=fn><a name="QWindowsMime"></a>QWindowsMime::QWindowsMime ()
|
---|
97 | </h3>
|
---|
98 | Constructs a new conversion object, adding it to the globally accessed
|
---|
99 | list of available convertors.
|
---|
100 |
|
---|
101 | <h3 class=fn><a name="~QWindowsMime"></a>QWindowsMime::~QWindowsMime ()<tt> [virtual]</tt>
|
---|
102 | </h3>
|
---|
103 | Destroys a conversion object, removing it from the global
|
---|
104 | list of available convertors.
|
---|
105 |
|
---|
106 | <h3 class=fn><a href="qptrlist.html">QPtrList</a><QWindowsMime> <a name="all"></a>QWindowsMime::all ()<tt> [static]</tt>
|
---|
107 | </h3>
|
---|
108 | Returns a list of all currently defined QWindowsMime objects.
|
---|
109 |
|
---|
110 | <h3 class=fn>bool <a name="canConvert"></a>QWindowsMime::canConvert ( const char * mime, int cf )<tt> [pure virtual]</tt>
|
---|
111 | </h3>
|
---|
112 |
|
---|
113 | <p> Returns TRUE if the convertor can convert (both ways) between
|
---|
114 | <em>mime</em> and <em>cf</em>; otherwise returns FALSE.
|
---|
115 | <p> All subclasses must reimplement this pure virtual function.
|
---|
116 |
|
---|
117 | <h3 class=fn>int <a name="cf"></a>QWindowsMime::cf ( int index )<tt> [pure virtual]</tt>
|
---|
118 | </h3>
|
---|
119 |
|
---|
120 | <p> Returns the Windows Clipboard format supported by this convertor
|
---|
121 | that is ordinarily at position <em>index</em>. This means that <a href="#cf">cf</a>(0)
|
---|
122 | returns the first Windows Clipboard format supported, and
|
---|
123 | cf(countCf()-1) returns the last. If <em>index</em> is out of range the
|
---|
124 | return value is undefined.
|
---|
125 | <p> All subclasses must reimplement this pure virtual function.
|
---|
126 |
|
---|
127 | <h3 class=fn>int <a name="cfFor"></a>QWindowsMime::cfFor ( const char * mime )<tt> [pure virtual]</tt>
|
---|
128 | </h3>
|
---|
129 |
|
---|
130 | <p> Returns the Windows Clipboard type used for MIME type <em>mime</em>, or
|
---|
131 | 0 if this convertor does not support <em>mime</em>.
|
---|
132 | <p> All subclasses must reimplement this pure virtual function.
|
---|
133 |
|
---|
134 | <h3 class=fn>const char * <a name="cfToMime"></a>QWindowsMime::cfToMime ( int cf )<tt> [static]</tt>
|
---|
135 | </h3>
|
---|
136 | Returns a MIME type for <em>cf</em>, or 0 if none exists.
|
---|
137 |
|
---|
138 | <h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="convertFromMime"></a>QWindowsMime::convertFromMime ( <a href="qbytearray.html">QByteArray</a> data, const char * mime, int cf )<tt> [pure virtual]</tt>
|
---|
139 | </h3>
|
---|
140 |
|
---|
141 | <p> Returns <em>data</em> converted from MIME type <em>mime</em>
|
---|
142 | to Windows Clipboard format <em>cf</em>.
|
---|
143 | <p> Note that Windows Clipboard formats must all be self-terminating. The
|
---|
144 | return value may contain trailing data.
|
---|
145 | <p> All subclasses must reimplement this pure virtual function.
|
---|
146 |
|
---|
147 | <h3 class=fn><a href="qbytearray.html">QByteArray</a> <a name="convertToMime"></a>QWindowsMime::convertToMime ( <a href="qbytearray.html">QByteArray</a> data, const char * mime, int cf )<tt> [pure virtual]</tt>
|
---|
148 | </h3>
|
---|
149 |
|
---|
150 | <p> Returns <em>data</em> converted from Windows Clipboard format <em>cf</em>
|
---|
151 | to MIME type <em>mime</em>.
|
---|
152 | <p> Note that Windows Clipboard formats must all be self-terminating. The
|
---|
153 | input <em>data</em> may contain trailing data.
|
---|
154 | <p> All subclasses must reimplement this pure virtual function.
|
---|
155 |
|
---|
156 | <h3 class=fn><a href="qwindowsmime.html">QWindowsMime</a> * <a name="convertor"></a>QWindowsMime::convertor ( const char * mime, int cf )<tt> [static]</tt>
|
---|
157 | </h3>
|
---|
158 | Returns the most-recently created QWindowsMime that can convert
|
---|
159 | between the <em>mime</em> and <em>cf</em> formats. Returns 0 if no such convertor
|
---|
160 | exists.
|
---|
161 |
|
---|
162 | <h3 class=fn>const char * <a name="convertorName"></a>QWindowsMime::convertorName ()<tt> [pure virtual]</tt>
|
---|
163 | </h3>
|
---|
164 |
|
---|
165 | <p> Returns a name for the convertor.
|
---|
166 | <p> All subclasses must reimplement this pure virtual function.
|
---|
167 |
|
---|
168 | <h3 class=fn>int <a name="countCf"></a>QWindowsMime::countCf ()<tt> [pure virtual]</tt>
|
---|
169 | </h3>
|
---|
170 |
|
---|
171 | <p> Returns the number of Windows Clipboard formats supported by this
|
---|
172 | convertor.
|
---|
173 | <p> All subclasses must reimplement this pure virtual function.
|
---|
174 |
|
---|
175 | <h3 class=fn>void <a name="initialize"></a>QWindowsMime::initialize ()<tt> [static]</tt>
|
---|
176 | </h3>
|
---|
177 | This is an internal function.
|
---|
178 |
|
---|
179 | <h3 class=fn>const char * <a name="mimeFor"></a>QWindowsMime::mimeFor ( int cf )<tt> [pure virtual]</tt>
|
---|
180 | </h3>
|
---|
181 |
|
---|
182 | <p> Returns the MIME type used for Windows Clipboard format <em>cf</em>, or
|
---|
183 | 0 if this convertor does not support <em>cf</em>.
|
---|
184 | <p> All subclasses must reimplement this pure virtual function.
|
---|
185 |
|
---|
186 | <!-- eof -->
|
---|
187 | <hr><p>
|
---|
188 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
189 | Copyright © 1995-2007
|
---|
190 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
191 | <table width=100% cellspacing=0 border=0><tr>
|
---|
192 | <td>Copyright © 2007
|
---|
193 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
194 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
195 | </table></div></address></body>
|
---|
196 | </html>
|
---|