summaryrefslogtreecommitdiffstats
path: root/doc/html/ntqclipboard.html
blob: 9e91d9e04cc88ca560a7886d29d5a6b02228bc78 (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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
<!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/qclipboard.cpp:47 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>TQClipboard 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>TQClipboard Class Reference</h1>

<p>The TQClipboard class provides access to the window system clipboard.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qclipboard-h.html">ntqclipboard.h</a>&gt;</tt>
<p>Inherits <a href="tqobject.html">TQObject</a>.
<p><a href="qclipboard-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn>enum <a href="#Mode-enum"><b>Mode</b></a> { Clipboard, Selection }</li>
<li class=fn>void <a href="#clear"><b>clear</b></a> ( Mode&nbsp;mode )</li>
<li class=fn>void <a href="#clear-2"><b>clear</b></a> ()</li>
<li class=fn>bool <a href="#supportsSelection"><b>supportsSelection</b></a> () const</li>
<li class=fn>bool <a href="#ownsSelection"><b>ownsSelection</b></a> () const</li>
<li class=fn>bool <a href="#ownsClipboard"><b>ownsClipboard</b></a> () const</li>
<li class=fn>void setSelectionMode ( bool&nbsp;enable ) &nbsp;<em>(obsolete)</em></li>
<li class=fn>bool selectionModeEnabled () const &nbsp;<em>(obsolete)</em></li>
<li class=fn>TQString <a href="#text"><b>text</b></a> ( Mode&nbsp;mode ) const</li>
<li class=fn>TQString <a href="#text-2"><b>text</b></a> ( TQCString&nbsp;&amp;&nbsp;subtype, Mode&nbsp;mode ) const</li>
<li class=fn>void <a href="#setText"><b>setText</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;text, Mode&nbsp;mode )</li>
<li class=fn>TQMimeSource * <a href="#data"><b>data</b></a> ( Mode&nbsp;mode ) const</li>
<li class=fn>void <a href="#setData"><b>setData</b></a> ( TQMimeSource&nbsp;*&nbsp;src, Mode&nbsp;mode )</li>
<li class=fn>TQImage <a href="#image"><b>image</b></a> ( Mode&nbsp;mode ) const</li>
<li class=fn>TQPixmap <a href="#pixmap"><b>pixmap</b></a> ( Mode&nbsp;mode ) const</li>
<li class=fn>void <a href="#setImage"><b>setImage</b></a> ( const&nbsp;TQImage&nbsp;&amp;&nbsp;image, Mode&nbsp;mode )</li>
<li class=fn>void <a href="#setPixmap"><b>setPixmap</b></a> ( const&nbsp;TQPixmap&nbsp;&amp;&nbsp;pixmap, Mode&nbsp;mode )</li>
<li class=fn>TQString <a href="#text-3"><b>text</b></a> () const</li>
<li class=fn>TQString <a href="#text-4"><b>text</b></a> ( TQCString&nbsp;&amp;&nbsp;subtype ) const</li>
<li class=fn>void <a href="#setText-2"><b>setText</b></a> ( const&nbsp;TQString&nbsp;&amp;&nbsp;text )</li>
<li class=fn>TQMimeSource * <a href="#data-2"><b>data</b></a> () const</li>
<li class=fn>void <a href="#setData-2"><b>setData</b></a> ( TQMimeSource&nbsp;*&nbsp;src )</li>
<li class=fn>TQImage <a href="#image-2"><b>image</b></a> () const</li>
<li class=fn>TQPixmap <a href="#pixmap-2"><b>pixmap</b></a> () const</li>
<li class=fn>void <a href="#setImage-2"><b>setImage</b></a> ( const&nbsp;TQImage&nbsp;&amp;&nbsp;image )</li>
<li class=fn>void <a href="#setPixmap-2"><b>setPixmap</b></a> ( const&nbsp;TQPixmap&nbsp;&amp;&nbsp;pixmap )</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#selectionChanged"><b>selectionChanged</b></a> ()</li>
<li class=fn>void <a href="#dataChanged"><b>dataChanged</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The TQClipboard class provides access to the window system clipboard.
<p> 


