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

Public Member Functions | |
KURLDrag (const KURL::List &urls, QWidget *dragSource, const char *name) | |
Constructs an object to drag the list of URLs in urls . | |
KURLDrag (const KURL::List &urls, const QMap< QString, QString > &metaData, QWidget *dragSource, const char *name) | |
Constructs an object to drag the list of URLs in urls . | |
QMap< QString, QString > & | metaData () |
Meta-data to associate with those URLs (to be used after newDrag). | |
Static Public Member Functions | |
KURLDrag * | newDrag (const KURL::List &urls, QWidget *dragSource=0, const char *name=0) |
This class or method is obsolete, it is provided for compatibility only. Is equivalent with "new KURLDrag(urls, dragSource, name)". | |
KURLDrag * | newDrag (const KURL::List &urls, const QMap< QString, QString > &metaData, QWidget *dragSource=0, const char *name=0) |
This class or method is obsolete, it is provided for compatibility only. Is equivalent with "new KURLDrag(urls, metaData, dragSource, name)". | |
bool | decode (const QMimeSource *e, KURL::List &urls) |
Convenience method that decodes the contents of e into a list of KURLs. | |
bool | decode (const QMimeSource *e, KURL::List &urls, QMap< QString, QString > &metaData) |
Convenience method that decodes the contents of e into a list of KURLs and a set of metadata. | |
Protected Member Functions | |
KURLDrag (const QStrList &urls, const QMap< QString, QString > &metaData, QWidget *dragSource, const char *name) | |
Protected constructor - use newDrag. | |
virtual const char * | format (int i) const |
virtual QByteArray | encodedData (const char *mime) const |
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 43 of file kurldrag.h.
Constructor & Destructor Documentation
|
Constructs an object to drag the list of URLs in
The Definition at line 25 of file kurldrag.cpp. References KStdAction::name(). Referenced by newDrag(). |
|
Constructs an object to drag the list of URLs in This version also includes metadata.
Definition at line 31 of file kurldrag.cpp. References KStdAction::name(). |
|
Protected constructor - use newDrag.
Definition at line 122 of file kurldrag.h. References KStdAction::name(). |
Member Function Documentation
|
This class or method is obsolete, it is provided for compatibility only. Is equivalent with "new KURLDrag(urls, dragSource, name)".
Definition at line 53 of file kurldrag.cpp. References KURLDrag(), and KStdAction::name(). |
|
This class or method is obsolete, it is provided for compatibility only. Is equivalent with "new KURLDrag(urls, metaData, dragSource, name)".
Definition at line 58 of file kurldrag.cpp. References KURLDrag(), and KStdAction::name(). |
|
Meta-data to associate with those URLs (to be used after newDrag). 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 88 of file kurldrag.h. |
|
Convenience method that decodes the contents of
Definition at line 64 of file kurldrag.cpp. References QValueList< KURL >::append(), and QUriDrag::decode(). Referenced by decode(). |
|
Convenience method that decodes the contents of You should be using this one, if possible.
Definition at line 73 of file kurldrag.cpp. References decode(), QMimeSource::encodedData(), KStdAccel::key(), QMap::replace(), and QStringList::split(). |
The documentation for this class was generated from the following files: