KURLDrag Class Reference
This class is to be used instead of QUriDrag when using KURL. More...
#include <kurldrag.h>
Inheritance diagram for KURLDrag:

Public Methods | |
KURLDrag (const KURL::List &urls, QWidget *dragSource=0, const char *name=0) | |
KURLDrag (const KURL::List &urls, const QMap< QString, QString > &metaData, QWidget *dragSource=0, const char *name=0) | |
QMap< QString, QString > & | metaData () |
Static Public Methods | |
KURLDrag * | newDrag (const KURL::List &urls, QWidget *dragSource=0, const char *name=0) KDE_DEPRECATED |
KURLDrag * | newDrag (const KURL::List &urls, const QMap< QString, QString > &metaData, QWidget *dragSource=0, const char *name=0) KDE_DEPRECATED |
bool | decode (const QMimeSource *e, KURL::List &urls) |
bool | decode (const QMimeSource *e, KURL::List &urls, QMap< QString, QString > &metaData) |
QString | urlToString (const KURL &url) |
KURL | stringToUrl (const QCString &s) |
Protected Methods | |
KURLDrag (const QStrList &urls, const QMap< QString, QString > &metaData, QWidget *dragSource, const char *name) KDE_DEPRECATED |
Detailed Description
This class is to be used instead of QUriDrag when using KURL.The reason is: QUriDrag (and the XDND/W3C standards) expect URLs to be encoded in UTF-8 (unicode), but KURL uses the current locale by default. The other reasons for using this class are:
- it exports text/plain (for dropping/pasting into lineedits, mails etc.)
- 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).
Definition at line 44 of file kurldrag.h.
Constructor & Destructor Documentation
|
Constructs an object to drag the list of URLs in
The
Definition at line 30 of file kurldrag.cpp. Referenced by newDrag(). |
|
Constructs an object to drag the list of URLs in This version also includes metadata.
Definition at line 36 of file kurldrag.cpp. |
|
Definition at line 246 of file kurldrag.cpp. |
Member Function Documentation
|
Definition at line 60 of file kurldrag.cpp. References KURLDrag(). |
|
Definition at line 65 of file kurldrag.cpp. References KURLDrag(). |
|
Meta-data to associate with those URLs. This is an alternative way of setting the metadata: either use the constructor to pass it all at once, or use drag->metaData()["key"] = data;
Definition at line 91 of file kurldrag.h. |
|
Convenience method that decodes the contents of Decoding will fail if at least one decoded value is not a valid KURL.
Definition at line 71 of file kurldrag.cpp. References QValueList< KURL >::append(), QValueList< KURL >::clear(), QUriDrag::decode(), QValueList< KURL >::isEmpty(), KURL::isValid(), and stringToUrl(). Referenced by decode(). |
|
Convenience method that decodes the contents of Decoding will fail if at least one decoded value is not a valid KURL. You should be using this one, if possible.
Definition at line 88 of file kurldrag.cpp. References decode(), QMimeSource::encodedData(), KStdAccel::key(), QMap::replace(), and QStringList::split(). |
|
Converts a URL to a string representation suitable for dragging.
Definition at line 219 of file kurldrag.cpp. References KURL::isLocalFile(), KGlobal::locale(), QString::mid(), QString::startsWith(), and KURL::url(). |
|
Converts a string used for dragging to a URL.
Definition at line 211 of file kurldrag.cpp. References KGlobal::locale(). Referenced by decode(). |
The documentation for this class was generated from the following files: