KDevelop API Documentation

KFileDnDDetailView Class Reference

This is a fileview inherited from KFileDetailView. "Drag and drop" aware KFileDetailView. More...

#include <kfilednddetailview.h>

Inheritance diagram for KFileDnDDetailView:

KFileDetailView KListView KFileView QListView List of all members.

Signals

void dropped (QDropEvent *)
 Emitted whenever an decodable item is dropped in the view.

void dropped (KFileView *, QDropEvent *)
 Emitted whenever an decodable item is dropped in the view Note: The QDropEvent contains a KURLDrag object.

void dropped (KFileView *, KURL::List &urls)
 Emitted whenever an decodable item is dropped in the view.


Public Member Functions

 KFileDnDDetailView (QWidget *parent=0, const char *name=0)
virtual ~KFileDnDDetailView ()
void setDnDEnabled (bool)
 Set this to true if Drag'n drop should be enabled or not, default is enabled.

bool isDnDEnabled () const
void setAutoOpenTime (const int &time)
 Sets the auto open time, which means the time that will elapse before a directory is automatically opened after entered by DnD.

void useAutoOpenTimer (bool on=true)
 Set this to true if you want the view to use it's auto open functionallity otherwhise set it to false.

bool isAutoOpening () const
virtual void readConfig (KConfig *, const QString &group=QString::null)
virtual void writeConfig (KConfig *, const QString &group=QString::null)

Protected Slots

void slotOpenFolder ()
 Called when the auto timer times out.


Protected Member Functions

virtual void contentsDragEnterEvent (QDragEnterEvent *e)
virtual void contentsDragMoveEvent (QDragMoveEvent *e)
virtual void contentsDragLeaveEvent (QDragLeaveEvent *e)
virtual void contentsDropEvent (QDropEvent *e)
virtual void startDrag ()
 Create dragobject encoding the current selection and starts the drag.

virtual QDragObjectdragObject () const
virtual bool acceptDrag (QDropEvent *event) const

Protected Attributes

QTimer m_autoOpenTimer
int m_autoOpenTime
bool m_useAutoOpenTimer
QListViewItemm_dropItem
KURLDragm_dragObject
bool m_dndEnabled

Detailed Description

This is a fileview inherited from KFileDetailView. "Drag and drop" aware KFileDetailView.

It adds "drag and drop" handling to the view suitable for a KFileDetailView. No special setup is needed, just connect to the dropped signals and the view will take care of the rest.

Author:
Björn Sahlström

Definition at line 40 of file kfilednddetailview.h.


Constructor & Destructor Documentation

KFileDnDDetailView::KFileDnDDetailView QWidget parent = 0,
const char *  name = 0
 

Definition at line 36 of file kfilednddetailview.cpp.

References autoOpenTime, KFileDnDDetailView(), setDnDEnabled(), and useAutoOpenTimer().

Referenced by KFileDnDDetailView().

KFileDnDDetailView::~KFileDnDDetailView  )  [virtual]
 

Definition at line 46 of file kfilednddetailview.cpp.


Member Function Documentation

bool KFileDnDDetailView::acceptDrag QDropEvent event  )  const [protected, virtual]
 

Returns:
true if we can decode the drag and support the action

Reimplemented from KFileDetailView.

Definition at line 179 of file kfilednddetailview.cpp.

References acceptDrag().

Referenced by acceptDrag(), contentsDragEnterEvent(), contentsDragMoveEvent(), and contentsDropEvent().

void KFileDnDDetailView::contentsDragEnterEvent QDragEnterEvent e  )  [protected, virtual]
 

Reimplemented from KFileDetailView.

Definition at line 81 of file kfilednddetailview.cpp.

References acceptDrag(), contentsDragEnterEvent(), endl(), kdDebug(), m_autoOpenTime, m_autoOpenTimer, m_dropItem, and m_useAutoOpenTimer.

Referenced by contentsDragEnterEvent().

void KFileDnDDetailView::contentsDragLeaveEvent QDragLeaveEvent e  )  [protected, virtual]
 

Reimplemented from KFileDetailView.

Definition at line 120 of file kfilednddetailview.cpp.

References contentsDragLeaveEvent(), endl(), kdDebug(), m_autoOpenTimer, m_dropItem, and m_useAutoOpenTimer.

Referenced by contentsDragLeaveEvent().

void KFileDnDDetailView::contentsDragMoveEvent QDragMoveEvent e  )  [protected, virtual]
 

Reimplemented from KFileDetailView.

Definition at line 97 of file kfilednddetailview.cpp.

References acceptDrag(), contentsDragMoveEvent(), endl(), kdDebug(), m_autoOpenTime, m_autoOpenTimer, m_dropItem, and m_useAutoOpenTimer.

Referenced by contentsDragMoveEvent().

void KFileDnDDetailView::contentsDropEvent QDropEvent e  )  [protected, virtual]
 

Reimplemented from KFileDetailView.

Definition at line 130 of file kfilednddetailview.cpp.

References acceptDrag(), contentsDropEvent(), dropped(), endl(), kdDebug(), m_autoOpenTimer, m_dropItem, and m_useAutoOpenTimer.

Referenced by contentsDropEvent().

QDragObject * KFileDnDDetailView::dragObject  )  const [protected, virtual]
 

Returns:
the dragObject

Definition at line 175 of file kfilednddetailview.cpp.

References m_dragObject.

void KFileDnDDetailView::dropped KFileView ,
KURL::List urls
[signal]
 

