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"><!--
|
---|
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>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 <<a href="qdragobject-h.html">qdragobject.h</a>></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 uris, QWidget * dragSource = 0, const char * name = 0 )</li>
|
---|
42 | <li class=fn><a href="#QUriDrag-2"><b>QUriDrag</b></a> ( QWidget * dragSource = 0, const char * name = 0 )</li>
|
---|
43 | <li class=fn><a href="#~QUriDrag"><b>~QUriDrag</b></a> ()</li>
|
---|
44 | <li class=fn>void setFilenames ( const QStringList & fnames ) <em>(obsolete)</em></li>
|
---|
45 | <li class=fn>void <a href="#setFileNames"><b>setFileNames</b></a> ( const QStringList & fnames )</li>
|
---|
46 | <li class=fn>void <a href="#setUnicodeUris"><b>setUnicodeUris</b></a> ( const QStringList & uuris )</li>
|
---|
47 | <li class=fn>virtual void <a href="#setUris"><b>setUris</b></a> ( QStrList 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 char * uri )</li>
|
---|
52 | <li class=fn>QCString <a href="#localFileToUri"><b>localFileToUri</b></a> ( const QString & filename )</li>
|
---|
53 | <li class=fn>QString <a href="#uriToUnicodeUri"><b>uriToUnicodeUri</b></a> ( const char * uri )</li>
|
---|
54 | <li class=fn>QCString <a href="#unicodeUriToUri"><b>unicodeUriToUri</b></a> ( const QString & uuri )</li>
|
---|
55 | <li class=fn>bool <a href="#canDecode"><b>canDecode</b></a> ( const QMimeSource * e )</li>
|
---|
56 | <li class=fn>bool <a href="#decode"><b>decode</b></a> ( const QMimeSource * e, QStrList & l )</li>
|
---|
57 | <li class=fn>bool <a href="#decodeToUnicodeUris"><b>decodeToUnicodeUris</b></a> ( const QMimeSource * e, QStringList & l )</li>
|
---|
58 | <li class=fn>bool <a href="#decodeLocalFiles"><b>decodeLocalFiles</b></a> ( const QMimeSource * e, QStringList & l )</li>
|
---|
59 | </ul>
|
---|
60 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
61 |
|
---|
62 |
|
---|
63 | The 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
|
---|
66 | across multiple machines. A URI will often refer to a file on a
|
---|
67 | machine local to both the drag source and the drop target, so the
|
---|
68 | URI can be equivalent to passing a file name but is more
|
---|
69 | extensible.
|
---|
70 | <p> Use URIs in Unicode form so that the user can comfortably edit and
|
---|
71 | view them. For use in HTTP or other protocols, use the correctly
|
---|
72 | escaped 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
|
---|
76 | URIs, e.g. <a href="#uriToLocalFile">uriToLocalFile</a>() and <a href="#localFileToUri">localFileToUri</a>(), and to and from
|
---|
77 | human-readable form, e.g. <a href="#uriToUnicodeUri">uriToUnicodeUri</a>(), <a href="#unicodeUriToUri">unicodeUriToUri</a>().
|
---|
78 | You 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> uris, <a href="qwidget.html">QWidget</a> * dragSource = 0, const char * name = 0 )
|
---|
84 | </h3>
|
---|
85 | Constructs 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>.
|
---|
86 | Note 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> * dragSource = 0, const char * name = 0 )
|
---|
89 | </h3>
|
---|
90 | Constructs an object to drag. You must call <a href="#setUris">setUris</a>() before you
|
---|
91 | start 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>
|
---|
96 | Destroys the object.
|
---|
97 |
|
---|
98 | <h3 class=fn>bool <a name="canDecode"></a>QUriDrag::canDecode ( const <a href="qmimesource.html">QMimeSource</a> * e )<tt> [static]</tt>
|
---|
99 | </h3>
|
---|
100 | Returns TRUE if <a href="#decode">decode</a>() would be able to decode <em>e</em>; otherwise
|
---|
101 | returns FALSE.
|
---|
102 |
|
---|
103 | <h3 class=fn>bool <a name="decode"></a>QUriDrag::decode ( const <a href="qmimesource.html">QMimeSource</a> * e, <a href="qstrlist.html">QStrList</a> & l )<tt> [static]</tt>
|
---|
104 | </h3>
|
---|
105 | Decodes URIs from <em>e</em>, placing the result in <em>l</em> (which is first
|
---|
106 | cleared).
|
---|
107 | <p> Returns TRUE if <em>e</em> contained a valid list of URIs; otherwise
|
---|
108 | returns 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 <a href="qmimesource.html">QMimeSource</a> * e, <a href="qstringlist.html">QStringList</a> & l )<tt> [static]</tt>
|
---|
112 | </h3>
|
---|
113 | Decodes URIs from the mime source event <em>e</em>, converts them to
|
---|
114 | local 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
|
---|
117 | returns 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 <a href="qmimesource.html">QMimeSource</a> * e, <a href="qstringlist.html">QStringList</a> & l )<tt> [static]</tt>
|
---|
121 | </h3>
|
---|
122 | Decodes URIs from the mime source event <em>e</em>, converts them to
|
---|
123 | Unicode URIs (only useful for displaying to humans), placing them
|
---|
124 | in <em>l</em> (which is first cleared).
|
---|
125 | <p> Returns TRUE if <em>contained</em> a valid list of URIs; otherwise
|
---|
126 | returns FALSE.
|
---|
127 |
|
---|
128 | <h3 class=fn><a href="qcstring.html">QCString</a> <a name="localFileToUri"></a>QUriDrag::localFileToUri ( const <a href="qstring.html">QString</a> & filename )<tt> [static]</tt>
|
---|
129 | </h3>
|
---|
130 | Returns 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 <a href="qstringlist.html">QStringList</a> & fnames )
|
---|
134 | </h3>
|
---|
135 | Sets 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 <a href="qstringlist.html">QStringList</a> & 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 <a href="qstringlist.html">QStringList</a> & uuris )
|
---|
146 | </h3>
|
---|
147 | Sets the URIs in <em>uuris</em> to be the Unicode URIs (only useful for
|
---|
148 | displaying 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> uris )<tt> [virtual]</tt>
|
---|
152 | </h3>
|
---|
153 | Changes 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 <a href="qstring.html">QString</a> & uuri )<tt> [static]</tt>
|
---|
157 | </h3>
|
---|
158 | Returns 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 char * uri )<tt> [static]</tt>
|
---|
163 | </h3>
|
---|
164 | Returns the name of a local file equivalent to <em>uri</em> or a null
|
---|
165 | string 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 char * uri )<tt> [static]</tt>
|
---|
171 | </h3>
|
---|
172 | Returns the Unicode URI (only useful for displaying to humans)
|
---|
173 | equivalent 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>
|
---|
179 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
180 | Copyright © 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 © 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>
|
---|