.TH "KURLDrag" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KURLDrag \- This class is to be used instead of \fBQUriDrag\fP when using \fBKURL\fP.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kurldrag.h>\fP
.PP
Inherits \fBQUriDrag\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLDrag\fP (const \fBKURL::List\fP &urls, \fBQWidget\fP *dragSource=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKURLDrag\fP (const \fBKURL::List\fP &urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > &metaData, \fBQWidget\fP *dragSource=0, const char *name=0)"
.br
.ti -1c
.RI "void \fBsetExportAsText\fP (bool exp)"
.br
.ti -1c
.RI "\fBQMap\fP< \fBQString\fP, \fBQString\fP > & \fBmetaData\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKURLDrag\fP * \fBnewDrag\fP (const \fBKURL::List\fP &urls, \fBQWidget\fP *dragSource=0, const char *name=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "static \fBKURLDrag\fP * \fBnewDrag\fP (const \fBKURL::List\fP &urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > &metaData, \fBQWidget\fP *dragSource=0, const char *name=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "static bool \fBdecode\fP (const \fBQMimeSource\fP *e, \fBKURL::List\fP &urls)"
.br
.ti -1c
.RI "static bool \fBdecode\fP (const \fBQMimeSource\fP *e, \fBKURL::List\fP &urls, \fBQMap\fP< \fBQString\fP, \fBQString\fP > &metaData)"
.br
.ti -1c
.RI "static \fBQString\fP \fBurlToString\fP (const \fBKURL\fP &url)"
.br
.ti -1c
.RI "static \fBKURL\fP \fBstringToUrl\fP (const \fBQCString\fP &s)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "\fBKURLDrag\fP (const \fBQStrList\fP &urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > &metaData, \fBQWidget\fP *dragSource, const char *name) KDE_DEPRECATED"
.br
.ti -1c
.RI "virtual const char * \fBformat\fP (int i) const "
.br
.ti -1c
.RI "virtual \fBQByteArray\fP \fBencodedData\fP (const char *mime) const "
.br
.in -1c
.SH "Detailed Description"
.PP 
This class is to be used instead of \fBQUriDrag\fP when using \fBKURL\fP. 

The reason is: \fBQUriDrag\fP (and the XDND/W3C standards) expect URLs to be encoded in UTF-8 (unicode), but \fBKURL\fP uses the current locale by default. The other reasons for using this class are: 
.PD 0

.IP "\(bu" 2
it exports text/plain (for dropping/pasting into lineedits, mails etc.) 
.IP "\(bu" 2
it has support for metadata, shipped as part of the dragobject This is important, for instance to set a correct HTTP referrer (some websites require it for downloading e.g. an image).
.PP
To create a drag object, use the KURLDrag constructor. To handle drops, use \fBQUriDrag::canDecode()\fP and \fBKURLDrag::decode()\fP 
.PP
Definition at line 44 of file kurldrag.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KURLDrag::KURLDrag (const \fBKURL::List\fP & urls, \fBQWidget\fP * dragSource = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs an object to drag the list of URLs in \fCurls\fP. 
.PP
The \fCdragSource\fP and \fCname\fP arguments are passed on to \fBQUriDrag\fP, and the list of urls is converted to UTF-8 before being passed to \fBQUriDrag\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIurls\fP the list of URLs 
.br
\fIdragSource\fP the parent of the \fBQObject\fP. Should be set when doing drag-n-drop, but should be 0 when copying to the clipboard 
.br
\fIname\fP the name of the \fBQObject\fP 
.RE
.PP

.PP
Definition at line 37 of file kurldrag.cpp.
.PP
Referenced by newDrag().
.SS "KURLDrag::KURLDrag (const \fBKURL::List\fP & urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > & metaData, \fBQWidget\fP * dragSource = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs an object to drag the list of URLs in \fCurls\fP. 
.PP
This version also includes metadata. 
.PP
\fBParameters:\fP
.RS 4
\fIurls\fP the list of URLs 
.br
\fImetaData\fP a map containing meta data 
.br
\fIdragSource\fP the parent of the \fBQObject\fP. Should be set when doing drag-n-drop, but should be 0 when copying to the clipboard 
.br
\fIname\fP the name of the \fBQObject\fP 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBmetaData()\fP 
.RE
.PP

.PP
Definition at line 43 of file kurldrag.cpp.
.SS "KURLDrag::KURLDrag (const \fBQStrList\fP & urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > & metaData, \fBQWidget\fP * dragSource, const char * name)\fC [protected]\fP"
.PP
\fBDeprecated\fP
.RS 4
Use a KURLDrag constructor with a \fBKURL::List\fP 
.RE
.PP

.PP
Definition at line 268 of file kurldrag.cpp.
.SH "Member Function Documentation"
.PP 
.SS "void KURLDrag::setExportAsText (bool exp)"
.PP
By default, KURLDrag also exports the URLs as plain text, for e.g. 
.PP
dropping onto a text editor. But in some cases this might not be wanted, e.g. if using the KURLDrag in a \fBKMultipleDrag\fP and another component of the multiple-drag provides better plain text data. In such a case, setExportAsText( false ) should be called. 
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 68 of file kurldrag.cpp.
.SS "\fBKURLDrag\fP * KURLDrag::newDrag (const \fBKURL::List\fP & urls, \fBQWidget\fP * dragSource = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
\fBDeprecated\fP
.RS 4
Is equivalent with 'new KURLDrag(urls, dragSource, name)'. 
.RE
.PP

.PP
Definition at line 76 of file kurldrag.cpp.
.PP
References KURLDrag().
.SS "\fBKURLDrag\fP * KURLDrag::newDrag (const \fBKURL::List\fP & urls, const \fBQMap\fP< \fBQString\fP, \fBQString\fP > & metaData, \fBQWidget\fP * dragSource = \fC0\fP, const char * name = \fC0\fP)\fC [static]\fP"
.PP
\fBDeprecated\fP
.RS 4
Is equivalent with 'new KURLDrag(urls, metaData, dragSource, name)'. 
.RE
.PP

.PP
Definition at line 81 of file kurldrag.cpp.
.PP
References KURLDrag(), and metaData().
.SS "\fBQMap\fP<\fBQString\fP, \fBQString\fP>& KURLDrag::metaData ()\fC [inline]\fP"
.PP
Meta-data to associate with those URLs. 
.PP
This is an alternative way of setting the metadata: either use the constructor to pass it all at once, or use drag->\fBmetaData()\fP['key'] = data; 
.PP
\fBSee also:\fP
.RS 4
\fBKIO::TransferJob\fP 
.RE
.PP

.PP
Definition at line 100 of file kurldrag.h.
.PP
Referenced by decode(), and newDrag().
.SS "bool KURLDrag::decode (const \fBQMimeSource\fP * e, \fBKURL::List\fP & urls)\fC [static]\fP"
.PP
Convenience method that decodes the contents of \fCe\fP into a list of KURLs. 
.PP
Decoding will fail if at least one decoded value is not a valid \fBKURL\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIe\fP the mime source 
.br
\fIurls\fP the list of urls will be written here 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 87 of file kurldrag.cpp.
.PP
References QUriDrag::decode(), KURL::isEmpty(), KURL::isValid(), and stringToUrl().
.PP
Referenced by decode().
.SS "bool KURLDrag::decode (const \fBQMimeSource\fP * e, \fBKURL::List\fP & urls, \fBQMap\fP< \fBQString\fP, \fBQString\fP > & metaData)\fC [static]\fP"
.PP
Convenience method that decodes the contents of \fCe\fP into a list of KURLs and a set of metadata. 
.PP
Decoding will fail if at least one decoded value is not a valid \fBKURL\fP. You should be using this one, if possible. 
.PP
\fBParameters:\fP
.RS 4
\fIe\fP the mime source 
.br
\fIurls\fP the list of urls will be written here 
.br
\fImetaData\fP the metadata map will be written here 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP

.PP
Definition at line 104 of file kurldrag.cpp.
.PP
References decode(), metaData(), QMap::replace(), and QStringList::split().
.SS "\fBQString\fP KURLDrag::urlToString (const \fBKURL\fP & url)\fC [static]\fP"
.PP
Converts a URL to a string representation suitable for dragging. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 237 of file kurldrag.cpp.
.PP
References QString::mid(), and QString::startsWith().
.SS "\fBKURL\fP KURLDrag::stringToUrl (const \fBQCString\fP & s)\fC [static]\fP"
.PP
Converts a string used for dragging to a URL. 
.PP
\fBSince:\fP
.RS 4
3.2 
.RE
.PP

.PP
Definition at line 229 of file kurldrag.cpp.
.PP
Referenced by decode().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