<p> The clipboard offers a simple mechanism to copy and paste data
between applications.
<p> TQClipboard supports the same data types that <a href="ntqdragobject.html">TQDragObject</a> does, and
uses similar mechanisms. For advanced clipboard usage
read <a href="dnd.html">the drag-and-drop documentation</a>.
<p> There is a single TQClipboard object in an application, and you can
access it using <a href="ntqapplication.html#clipboard">TQApplication::clipboard</a>().
<p> Example:
<pre>
    TQClipboard *cb = TQApplication::<a href="ntqapplication.html#clipboard">clipboard</a>();

    // Copy text from the clipboard (paste)
    <a href="ntqstring.html">TQString</a> text = cb-&gt;<a href="#text">text</a>(TQClipboard::<a href="#Mode-enum">Clipboard</a>);
    if ( !text.<a href="ntqstring.html#isNull">isNull</a>() )
        <a href="ntqapplication.html#qDebug">tqDebug</a>( "The clipboard contains: " + text );

    // Copy text into the clipboard
    cb-&gt;<a href="#setText">setText</a>( "This text can be pasted by other programs",
                 TQClipboard::<a href="#Mode-enum">Clipboard</a> );
    </pre>
 
<p> TQClipboard features some convenience functions to access common data
types: <a href="#setText">setText</a>() allows the exchange of Unicode text and
<a href="#setPixmap">setPixmap</a>() and <a href="#setImage">setImage</a>() allows the exchange of TQPixmaps
and TQImages between applications. The <a href="#setData">setData</a>() function is the
ultimate in flexibility: it allows you to add any <a href="qmimesource.html">TQMimeSource</a> into the
clipboard. There are corresponding getters for each of these, e.g.
<a href="#text">text</a>(), <a href="#image">image</a>() and <a href="#pixmap">pixmap</a>().
<p> You can clear the clipboard by calling <a href="#clear">clear</a>().
<p> <h3> Platform Specific Information
</h3>
<a name="1"></a><p> <h4> X11
</h4>
<a name="1-1"></a><p> <ul>
<p> <li> The X11 Window System has the concept of a separate selection
and clipboard.  When text is selected, it is immediately available
as the global mouse selection.  The global mouse selection may
later be copied to the clipboard.  By convention, the middle mouse
button is used to paste the global mouse selection.
<p> <li> X11 also has the concept of ownership; if you change the
selection within a window, X11 will only notify the owner and the
previous owner of the change, i.e. it will not notify all
applications that the selection or clipboard data changed.
<p> <li> Lastly, the X11 clipboard is event driven, i.e. the clipboard
will not function properly if the event loop is not running.
Similarly, it is recommended that the contents of the clipboard
are stored or retrieved in direct response to user-input events,
e.g. mouse button or key presses and releases.  You should not
store or retrieve the clipboard contents in response to timer or
non-user-input events.
<p> </ul>
<p> <h4> Windows
</h4>
<a name="1-1-1"></a><p> <ul>
<p> <li> Microsoft Windows does not support the global mouse selection;
it only supports the global clipboard, e.g. Windows only adds text
to the clipboard when an explicit copy or cut is made.
<p> <li> Windows does not have the concept of ownership; the clipboard
is a fully global resource so all applications are notified of
changes.
<p> </ul>
<p> See the multiclip example in the <em>TQt Designer</em> examples
directory for an example of a multiplatform clipboard application
that also demonstrates selection handling.
<p>See also <a href="environment.html">Environment Classes</a> and <a href="io.html">Input/Output and Networking</a>.

