• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KUrl::List

KUrl::List Class Reference

#include <KUrl>

Inheritance diagram for KUrl::List:

Inheritance graph
[legend]

List of all members.


Detailed Description

KUrl::List is a QList that contains KUrls with a few convenience methods.

See also:
KUrl

QValueList

Definition at line 125 of file kurl.h.


Public Member Functions

 List (const QList< KUrl > &list)
 List (const QStringList &list)
 List (const KUrl &url)
 List ()
 operator QVariant () const
void populateMimeData (QMimeData *mimeData, const KUrl::MetaDataMap &metaData=MetaDataMap(), MimeDataFlags flags=DefaultMimeDataFlags) const
QStringList toStringList () const

Static Public Member Functions

static bool canDecode (const QMimeData *mimeData)
static KUrl::List fromMimeData (const QMimeData *mimeData, KUrl::MetaDataMap *metaData=0)
static QStringList mimeDataTypes ()

Constructor & Destructor Documentation

KUrl::List::List (  )  [inline]

Creates an empty List.

Definition at line 131 of file kurl.h.

KUrl::List::List ( const KUrl &  url  ) 

Creates a list that contains the given URL as only item.

Parameters:
url the url to add.

Definition at line 186 of file kurl.cpp.

KUrl::List::List ( const QStringList &  list  ) 

Creates a list that contains the URLs from the given list of strings.

Parameters:
list the list containing the URLs as strings

Definition at line 196 of file kurl.cpp.

KUrl::List::List ( const QList< KUrl > &  list  ) 

Creates a list that contains the URLs from the given QList<KUrl>.

Parameters:
list the list containing the URLs

Definition at line 191 of file kurl.cpp.


Member Function Documentation

bool KUrl::List::canDecode ( const QMimeData *  mimeData  )  [static]

Return true if mimeData contains URI data.

Definition at line 272 of file kurl.cpp.

KUrl::List KUrl::List::fromMimeData ( const QMimeData *  mimeData,
KUrl::MetaDataMap *  metaData = 0 
) [static]

Extract a list of KUrls from the contents of mimeData.

Decoding will fail if mimeData does not contain any URLs, or if at least one extracted URL is not valid.

Parameters:
mimeData the mime data to extract from; cannot be 0
metaData optional pointer to a map holding the metadata
Returns:
the list of urls

Definition at line 282 of file kurl.cpp.

QStringList KUrl::List::mimeDataTypes (  )  [static]

Return the list of mimeTypes that can be decoded by fromMimeData.

Definition at line 277 of file kurl.cpp.

KUrl::List::operator QVariant (  )  const

Converts this KUrl::List to a QVariant, this allows to use KUrl::List in QVariant() constructor.

Definition at line 335 of file kurl.cpp.

void KUrl::List::populateMimeData ( QMimeData *  mimeData,
const KUrl::MetaDataMap &  metaData = MetaDataMap(),
MimeDataFlags  flags = DefaultMimeDataFlags 
) const

Adds URLs data into the given QMimeData.

By default, populateMimeData also exports the URLs as plain text, for e.g. dropping onto a text editor. But in some cases this might not be wanted, e.g. if adding other mime data which provides better plain text data.

WARNING: do not call this method multiple times on the same mimedata object, you can add urls only once. But you can add other things, e.g. images, XML...

Parameters:
mimeData the QMimeData instance used to drag or copy this URL
metaData KIO metadata shipped in the mime data, which is used for instance to set a correct HTTP referrer (some websites require it for downloading e.g. an image)
flags set NoTextExport to prevent setting plain/text data into mimeData In such a case, setExportAsText( false ) should be called.

Definition at line 219 of file kurl.cpp.

QStringList KUrl::List::toStringList (  )  const

Converts the URLs of this list to a list of strings.

Returns:
the list of strings

Definition at line 206 of file kurl.cpp.


The documentation for this class was generated from the following files:
  • kurl.h
  • kurl.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal