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:

Inheritance graph
[legend]
Collaboration diagram for KFileDnDDetailView:

Collaboration graph
[legend]
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, KFileDetailView::setAutoUpdate(), setDnDEnabled(), and useAutoOpenTimer().

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.

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

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

Reimplemented from KFileDetailView.

Definition at line 81 of file kfilednddetailview.cpp.

References acceptDrag(), kdDebug(), m_autoOpenTime, m_autoOpenTimer, and m_dropItem.

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

Reimplemented from KFileDetailView.

Definition at line 120 of file kfilednddetailview.cpp.

References kdDebug(), m_autoOpenTimer, and m_dropItem.

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

Reimplemented from KFileDetailView.

Definition at line 97 of file kfilednddetailview.cpp.

References acceptDrag(), kdDebug(), m_autoOpenTime, m_autoOpenTimer, and m_dropItem.

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

Reimplemented from KFileDetailView.

Definition at line 130 of file kfilednddetailview.cpp.

References acceptDrag(), KURLDrag::decode(), dropped(), kdDebug(), m_autoOpenTimer, and m_dropItem.

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

Returns:
the dragObject

Definition at line 175 of file kfilednddetailview.cpp.

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.

bool KFileDnDDetailView::isDnDEnabled  )  const [inline]
 

Returns:
wether DnD is enabled or not.

Definition at line 54 of file kfilednddetailview.h.

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

Reimplemented from KFileDetailView.

Definition at line 49 of file kfilednddetailview.cpp.

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

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, and useAutoOpenTimer().

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, KListView::setAcceptDrops(), KListView::setDragEnabled(), and KListView::setDropVisualizer().

Referenced by KFileDnDDetailView(), and readConfig().

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, and m_dropItem.

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(), kdDebug(), m_dragObject, KURLDrag::newDrag(), 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, and slotOpenFolder().

Referenced by KFileDnDDetailView(), and setAutoOpenTime().

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

Reimplemented from KFileDetailView.

Definition at line 56 of file kfilednddetailview.cpp.

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


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 setDnDEnabled(), and writeConfig().

KURLDrag* KFileDnDDetailView::m_dragObject [protected]
 

Definition at line 124 of file kfilednddetailview.h.

Referenced by 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 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.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Mar 23 00:24:36 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003