<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="Mode-enum"></a>TQClipboard::Mode</h3> 
<!-- index clipboard mode -->
<p> This enum type is used to control which part of the system clipboard is
used by <a href="#data">TQClipboard::data</a>(), <a href="#setData">TQClipboard::setData</a>() and related functions.
<ul>
<li><tt>TQClipboard::Clipboard</tt> - indicates that data should be stored and retrieved from
the global clipboard.
<li><tt>TQClipboard::Selection</tt> - indicates that data should be stored and retrieved from
the global mouse selection.
</ul><p> <em>Note</em>: Support for <a href="#Mode-enum">Selection</a> is provided only on systems with a
global mouse selection (e.g. X11).
<p> <p>See also <a href="#supportsSelection">TQClipboard::supportsSelection</a>().

<hr><h2>Member Function Documentation</h2>
<h3 class=fn>void <a name="clear"></a>TQClipboard::clear ( <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode )
</h3> 
Clear the clipboard contents.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, this
function clears the the global clipboard contents.  If <em>mode</em> is
TQClipboard::Selection, this function clears the global mouse
selection contents.
<p> <p>See also <a href="#Mode-enum">TQClipboard::Mode</a> and <a href="#supportsSelection">supportsSelection</a>().

<h3 class=fn>void <a name="clear-2"></a>TQClipboard::clear ()
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#clear">TQClipboard::clear</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is TQClipboard::Clipboard.

<h3 class=fn><a href="qmimesource.html">TQMimeSource</a>&nbsp;* <a name="data"></a>TQClipboard::data ( <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode ) const
</h3> 
Returns a reference to a <a href="qmimesource.html">TQMimeSource</a> representation of the current
clipboard data.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
data is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the data is retrieved from the global
mouse selection.
<p> <p>See also <a href="#setData">setData</a>().

<h3 class=fn><a href="qmimesource.html">TQMimeSource</a>&nbsp;* <a name="data-2"></a>TQClipboard::data () const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#data">TQClipboard::data</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>void <a name="dataChanged"></a>TQClipboard::dataChanged ()<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the clipboard data is changed.

<h3 class=fn><a href="tqimage.html">TQImage</a> <a name="image"></a>TQClipboard::image ( <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode ) const
</h3>
Returns the clipboard image, or returns a null image if the
clipboard does not contain an image or if it contains an image in
an unsupported image format.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
image is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the image is retrieved from the global
mouse selection.
<p> <p>See also <a href="#setImage">setImage</a>(), <a href="#pixmap">pixmap</a>(), <a href="#data">data</a>(), and <a href="tqimage.html#isNull">TQImage::isNull</a>().

<h3 class=fn><a href="tqimage.html">TQImage</a> <a name="image-2"></a>TQClipboard::image () const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#image">TQClipboard::image</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>bool <a name="ownsClipboard"></a>TQClipboard::ownsClipboard () const
</h3>
Returns TRUE if this clipboard object owns the clipboard data;
otherwise returns FALSE.

<h3 class=fn>bool <a name="ownsSelection"></a>TQClipboard::ownsSelection () const
</h3>
Returns TRUE if this clipboard object owns the mouse selection
data; otherwise returns FALSE.

<h3 class=fn><a href="ntqpixmap.html">TQPixmap</a> <a name="pixmap"></a>TQClipboard::pixmap ( <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode ) const
</h3>
Returns the clipboard pixmap, or null if the clipboard does not
contain a pixmap. Note that this can lose information. For
example, if the image is 24-bit and the display is 8-bit, the
result is converted to 8 bits, and if the image has an alpha
channel, the result just has a mask.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
pixmap is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the pixmap is retrieved from the global
mouse selection.
<p> <p>See also <a href="#setPixmap">setPixmap</a>(), <a href="#image">image</a>(), <a href="#data">data</a>(), and <a href="ntqpixmap.html#convertFromImage">TQPixmap::convertFromImage</a>().

<h3 class=fn><a href="ntqpixmap.html">TQPixmap</a> <a name="pixmap-2"></a>TQClipboard::pixmap () const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#pixmap">TQClipboard::pixmap</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>void <a name="selectionChanged"></a>TQClipboard::selectionChanged ()<tt> [signal]</tt>
</h3>

