konq_drag.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __konqdrag_h__
00020 #define __konqdrag_h__
00021
00022 #include <qdragobject.h>
00023 #include <qrect.h>
00024 #include <qstring.h>
00025 #include <qiconview.h>
00026
00027 #include <libkonq_export.h>
00028
00029 #include <kurl.h>
00030
00031
00032
00033
00034
00035
00036
00037
00038 class LIBKONQ_EXPORT KonqIconDrag : public QIconDrag
00039 {
00040 Q_OBJECT
00041
00042 public:
00043 KonqIconDrag( QWidget * dragSource, const char* name = 0 );
00044 virtual ~KonqIconDrag() {}
00045
00046 const char* format( int i ) const;
00047 QByteArray encodedData( const char* mime ) const;
00048
00049 void append( const QIconDragItem &item, const QRect &pr,
00050 const QRect &tr, const QString &url );
00051
00052 void setMoveSelection( bool move ) { m_bCutSelection = move; }
00053
00054 static bool canDecode( const QMimeSource* e );
00055
00056 protected:
00057 QStringList urls;
00058 bool m_bCutSelection;
00059 };
00060
00066 class LIBKONQ_EXPORT KonqIconDrag2 : public KonqIconDrag
00067 {
00068 Q_OBJECT
00069
00070 public:
00071 KonqIconDrag2( QWidget * dragSource );
00072 virtual ~KonqIconDrag2() {}
00073
00074 virtual const char* format( int i ) const;
00075 virtual QByteArray encodedData( const char* mime ) const;
00076
00077 void append( const QIconDragItem &item, const QRect &pr,
00078 const QRect &tr, const QString &url, const KURL &mostLocalURL );
00079
00080 private:
00081 QStringList m_kdeURLs;
00082 };
00083
00084
00085 class LIBKONQ_EXPORT KonqDrag : public QUriDrag
00086 {
00087 public:
00088
00089 static KonqDrag * newDrag( const KURL::List & urls,
00090 bool move, QWidget * dragSource = 0, const char* name = 0 );
00091
00100 KonqDrag( const KURL::List & urls, const KURL::List& mostLocalUrls, bool cut, QWidget * dragSource = 0 );
00101
00102 protected:
00103
00104 KonqDrag( const QStrList & urls, bool cut, QWidget * dragSource, const char* name );
00105
00106 public:
00107 virtual ~KonqDrag() {}
00108
00109 virtual const char* format( int i ) const;
00110 virtual QByteArray encodedData( const char* mime ) const;
00111
00112 void setMoveSelection( bool move ) { m_bCutSelection = move; }
00113
00114
00115 static bool decodeIsCutSelection( const QMimeSource *e );
00116
00117 protected:
00118 bool m_bCutSelection;
00119 QStrList m_urls;
00120 };
00121
00122 #endif
|