📄 qwindowsmime.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qmime_win.cpp:53 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QWindowsMime Class</title><style type="text/css"><!--h3.fn,span.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 Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped 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>QWindowsMime Class Reference</h1><p>The QWindowsMime class maps open-standard MIME to Window Clipboard formats.<a href="#details">More...</a><p><tt>#include <<a href="qmime-h.html">qmime.h</a>></tt><p><a href="qwindowsmime-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QWindowsMime"><b>QWindowsMime</b></a> ()</div></li><li><div class=fn>virtual <a href="#~QWindowsMime"><b>~QWindowsMime</b></a> ()</div></li><li><div class=fn>virtual const char * <a href="#convertorName"><b>convertorName</b></a> () = 0</div></li><li><div class=fn>virtual int <a href="#countCf"><b>countCf</b></a> () = 0</div></li><li><div class=fn>virtual int <a href="#cf"><b>cf</b></a> ( int index ) = 0</div></li><li><div class=fn>virtual bool <a href="#canConvert"><b>canConvert</b></a> ( const char * mime, int cf ) = 0</div></li><li><div class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int cf ) = 0</div></li><li><div class=fn>virtual int <a href="#cfFor"><b>cfFor</b></a> ( const char * mime ) = 0</div></li><li><div class=fn>virtual QByteArray <a href="#convertToMime"><b>convertToMime</b></a> ( QByteArray data, const char * mime, int cf ) = 0</div></li><li><div class=fn>virtual QByteArray <a href="#convertFromMime"><b>convertFromMime</b></a> ( QByteArray data, const char * mime, int cf ) = 0</div></li></ul><h2>Static Public Members</h2><ul><li><div class=fn>void <a href="#initialize"><b>initialize</b></a> ()</div></li><li><div class=fn>QPtrList<QWindowsMime> <a href="#all"><b>all</b></a> ()</div></li><li><div class=fn>QWindowsMime * <a href="#convertor"><b>convertor</b></a> ( const char * mime, int cf )</div></li><li><div class=fn>const char * <a href="#cfToMime"><b>cfToMime</b></a> ( int cf )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QWindowsMime class maps open-standard MIME to Window Clipboard formats.<p> Qt's drag-and-drop and clipboard facilities use the MIME standard.On X11, this maps trivially to the Xdnd protocol, but on Windowsalthough some applications use MIME types to describe clipboardformats, others use arbitrary non-standardized naming conventions,or unnamed built-in formats of Windows.<p> By instantiating subclasses of QWindowsMime that provide conversionsbetween Windows Clipboard and MIME formats, you can convertproprietary clipboard formats to MIME formats.<p> Qt has predefined support for the following Windows Clipboard formats:<ul><li> CF_UNICODETEXT - converted to "text/plain;charset=ISO-10646-UCS-2"and supported by <a href="qtextdrag.html">QTextDrag</a>.<li> CF_TEXT - converted to "text/plain;charset=system" or "text/plain"and supported by QTextDrag.<li> CF_DIB - converted to "image/*", where * isa <a href="qimage.html#outputFormats">Qt image format</a>,and supported by <a href="qimagedrag.html">QImageDrag</a>.<li> CF_HDROP - converted to "text/uri-list",and supported by <a href="quridrag.html">QUriDrag</a>.</ul><p> An example use of this class would be to map the Windows Metafileclipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-wmf".This conversion might simply be adding or removing a header, or evenjust passing on the data. See the<a href="dnd.html">Drag-and-Drop documentation</a> for more informationon choosing and definition MIME types.<p> You can check if a MIME type is convertible using <a href="#canConvert">canConvert</a>() andcan 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="QWindowsMime"></a>QWindowsMime::QWindowsMime ()</h3>Constructs a new conversion object, adding it to the globally accessedlist of available convertors.<h3 class=fn><a name="~QWindowsMime"></a>QWindowsMime::~QWindowsMime ()<tt> [virtual]</tt></h3>Destroys a conversion object, removing it from the globallist of available convertors.<h3 class=fn><a href="qptrlist.html">QPtrList</a><QWindowsMime> <a name="all"></a>QWindowsMime::all ()<tt> [static]</tt></h3>Returns a list of all currently defined QWindowsMime objects.<h3 class=fn>bool <a name="canConvert"></a>QWindowsMime::canConvert ( const char * mime, int cf )<tt> [pure virtual]</tt></h3><p> Returns TRUE if the convertor can convert (both ways) between<em>mime</em> and <em>cf</em>; otherwise returns FALSE.<p> All subclasses must reimplement this pure virtual function.<h3 class=fn>int <a name="cf"></a>QWindowsMime::cf ( int index )<tt> [pure virtual]</tt></h3><p> Returns the Windows Clipboard format supported by this convertorthat is ordinarily at position <em>index</em>. This means that <a href="#cf">cf</a>(0)returns the first Windows Clipboard format supported, andcf(countCf()-1) returns the last. If <em>index</em> is out of range thereturn value is undefined.<p> All subclasses must reimplement this pure virtual function.<h3 class=fn>int <a name="cfFor"></a>QWindowsMime::cfFor ( const char * mime )<tt> [pure virtual]</tt></h3><p> Returns the Windows Clipboard type used for MIME type <em>mime</em>, or0 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="cfToMime"></a>QWindowsMime::cfToMime ( int cf )<tt> [static]</tt></h3>Returns a MIME type for <em>cf</em>, or 0 if none exists.<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></h3><p> Returns <em>data</em> converted from MIME type <em>mime</em>to Windows Clipboard format <em>cf</em>.<p> Note that Windows Clipboard formats must all be self-terminating. Thereturn 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>QWindowsMime::convertToMime ( <a href="qbytearray.html">QByteArray</a> data, const char * mime, int cf )<tt> [pure virtual]</tt></h3><p> Returns <em>data</em> converted from Windows Clipboard format <em>cf</em>to MIME type <em>mime</em>.<p> Note that Windows Clipboard formats must all be self-terminating. Theinput <em>data</em> may contain trailing data.<p> All subclasses must reimplement this pure virtual function.<h3 class=fn><a href="qwindowsmime.html">QWindowsMime</a> * <a name="convertor"></a>QWindowsMime::convertor ( const char * mime, int cf )<tt> [static]</tt></h3>Returns the most-recently created QWindowsMime that can convertbetween the <em>mime</em> and <em>cf</em> formats. Returns 0 if no such convertorexists.<h3 class=fn>const char * <a name="convertorName"></a>QWindowsMime::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="countCf"></a>QWindowsMime::countCf ()<tt> [pure virtual]</tt></h3><p> Returns the number of Windows Clipboard formats supported by thisconvertor.<p> All subclasses must reimplement this pure virtual function.<h3 class=fn>void <a name="initialize"></a>QWindowsMime::initialize ()<tt> [static]</tt></h3>This is an internal function.<h3 class=fn>const char * <a name="mimeFor"></a>QWindowsMime::mimeFor ( int cf )<tt> [pure virtual]</tt></h3><p> Returns the MIME type used for Windows Clipboard format <em>cf</em>, or0 if this convertor does not support <em>cf</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 © 1995-2002<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 © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -