KDevelop API Documentation

KFileDnDIconView Class Reference

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

#include <kfiledndiconview.h>

Inheritance diagram for KFileDnDIconView:

Inheritance graph
[legend]
Collaboration diagram for KFileDnDIconView:

Collaboration graph
[legend]
List of all members.

Signals

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

Public Member Functions

 KFileDnDIconView (QWidget *parent=0, const char *name=0)
virtual ~KFileDnDIconView ()
void setDnDEnabled (bool)
 Set 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 QDragObjectdragObject ()
 Creates a QDragObject containing all urls of the selected KFileItem of the view,.
virtual void startDrag ()
 Creates the drag item and starts the drag.
virtual bool acceptDrag (QDropEvent *event) const

Protected Attributes

QTimer m_autoOpenTimer
int m_autoOpenTime
bool m_useAutoOpenTimer
QIconViewItemm_dropItem
bool m_dndEnabled

Detailed Description

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

It adds "drag and drop" suitable for a KFileIconView 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 39 of file kfiledndiconview.h.


Constructor & Destructor Documentation

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

Definition at line 36 of file kfiledndiconview.cpp.

References autoOpenTime, KFileIconView::setAutoUpdate(), setDnDEnabled(), and useAutoOpenTimer().

KFileDnDIconView::~KFileDnDIconView  )  [virtual]
 

Definition at line 46 of file kfiledndiconview.cpp.


Member Function Documentation

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

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

Reimplemented from KFileIconView.

Definition at line 185 of file kfiledndiconview.cpp.

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

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

Reimplemented from KFileIconView.

Definition at line 81 of file kfiledndiconview.cpp.

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

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

Reimplemented from KFileIconView.

Definition at line 114 of file kfiledndiconview.cpp.

References m_autoOpenTimer, and m_dropItem.

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

Reimplemented from KFileIconView.

Definition at line 94 of file kfiledndiconview.cpp.

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

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

Reimplemented from KFileIconView.

Definition at line 121 of file kfiledndiconview.cpp.

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

QDragObject * KFileDnDIconView::dragObject  )  [protected, virtual]
 

Creates a QDragObject containing all urls of the selected KFileItem of the view,.

Returns:
the QDragObject

Reimplemented from KFileIconView.

Definition at line 143 of file kfiledndiconview.cpp.

References KFileIconView::currentFileItem(), KFileIconView::iconSize(), KURLDrag::newDrag(), KFileItem::pixmap(), and KFileIconView::widget().

Referenced by startDrag().

void KFileDnDIconView::dropped QDropEvent  )  [signal]
 

Emitted whenever an decodable item is dropped in the view.

Note: The QDropEvent contains a KURLDrag object.

Referenced by contentsDropEvent().

bool KFileDnDIconView::isAutoOpening  )  const [inline]
 

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

setAutoOpenTime

Definition at line 71 of file kfiledndiconview.h.

bool KFileDnDIconView::isDnDEnabled  )  const [inline]
 

Returns:
wether DnD is enabled or not.

Definition at line 53 of file kfiledndiconview.h.

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

Reimplemented from KFileIconView.

Definition at line 49 of file kfiledndiconview.cpp.

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

void KFileDnDIconView::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 163 of file kfiledndiconview.cpp.

References m_autoOpenTime, and useAutoOpenTimer().

void KFileDnDIconView::setDnDEnabled bool   ) 
 

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

Definition at line 179 of file kfiledndiconview.cpp.

References m_dndEnabled, and KFileIconView::setAcceptDrops().

Referenced by KFileDnDIconView(), and readConfig().

void KFileDnDIconView::slotOpenFolder  )  [protected, slot]
 

Called when the auto timer times out.

Open the current folder.

Definition at line 62 of file kfiledndiconview.cpp.

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

Referenced by useAutoOpenTimer().

void KFileDnDIconView::startDrag  )  [protected, virtual]
 

Creates the drag item and starts the drag.

Definition at line 137 of file kfiledndiconview.cpp.

References dragObject().

void KFileDnDIconView::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 168 of file kfiledndiconview.cpp.

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

Referenced by KFileDnDIconView(), and setAutoOpenTime().

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

Reimplemented from KFileIconView.

Definition at line 56 of file kfiledndiconview.cpp.

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


Member Data Documentation

int KFileDnDIconView::m_autoOpenTime [protected]
 

Definition at line 111 of file kfiledndiconview.h.

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

QTimer KFileDnDIconView::m_autoOpenTimer [protected]
 

Definition at line 110 of file kfiledndiconview.h.

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

bool KFileDnDIconView::m_dndEnabled [protected]
 

Definition at line 114 of file kfiledndiconview.h.

Referenced by setDnDEnabled(), and writeConfig().

QIconViewItem* KFileDnDIconView::m_dropItem [protected]
 

Definition at line 113 of file kfiledndiconview.h.

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

bool KFileDnDIconView::m_useAutoOpenTimer [protected]
 

Definition at line 112 of file kfiledndiconview.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 Tue Feb 22 09:42:04 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003