<p> This signal is emitted when the selection is changed. This only
applies to windowing systems that support selections, e.g. X11.
Windows doesn't support selections.

<h3 class=fn>bool <a name="selectionModeEnabled"></a>TQClipboard::selectionModeEnabled () const
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Use the <a href="#data">TQClipboard::data</a>(), <a href="#setData">TQClipboard::setData</a>() and related functions
which take a TQClipboard::Mode argument.
<p> Returns the selection mode.
<p> <p>See also <a href="#setSelectionMode">setSelectionMode</a>() and <a href="#supportsSelection">supportsSelection</a>().

<h3 class=fn>void <a name="setData"></a>TQClipboard::setData ( <a href="qmimesource.html">TQMimeSource</a>&nbsp;*&nbsp;src, <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode )
</h3> 
Sets the clipboard data to <em>src</em>. Ownership of the data is
transferred to the clipboard. If you want to remove the data
either call <a href="#clear">clear</a>() or call <a href="#setData">setData</a>() again with new data.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
data is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the data is retrieved from the global
mouse selection.
<p> The <a href="ntqdragobject.html">TQDragObject</a> subclasses are reasonable objects to put into the
clipboard (but do not try to call <a href="ntqdragobject.html#drag">TQDragObject::drag</a>() on the same
object). Any TQDragObject placed in the clipboard should have a
parent of 0. Do not put <a href="qdragmoveevent.html">TQDragMoveEvent</a> or <a href="qdropevent.html">TQDropEvent</a> subclasses in
the clipboard, as they do not belong to the event handler which
receives them.
<p> The <a href="#setText">setText</a>(), <a href="#setImage">setImage</a>() and <a href="#setPixmap">setPixmap</a>() functions are simpler
wrappers for setting text, image and pixmap data respectively.
<p> <p>See also <a href="#data">data</a>().

<h3 class=fn>void <a name="setData-2"></a>TQClipboard::setData ( <a href="qmimesource.html">TQMimeSource</a>&nbsp;*&nbsp;src )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#setData">TQClipboard::setData</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>void <a name="setImage"></a>TQClipboard::setImage ( const&nbsp;<a href="tqimage.html">TQImage</a>&nbsp;&amp;&nbsp;image, <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode )
</h3>
Copies <em>image</em> into the clipboard.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
image is stored in the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the data is stored in the global
mouse selection.
<p> This is shorthand for:
<pre>
        <a href="#setData">setData</a>( new <a href="tqimagedrag.html">TQImageDrag</a>(image), mode )
    </pre>
 
<p> <p>See also <a href="#image">image</a>(), <a href="#setPixmap">setPixmap</a>(), and <a href="#setData">setData</a>().

<h3 class=fn>void <a name="setImage-2"></a>TQClipboard::setImage ( const&nbsp;<a href="tqimage.html">TQImage</a>&nbsp;&amp;&nbsp;image )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#setImage">TQClipboard::setImage</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>void <a name="setPixmap"></a>TQClipboard::setPixmap ( const&nbsp;<a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp;&nbsp;pixmap, <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode )
</h3>
Copies <em>pixmap</em> into the clipboard. Note that this is slower
than <a href="#setImage">setImage</a>() because it needs to convert the <a href="ntqpixmap.html">TQPixmap</a> to a
<a href="tqimage.html">TQImage</a> first.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
pixmap is stored in the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the pixmap is stored in the global
mouse selection.
<p> <p>See also <a href="#pixmap">pixmap</a>(), <a href="#setImage">setImage</a>(), and <a href="#setData">setData</a>().