Emitted whenever an decodable item is dropped in the view.

Parameters:
urls contains a list of all dropped KURL

void KFileDnDDetailView::dropped KFileView ,
QDropEvent
[signal]
 

Emitted whenever an decodable item is dropped in the view Note: The QDropEvent contains a KURLDrag object.

void KFileDnDDetailView::dropped QDropEvent  )  [signal]
 

Emitted whenever an decodable item is dropped in the view.

Note: The QDropEvent contains a KURLDrag object.

Referenced by contentsDropEvent().

bool KFileDnDDetailView::isAutoOpening  )  const [inline]
 

Returns:
true if auto open functionallity is turned ON (default), otherwhise false
See also:
useAutoOpenTimer

setAutoOpenTime

Definition at line 72 of file kfilednddetailview.h.

References m_useAutoOpenTimer.

bool KFileDnDDetailView::isDnDEnabled  )  const [inline]
 

Returns:
wether DnD is enabled or not.

Definition at line 54 of file kfilednddetailview.h.

References m_dndEnabled.

void KFileDnDDetailView::readConfig KConfig ,
const QString group = QString::null
[virtual]
 

Reimplemented from KFileDetailView.

Definition at line 49 of file kfilednddetailview.cpp.

References KConfigBase::readBoolEntry(), readConfig(), and setDnDEnabled().

Referenced by readConfig().

void KFileDnDDetailView::setAutoOpenTime const int &  time  ) 
 

Sets the auto open time, which means the time that will elapse before a directory is automatically opened after entered by DnD.

Only need to call this if you want to change the predefined time that is 750 ms. This also calls useAutoOpenTimer so no need to call this to.

Definition at line 186 of file kfilednddetailview.cpp.

References m_autoOpenTime, setAutoOpenTime(), and useAutoOpenTimer().

Referenced by setAutoOpenTime().

void KFileDnDDetailView::setDnDEnabled bool   ) 
 

Set this to true if Drag'n drop should be enabled or not, default is enabled.

Definition at line 202 of file kfilednddetailview.cpp.

References m_dndEnabled, and setDnDEnabled().

Referenced by KFileDnDDetailView(), readConfig(), and setDnDEnabled().

void KFileDnDDetailView::slotOpenFolder  )  [protected, slot]
 

Called when the auto timer times out.

Open the current folder.

Definition at line 62 of file kfilednddetailview.cpp.

References KFileViewSignaler::activate(), m_autoOpenTimer, m_dropItem, and m_useAutoOpenTimer.

Referenced by useAutoOpenTimer().

void KFileDnDDetailView::startDrag  )  [protected, virtual]
 

Create dragobject encoding the current selection and starts the drag.

Reimplemented from KListView.

Definition at line 151 of file kfilednddetailview.cpp.

References KFileDetailView::currentFileItem(), endl(), kdDebug(), m_dragObject, KFileItem::pixmap(), and KFileDetailView::widget().

void KFileDnDDetailView::useAutoOpenTimer bool  on = true  ) 
 

Set this to true if you want the view to use it's auto open functionallity otherwhise set it to false.

By default this is turned ON.

Definition at line 191 of file kfilednddetailview.cpp.

References m_autoOpenTimer, m_dropItem, m_useAutoOpenTimer, slotOpenFolder(), and useAutoOpenTimer().

Referenced by KFileDnDDetailView(), setAutoOpenTime(), and useAutoOpenTimer().

void KFileDnDDetailView::writeConfig KConfig ,
const QString group = QString::null
[virtual]
 

Reimplemented from KFileDetailView.

Definition at line 56 of file kfilednddetailview.cpp.

References m_dndEnabled, writeConfig(), and KConfigBase::writeEntry().

Referenced by writeConfig().


Member Data Documentation

int KFileDnDDetailView::m_autoOpenTime [protected]
 

Definition at line 121 of file kfilednddetailview.h.

Referenced by contentsDragEnterEvent(), contentsDragMoveEvent(), and setAutoOpenTime().

QTimer KFileDnDDetailView::m_autoOpenTimer [protected]
 

Definition at line 120 of file kfilednddetailview.h.

Referenced by contentsDragEnterEvent(), contentsDragLeaveEvent(), contentsDragMoveEvent(), contentsDropEvent(), slotOpenFolder(), and useAutoOpenTimer().

bool KFileDnDDetailView::m_dndEnabled [protected]
 

Definition at line 125 of file kfilednddetailview.h.

Referenced by isDnDEnabled(), setDnDEnabled(), and writeConfig().

KURLDrag* KFileDnDDetailView::m_dragObject [protected]
 

Definition at line 124 of file kfilednddetailview.h.

Referenced by dragObject(), and startDrag().

QListViewItem* KFileDnDDetailView::m_dropItem [protected]
 

Definition at line 123 of file kfilednddetailview.h.

Referenced by contentsDragEnterEvent(), contentsDragLeaveEvent(), contentsDragMoveEvent(), contentsDropEvent(), slotOpenFolder(), and useAutoOpenTimer().

bool KFileDnDDetailView::m_useAutoOpenTimer [protected]
 

Definition at line 122 of file kfilednddetailview.h.

Referenced by contentsDragEnterEvent(), contentsDragLeaveEvent(), contentsDragMoveEvent(), contentsDropEvent(), isAutoOpening(), slotOpenFolder(), and useAutoOpenTimer().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Oct 6 17:39:24 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003