KDE3Support
k3urldrag.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KUrlDRAG_H 00021 #define KUrlDRAG_H 00022 00023 #include <kde3support_export.h> 00024 #include <kurl.h> 00025 00026 #include <QtCore/QStringList> 00027 #include <Qt3Support/Q3ColorDrag> 00028 00029 class QMimeSource; 00030 00031 class K3URLDragPrivate; 00046 class KDE3SUPPORT_EXPORT K3URLDrag : public Q3UriDrag 00047 { 00048 public: 00058 K3URLDrag( const KUrl::List &urls, QWidget* dragSource = 0 ); 00068 K3URLDrag( const KUrl::List &urls, const QMap<QString, QString>& metaData, 00069 QWidget* dragSource = 0 ); 00070 00071 virtual ~K3URLDrag(); 00072 00079 void setExportAsText( bool exp ); 00080 00084 static K3URLDrag * newDrag( const KUrl::List &urls, QWidget* dragSource = 0 ); 00085 00089 static K3URLDrag * newDrag( const KUrl::List &urls, 00090 const QMap<QString, QString>& metaData, 00091 QWidget* dragSource = 0 ); 00092 00100 QMap<QString, QString> &metaData(); 00101 00110 static bool decode( const QMimeSource *e, KUrl::List &urls ); 00111 00122 static bool decode( const QMimeSource *e, KUrl::List &urls, QMap<QString,QString>& metaData ); 00123 00127 static QString urlToString(const KUrl &url); 00128 00132 static KUrl stringToUrl(const QByteArray &s); 00133 00134 #ifdef Q_WS_QWS 00135 00140 static bool decode( QStringList const &e, KUrl::List &uris ); 00141 #endif 00142 00144 virtual const char * format( int i ) const; 00146 virtual QByteArray encodedData( const char* mime ) const; 00147 00148 protected: 00152 K3URLDrag( const Q3StrList & urls, const QMap<QString,QString>& metaData, 00153 QWidget * dragSource ); 00154 00155 private: 00156 void init(const KUrl::List &urls); 00157 00158 Q3StrList m_urls; 00159 QMap<QString,QString> m_metaData; 00160 K3URLDragPrivate* d; 00161 }; 00162 00163 #endif 00164
KDE 4.6 API Reference