summaryrefslogtreecommitdiffstats
path: root/doc/html/tqwindowsmime.html
blob: 2ab7c3c7c201376f2390f66be6612d15328e6aef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!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/tqmime_win.cpp:52 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQWindowsMime 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>TQWindowsMime Class Reference</h1>

<p>The TQWindowsMime class maps open-standard MIME to Window Clipboard formats.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="tqmime-h.html">tqmime.h</a>&gt;</tt>
<p><a href="tqwindowsmime-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#TQWindowsMime"><b>TQWindowsMime</b></a> ()</li>
<li class=fn>virtual <a href="#~TQWindowsMime"><b>~TQWindowsMime</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="#countCf"><b>countCf</b></a> () = 0</li>
<li class=fn>virtual int <a href="#cf"><b>cf</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;cf ) = 0</li>
<li class=fn>virtual const char * <a href="#mimeFor"><b>mimeFor</b></a> ( int&nbsp;cf ) = 0</li>
<li class=fn>virtual int <a href="#cfFor"><b>cfFor</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime ) = 0</li>
<li class=fn>virtual TQByteArray <a href="#convertToMime"><b>convertToMime</b></a> ( TQByteArray&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;cf ) = 0</li>
<li class=fn>virtual TQByteArray <a href="#convertFromMime"><b>convertFromMime</b></a> ( TQByteArray&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;cf ) = 0</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>void <a href="#initialize"><b>initialize</b></a> ()</li>
<li class=fn>TQPtrList&lt;TQWindowsMime&gt; <a href="#all"><b>all</b></a> ()</li>
<li class=fn>TQWindowsMime * <a href="#convertor"><b>convertor</b></a> ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;cf )</li>
<li class=fn>const char * <a href="#cfToMime"><b>cfToMime</b></a> ( int&nbsp;cf )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQWindowsMime class maps open-standard MIME to Window Clipboard formats.



<p> TQt's drag-and-drop and clipboard facilities use the MIME standard.
On X11, this maps trivially to the Xdnd protocol, but on Windows
although some applications use MIME types to describe clipboard
formats, others use arbitrary non-standardized naming conventions,
or unnamed built-in formats of Windows.
<p> By instantiating subclasses of TQWindowsMime that provide conversions
between Windows Clipboard and MIME formats, you can convert
proprietary clipboard formats to MIME formats.
<p> TQt 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="tqtextdrag.html">TQTextDrag</a>.
<li> CF_TEXT - converted to "text/plain;charset=system" or "text/plain"
and supported by TQTextDrag.
<li> CF_DIB - converted to "image/*", where * is
a <a href="tqimage.html#outputFormats">TQt image format</a>,
and supported by <a href="tqimagedrag.html">TQImageDrag</a>.
<li> CF_HDROP - converted to "text/uri-list",
and supported by <a href="tquridrag.html">TQUriDrag</a>.
</ul>
<p> An example use of this class would be to map the Windows Metafile
clipboard format (CF_METAFILEPICT) to and from the MIME type "image/x-wmf".
This conversion might simply be adding or removing a header, or even
just passing on the data.  See the
<a href="dnd.html">Drag-and-Drop documentation</a> for more information
on choosing and definition MIME types.
<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="TQWindowsMime"></a>TQWindowsMime::TQWindowsMime ()
</h3>
Constructs a new conversion object, adding it to the globally accessed
list of available convertors.

<h3 class=fn><a name="~TQWindowsMime"></a>TQWindowsMime::~TQWindowsMime ()<tt> [virtual]</tt>
</h3>
Destroys a conversion object, removing it from the global
list of available convertors.

<h3 class=fn><a href="tqptrlist.html">TQPtrList</a>&lt;TQWindowsMime&gt; <a name="all"></a>TQWindowsMime::all ()<tt> [static]</tt>
</h3>
Returns a list of all currently defined TQWindowsMime objects.

<h3 class=fn>bool <a name="canConvert"></a>TQWindowsMime::canConvert ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;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>TQWindowsMime::cf ( int&nbsp;index )<tt> [pure virtual]</tt>
</h3>

<p> Returns the Windows Clipboard format supported by this convertor
that is ordinarily at position <em>index</em>. This means that <a href="#cf">cf</a>(0)
returns the first Windows Clipboard format supported, and
cf(countCf()-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="cfFor"></a>TQWindowsMime::cfFor ( const&nbsp;char&nbsp;*&nbsp;mime )<tt> [pure virtual]</tt>
</h3>

<p> Returns the Windows Clipboard type 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="cfToMime"></a>TQWindowsMime::cfToMime ( int&nbsp;cf )<tt> [static]</tt>
</h3>
Returns a MIME type for <em>cf</em>, or 0 if none exists.

<h3 class=fn><a href="tqbytearray.html">TQByteArray</a> <a name="convertFromMime"></a>TQWindowsMime::convertFromMime ( <a href="tqbytearray.html">TQByteArray</a>&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;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.  The
return value may contain trailing data.
<p> All subclasses must reimplement this pure virtual function.

<h3 class=fn><a href="tqbytearray.html">TQByteArray</a> <a name="convertToMime"></a>TQWindowsMime::convertToMime ( <a href="tqbytearray.html">TQByteArray</a>&nbsp;data, const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;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.  The
input <em>data</em> may contain trailing data.
<p> All subclasses must reimplement this pure virtual function.

<h3 class=fn><a href="tqwindowsmime.html">TQWindowsMime</a>&nbsp;* <a name="convertor"></a>TQWindowsMime::convertor ( const&nbsp;char&nbsp;*&nbsp;mime, int&nbsp;cf )<tt> [static]</tt>
</h3>
Returns the most-recently created TQWindowsMime that can convert
between the <em>mime</em> and <em>cf</em> formats.  Returns 0 if no such convertor
exists.

<h3 class=fn>const char * <a name="convertorName"></a>TQWindowsMime::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>TQWindowsMime::countCf ()<tt> [pure virtual]</tt>
</h3>

<p> Returns the number of Windows Clipboard formats supported by this
convertor.
<p> All subclasses must reimplement this pure virtual function.

<h3 class=fn>void <a name="initialize"></a>TQWindowsMime::initialize ()<tt> [static]</tt>
</h3>
This is an internal function.

<h3 class=fn>const char * <a name="mimeFor"></a>TQWindowsMime::mimeFor ( int&nbsp;cf )<tt> [pure virtual]</tt>
</h3>

<p> Returns the MIME type used for Windows Clipboard format <em>cf</em>, or
0 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">TQt 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>TQt 3.3.8</div>
</table></div></address></body>
</html>