kdecore Library API Documentation

kurldrag.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2000 David Faure <faure@kde.org>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __KURLDRAG_H
00021 #define __KURLDRAG_H
00022 
00023 #include <qstringlist.h>
00024 #include <qdragobject.h>
00025 #include <kurl.h>
00026 #include "kdemacros.h"
00027 class QMimeSource;
00028 
00029 class KURLDragPrivate;
00044 class KURLDrag : public QUriDrag
00045 {
00046 public:
00057   KURLDrag( const KURL::List &urls, QWidget* dragSource = 0, const char * name = 0 );
00068   KURLDrag( const KURL::List &urls, const QMap<QString, QString>& metaData,
00069             QWidget* dragSource = 0, const char * name = 0 );
00070 
00071   virtual ~KURLDrag();
00072 
00076   static KURLDrag * newDrag( const KURL::List &urls, QWidget* dragSource = 0, const char * name = 0 ) KDE_DEPRECATED;
00077 
00081   static KURLDrag * newDrag( const KURL::List &urls, const QMap<QString, QString>& metaData,
00082                              QWidget* dragSource = 0, const char * name = 0 ) KDE_DEPRECATED;
00083 
00091   QMap<QString, QString> &metaData() { return m_metaData; }
00092 
00101   static bool decode( const QMimeSource *e, KURL::List &urls );
00102 
00113   static bool decode( const QMimeSource *e, KURL::List &urls, QMap<QString,QString>& metaData );
00114 
00119   static QString urlToString(const KURL &url);
00120 
00125   static KURL stringToUrl(const QCString &s);
00126 
00127 #ifdef Q_WS_QWS
00128 
00133   static bool decode( QStringList const &e, KURL::List &uris );
00134 #endif
00135 
00136 protected:
00140   KURLDrag( const QStrList & urls, const QMap<QString,QString>& metaData,
00141             QWidget * dragSource, const char* name ) KDE_DEPRECATED;
00142 
00143   virtual const char * format( int i ) const;
00144   virtual QByteArray encodedData( const char* mime ) const;
00145 
00146 private:
00147   void init(const KURL::List &urls);
00148 
00149   QStrList m_urls;
00150   QMap<QString,QString> m_metaData;
00151   KURLDragPrivate* d;
00152 };
00153 
00154 #endif
KDE Logo
This file is part of the documentation for kdecore Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Jul 22 10:16:20 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003