kfiledndiconview.h
Go to the documentation of this file.00001 /************************************************************************** 00002 * kfiledndiconview.h - description 00003 * ------------------- 00004 * begin : Wed Nov 1 2000 00005 * copyright : (C) 2000 by Björn Sahlström 00006 * email : kbjorn@users.sourceforge.net 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 **************************************************************************/ 00017 00018 #ifndef KFILEDNDICONVIEW_H 00019 #define KFILEDNDICONVIEW_H 00020 00022 // Qt specific include files 00023 #include <qwidget.h> 00024 #include <qtimer.h> 00026 // KDE specific include files 00027 #include <kfileiconview.h> 00028 #include <kurldrag.h> 00029 00039 class KFileDnDIconView : public KFileIconView { 00040 Q_OBJECT 00041 public: // Public methods 00043 KFileDnDIconView(QWidget *parent=0, const char *name=0); 00045 virtual ~KFileDnDIconView(); 00049 void setDnDEnabled( bool ); 00053 bool isDnDEnabled() const { return m_dndEnabled; } 00060 void setAutoOpenTime( const int& time ); 00065 void useAutoOpenTimer( bool on=true ); 00071 bool isAutoOpening() const { return m_useAutoOpenTimer; } 00073 virtual void readConfig( KConfig*, const QString& group = QString::null ); 00075 virtual void writeConfig( KConfig*, const QString& group = QString::null ); 00076 signals: // Signals 00081 void dropped( QDropEvent* ); 00082 protected slots: // Protected slots 00086 void slotOpenFolder(); 00087 protected: // Protected methods 00089 virtual void contentsDragEnterEvent( QDragEnterEvent *e ); 00091 virtual void contentsDragMoveEvent( QDragMoveEvent *e ); 00093 virtual void contentsDragLeaveEvent( QDragLeaveEvent *e ); 00095 virtual void contentsDropEvent( QDropEvent* e ); 00100 virtual QDragObject* dragObject(); 00104 virtual void startDrag(); 00108 virtual bool acceptDrag(QDropEvent* event) const; 00109 protected: // Private attributes 00110 QTimer m_autoOpenTimer; 00111 int m_autoOpenTime; 00112 bool m_useAutoOpenTimer; 00113 QIconViewItem* m_dropItem; 00114 bool m_dndEnabled; 00115 }; 00116 #endif