source: trunk/doc/html/quridrag.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 10.9 KB
Line 
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/qdragobject.cpp:1278 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QUriDrag Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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>QUriDrag Class Reference</h1>
33
34<p>The QUriDrag class provides a drag object for a list of URI references.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qdragobject-h.html">qdragobject.h</a>&gt;</tt>
37<p>Inherits <a href="qstoreddrag.html">QStoredDrag</a>.
38<p><a href="quridrag-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QUriDrag"><b>QUriDrag</b></a> ( QStrList&nbsp;uris, QWidget&nbsp;*&nbsp;dragSource = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
42<li class=fn><a href="#QUriDrag-2"><b>QUriDrag</b></a> ( QWidget&nbsp;*&nbsp;dragSource = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn><a href="#~QUriDrag"><b>~QUriDrag</b></a> ()</li>
44<li class=fn>void setFilenames ( const&nbsp;QStringList&nbsp;&amp;&nbsp;fnames ) &nbsp;<em>(obsolete)</em></li>
45<li class=fn>void <a href="#setFileNames"><b>setFileNames</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;fnames )</li>
46<li class=fn>void <a href="#setUnicodeUris"><b>setUnicodeUris</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;uuris )</li>
47<li class=fn>virtual void <a href="#setUris"><b>setUris</b></a> ( QStrList&nbsp;uris )</li>
48</ul>
49<h2>Static Public Members</h2>
50<ul>
51<li class=fn>QString <a href="#uriToLocalFile"><b>uriToLocalFile</b></a> ( const&nbsp;char&nbsp;*&nbsp;uri )</li>
52<li class=fn>QCString <a href="#localFileToUri"><b>localFileToUri</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;filename )</li>
53<li class=fn>QString <a href="#uriToUnicodeUri"><b>uriToUnicodeUri</b></a> ( const&nbsp;char&nbsp;*&nbsp;uri )</li>
54<li class=fn>QCString <a href="#unicodeUriToUri"><b>unicodeUriToUri</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;uuri )</li>
55<li class=fn>bool <a href="#canDecode"><b>canDecode</b></a> ( const&nbsp;QMimeSource&nbsp;*&nbsp;e )</li>
56<li class=fn>bool <a href="#decode"><b>decode</b></a> ( const&nbsp;QMimeSource&nbsp;*&nbsp;e, QStrList&nbsp;&amp;&nbsp;l )</li>
57<li class=fn>bool <a href="#decodeToUnicodeUris"><b>decodeToUnicodeUris</b></a> ( const&nbsp;QMimeSource&nbsp;*&nbsp;e, QStringList&nbsp;&amp;&nbsp;l )</li>
58<li class=fn>bool <a href="#decodeLocalFiles"><b>decodeLocalFiles</b></a> ( const&nbsp;QMimeSource&nbsp;*&nbsp;e, QStringList&nbsp;&amp;&nbsp;l )</li>
59</ul>
60<hr><a name="details"></a><h2>Detailed Description</h2>
61
62
63The QUriDrag class provides a drag object for a list of URI references.
64<p>
65<p> URIs are a useful way to refer to files that may be distributed
66across multiple machines. A URI will often refer to a file on a
67machine local to both the drag source and the drop target, so the
68URI can be equivalent to passing a file name but is more
69extensible.
70<p> Use URIs in Unicode form so that the user can comfortably edit and
71view them. For use in HTTP or other protocols, use the correctly
72escaped ASCII form.
73<p> You can convert a list of file names to file URIs using
74<a href="#setFileNames">setFileNames</a>(), or into human-readble form with <a href="#setUnicodeUris">setUnicodeUris</a>().
75<p> Static functions are provided to convert between filenames and
76URIs, e.g. <a href="#uriToLocalFile">uriToLocalFile</a>() and <a href="#localFileToUri">localFileToUri</a>(), and to and from
77human-readable form, e.g. <a href="#uriToUnicodeUri">uriToUnicodeUri</a>(), <a href="#unicodeUriToUri">unicodeUriToUri</a>().
78You can also decode URIs from a mimesource into a list with
79<a href="#decodeLocalFiles">decodeLocalFiles</a>() and <a href="#decodeToUnicodeUris">decodeToUnicodeUris</a>().
80<p>See also <a href="draganddrop.html">Drag And Drop Classes</a>.
81
82<hr><h2>Member Function Documentation</h2>
83<h3 class=fn><a name="QUriDrag"></a>QUriDrag::QUriDrag ( <a href="qstrlist.html">QStrList</a>&nbsp;uris, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;dragSource = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
84</h3>
85Constructs an object to drag the list of URIs in <em>uris</em>. The <em>dragSource</em> and <em>name</em> arguments are passed on to <a href="qstoreddrag.html">QStoredDrag</a>.
86Note that URIs are always in escaped UTF8 encoding.
87
88<h3 class=fn><a name="QUriDrag-2"></a>QUriDrag::QUriDrag ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;dragSource = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
89</h3>
90Constructs an object to drag. You must call <a href="#setUris">setUris</a>() before you
91start the <a href="qdragobject.html#drag">drag</a>(). Passes <em>dragSource</em> and <em>name</em> to the
92<a href="qstoreddrag.html">QStoredDrag</a> constructor.
93
94<h3 class=fn><a name="~QUriDrag"></a>QUriDrag::~QUriDrag ()
95</h3>
96Destroys the object.
97
98<h3 class=fn>bool <a name="canDecode"></a>QUriDrag::canDecode ( const&nbsp;<a href="qmimesource.html">QMimeSource</a>&nbsp;*&nbsp;e )<tt> [static]</tt>
99</h3>
100Returns TRUE if <a href="#decode">decode</a>() would be able to decode <em>e</em>; otherwise
101returns FALSE.
102
103<h3 class=fn>bool <a name="decode"></a>QUriDrag::decode ( const&nbsp;<a href="qmimesource.html">QMimeSource</a>&nbsp;*&nbsp;e, <a href="qstrlist.html">QStrList</a>&nbsp;&amp;&nbsp;l )<tt> [static]</tt>
104</h3>
105Decodes URIs from <em>e</em>, placing the result in <em>l</em> (which is first
106cleared).
107<p> Returns TRUE if <em>e</em> contained a valid list of URIs; otherwise
108returns FALSE.
109
110<p>Example: <a href="dirview-example.html#x1707">dirview/dirview.cpp</a>.
111<h3 class=fn>bool <a name="decodeLocalFiles"></a>QUriDrag::decodeLocalFiles ( const&nbsp;<a href="qmimesource.html">QMimeSource</a>&nbsp;*&nbsp;e, <a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;l )<tt> [static]</tt>
112</h3>
113Decodes URIs from the mime source event <em>e</em>, converts them to
114local files if they refer to local files, and places them in <em>l</em>
115(which is first cleared).
116<p> Returns TRUE if <em>contained</em> a valid list of URIs; otherwise
117returns FALSE. The list will be empty if no URIs were local files.
118
119<p>Example: <a href="fileiconview-example.html#x873">fileiconview/qfileiconview.cpp</a>.
120<h3 class=fn>bool <a name="decodeToUnicodeUris"></a>QUriDrag::decodeToUnicodeUris ( const&nbsp;<a href="qmimesource.html">QMimeSource</a>&nbsp;*&nbsp;e, <a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;l )<tt> [static]</tt>
121</h3>
122Decodes URIs from the mime source event <em>e</em>, converts them to
123Unicode URIs (only useful for displaying to humans), placing them
124in <em>l</em> (which is first cleared).
125<p> Returns TRUE if <em>contained</em> a valid list of URIs; otherwise
126returns FALSE.
127
128<h3 class=fn><a href="qcstring.html">QCString</a> <a name="localFileToUri"></a>QUriDrag::localFileToUri ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;filename )<tt> [static]</tt>
129</h3>
130Returns the URI equivalent to the absolute local file <em>filename</em>.
131<p> <p>See also <a href="#uriToLocalFile">uriToLocalFile</a>().
132
133<h3 class=fn>void <a name="setFileNames"></a>QUriDrag::setFileNames ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;fnames )
134</h3>
135Sets the URIs to be the local-file URIs equivalent to <em>fnames</em>.
136<p> <p>See also <a href="#localFileToUri">localFileToUri</a>() and <a href="#setUris">setUris</a>().
137
138<p>Example: <a href="dirview-example.html#x1708">dirview/dirview.cpp</a>.
139<h3 class=fn>void <a name="setFilenames"></a>QUriDrag::setFilenames ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;fnames )
140</h3>
141
142<b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
143<p> Use <a href="#setFileNames">setFileNames</a>() instead (notice the N).
144
145<h3 class=fn>void <a name="setUnicodeUris"></a>QUriDrag::setUnicodeUris ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;uuris )
146</h3>
147Sets the URIs in <em>uuris</em> to be the Unicode URIs (only useful for
148displaying to humans).
149<p> <p>See also <a href="#localFileToUri">localFileToUri</a>() and <a href="#setUris">setUris</a>().
150
151<h3 class=fn>void <a name="setUris"></a>QUriDrag::setUris ( <a href="qstrlist.html">QStrList</a>&nbsp;uris )<tt> [virtual]</tt>
152</h3>
153Changes the list of <em>uris</em> to be dragged.
154<p> Note that URIs are always in escaped UTF8 encoding.
155
156<h3 class=fn><a href="qcstring.html">QCString</a> <a name="unicodeUriToUri"></a>QUriDrag::unicodeUriToUri ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;uuri )<tt> [static]</tt>
157</h3>
158Returns the URI equivalent of the Unicode URI given in <em>uuri</em>
159(only useful for displaying to humans).
160<p> <p>See also <a href="#uriToLocalFile">uriToLocalFile</a>().
161
162<h3 class=fn><a href="qstring.html">QString</a> <a name="uriToLocalFile"></a>QUriDrag::uriToLocalFile ( const&nbsp;char&nbsp;*&nbsp;uri )<tt> [static]</tt>
163</h3>
164Returns the name of a local file equivalent to <em>uri</em> or a null
165string if <em>uri</em> is not a local file.
166<p> Note that URIs are always in escaped UTF8 encoding.
167<p> <p>See also <a href="#localFileToUri">localFileToUri</a>().
168
169<p>Example: <a href="dirview-example.html#x1709">dirview/dirview.cpp</a>.
170<h3 class=fn><a href="qstring.html">QString</a> <a name="uriToUnicodeUri"></a>QUriDrag::uriToUnicodeUri ( const&nbsp;char&nbsp;*&nbsp;uri )<tt> [static]</tt>
171</h3>
172Returns the Unicode URI (only useful for displaying to humans)
173equivalent of <em>uri</em>.
174<p> Note that URIs are always in escaped UTF8 encoding.
175<p> <p>See also <a href="#localFileToUri">localFileToUri</a>().
176
177<!-- eof -->
178<hr><p>
179This file is part of the <a href="index.html">Qt toolkit</a>.
180Copyright &copy; 1995-2007
181<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
182<table width=100% cellspacing=0 border=0><tr>
183<td>Copyright &copy; 2007
184<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
185<td align=right><div align=right>Qt 3.3.8</div>
186</table></div></address></body>
187</html>
Note: See TracBrowser for help on using the repository browser.