<h3 class=fn>void <a name="setPixmap-2"></a>TQClipboard::setPixmap ( const&nbsp;<a href="ntqpixmap.html">TQPixmap</a>&nbsp;&amp;&nbsp;pixmap )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#setPixmap">TQClipboard::setPixmap</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>void <a name="setSelectionMode"></a>TQClipboard::setSelectionMode ( bool&nbsp;enable )
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Use the <a href="#data">TQClipboard::data</a>(), <a href="#setData">TQClipboard::setData</a>() and related functions
which take a TQClipboard::Mode argument.
<p> Sets the clipboard selection mode. If <em>enable</em> is TRUE, then
subsequent calls to TQClipboard::setData() and other functions
which put data into the clipboard will put the data into the mouse
selection, otherwise the data will be put into the clipboard.
<p> <p>See also <a href="#supportsSelection">supportsSelection</a>() and <a href="#selectionModeEnabled">selectionModeEnabled</a>().

<h3 class=fn>void <a name="setText"></a>TQClipboard::setText ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;text, <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode )
</h3>
Copies <em>text</em> into the clipboard as plain text.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
text is stored in the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the text is stored in the global
mouse selection.
<p> <p>See also <a href="#text">text</a>() and <a href="#setData">setData</a>().

<p>Example: <a href="regexptester-example.html#x2476">regexptester/regexptester.cpp</a>.
<h3 class=fn>void <a name="setText-2"></a>TQClipboard::setText ( const&nbsp;<a href="ntqstring.html">TQString</a>&nbsp;&amp;&nbsp;text )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#setText">TQClipboard::setText</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn>bool <a name="supportsSelection"></a>TQClipboard::supportsSelection () const
</h3>
Returns TRUE if the clipboard supports mouse selection; otherwise
returns FALSE.

<p>Example: <a href="regexptester-example.html#x2477">regexptester/regexptester.cpp</a>.
<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text"></a>TQClipboard::text ( <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode ) const
</h3>
Returns the clipboard text as plain text, or a null string if the
clipboard does not contain any text.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
text is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the text is retrieved from the global
mouse selection.
<p> <p>See also <a href="#setText">setText</a>(), <a href="#data">data</a>(), and <a href="ntqstring.html#operator!">TQString::operator!</a>().

<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-2"></a>TQClipboard::text ( <a href="ntqcstring.html">TQCString</a>&nbsp;&amp;&nbsp;subtype, <a href="ntqclipboard.html#Mode-enum">Mode</a>&nbsp;mode ) const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Returns the clipboard text in subtype <em>subtype</em>, or a null string
if the clipboard does not contain any text. If <em>subtype</em> is null,
any subtype is acceptable, and <em>subtype</em> is set to the chosen
subtype.
<p> The <em>mode</em> argument is used to control which part of the system
clipboard is used.  If <em>mode</em> is TQClipboard::Clipboard, the
text is retrieved from the global clipboard.  If <em>mode</em> is
TQClipboard::Selection, the text is retrieved from the global
mouse selection.
<p> Common values for <em>subtype</em> are "plain" and "html".
<p> <p>See also <a href="#setText">setText</a>(), <a href="#data">data</a>(), and <a href="ntqstring.html#operator!">TQString::operator!</a>().

<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-3"></a>TQClipboard::text () const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> This function uses the <a href="#text">TQClipboard::text</a>() function which takes
a TQClipboard::Mode argument.  The value of the mode argument is
determined by the return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>().
If selectionModeEnabled() returns TRUE, the mode argument is
TQClipboard::Selection, otherwise the mode argument is
TQClipboard::Clipboard.

<h3 class=fn><a href="ntqstring.html">TQString</a> <a name="text-4"></a>TQClipboard::text ( <a href="ntqcstring.html">TQCString</a>&nbsp;&amp;&nbsp;subtype ) const
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Returns the clipboard text in subtype <em>subtype</em>, or a null string
if the clipboard does not contain any text. This function uses the
<a href="#text">TQClipboard::text</a>() function which takes a TQClipboard::Mode
argument.  The value of the mode argument is determined by the
return value of <a href="#selectionModeEnabled">selectionModeEnabled</a>(). If selectionModeEnabled()
returns TRUE, the mode argument is TQClipboard::Selection,
otherwise the mode argument is TQClipboard::Clipboard.

<!-- 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>