libkonq Library API Documentation

KonqOperations Class Reference

Implements file operations (move,del,trash,shred,paste,copy,move,link...) for konqueror and kdesktop whatever the view mode is (icon, tree, ...). More...

#include <konq_operations.h>

Inheritance diagram for KonqOperations:

QObject List of all members.

Public Types

enum  {
  TRASH, DEL, SHRED, COPY,
  MOVE, LINK, EMPTYTRASH, STAT,
  MKDIR
}

Signals

void statFinished (const KFileItem *item)
void aboutToCreate (const QPoint &pos, const QValueList< KIO::CopyInfo > &files)

Static Public Methods

void editMimeType (const QString &mimeType)
void del (QWidget *parent, int method, const KURL::List &selectedURLs)
void copy (QWidget *parent, int method, const KURL::List &selectedURLs, const KURL &destUrl)
void doDrop (const KFileItem *destItem, const KURL &destURL, QDropEvent *ev, QWidget *parent)
void doPaste (QWidget *parent, const KURL &destURL, const QPoint &pos)
void doPaste (QWidget *parent, const KURL &destURL)
void emptyTrash ()
void mkdir (QWidget *parent, const KURL &url)
void statURL (const KURL &url, const QObject *receiver, const char *member)
void rename (QWidget *parent, const KURL &oldurl, const QString &name)
void rename (QWidget *parent, const KURL &oldurl, const KURL &newurl)
void newDir (QWidget *parent, const KURL &baseURL)

Protected Types

enum  { DEFAULT_CONFIRMATION, SKIP_CONFIRMATION, FORCE_CONFIRMATION }

Protected Slots

void slotAboutToCreate (KIO::Job *job, const QValueList< KIO::CopyInfo > &files)
void slotResult (KIO::Job *job)
void slotStatResult (KIO::Job *job)
void asyncDrop (const KFileItem *item)
void slotKIOPaste ()
void doFileCopy ()

Protected Methods

 KonqOperations (QWidget *parent)
virtual ~KonqOperations ()
bool askDeleteConfirmation (const KURL::List &selectedURLs, int confirmation)
void _del (int method, const KURL::List &selectedURLs, int confirmation)
void _statURL (const KURL &url, const QObject *receiver, const char *member)
void setOperation (KIO::Job *job, int method, const KURL::List &src, const KURL &dest)
void setDropInfo (DropInfo *info)
void setPasteInfo (KIOPasteInfo *info)

Detailed Description

Implements file operations (move,del,trash,shred,paste,copy,move,link...) for konqueror and kdesktop whatever the view mode is (icon, tree, ...).

Definition at line 35 of file konq_operations.h.


Member Function Documentation

void KonqOperations::editMimeType const QString   mimeType [static]
 

Pop up properties dialog for mimetype mimeType.

Definition at line 72 of file konq_operations.cc.

References QString::fromLatin1().

void KonqOperations::del QWidget   parent,
int    method,
const KURL::List &    selectedURLs
[static]
 

Parameters:
method  should be TRASH, DEL or SHRED

Definition at line 79 of file konq_operations.cc.

References _del().

void KonqOperations::copy QWidget   parent,
int    method,
const KURL::List &    selectedURLs,
const KURL &    destUrl
[static]
 

Parameters:
method  should be COPY, MOVE or LINK

Definition at line 176 of file konq_operations.cc.

References setOperation().

void KonqOperations::doDrop const KFileItem *    destItem,
const KURL &    destURL,
QDropEvent   ev,
QWidget   parent
[static]
 

Drop.

Parameters:
destItem  destination KFileItem for the drop (background or item)
destURL  destination URL for the drop.
ev  the drop event
parent  parent widget (for error dialog box if any)
If destItem is 0L, doDrop will stat the URL to determine it.

Definition at line 324 of file konq_operations.cc.

References _statURL(), QDropEvent::accept(), QDropEvent::acceptAction(), QDropEvent::action(), asyncDrop(), QMap::begin(), QTextDrag::canDecode(), QObject::child(), QMap::count(), QTextDrag::decode(), QMap::end(), QDropEvent::format(), QDropEvent::pos(), QDropEvent::provides(), setDropInfo(), setPasteInfo(), QTimer::singleShot(), and QDropEvent::source().

void KonqOperations::doPaste QWidget   parent,
const KURL &    destURL,
const QPoint   pos
[static]
 

Paste the clipboard contents.

Definition at line 152 of file konq_operations.cc.

References QApplication::clipboard(), QMimeSource::provides(), setOperation(), and setPasteInfo().

void KonqOperations::mkdir QWidget   parent,
const KURL &    url
[static]
 

Create a directory.

Definition at line 139 of file konq_operations.cc.

References setOperation().

Referenced by newDir().

void KonqOperations::statURL const KURL &    url,
const QObject   receiver,
const char *    member
[static]
 

Get info about a given URL, and when that's done (it's asynchronous!), call a given slot with the KFileItem * as argument.

The KFileItem will be deleted by statURL after calling the slot. Make a copy if you need one !

Definition at line 741 of file konq_operations.cc.

References _statURL(), and m_method.

void KonqOperations::rename QWidget   parent,
const KURL &    oldurl,
const QString   name
[static]
 

Do a renaming.

Parameters:
parent  the parent widget, passed to KonqOperations ctor
oldurl  the current url of the file to be renamed
name  the new name for the file. Shouldn't include '/'.

Definition at line 800 of file konq_operations.cc.

void KonqOperations::rename QWidget   parent,
const KURL &    oldurl,
const KURL &    newurl
[static]
 

Do a renaming.

Parameters:
parent  the parent widget, passed to KonqOperations ctor
oldurl  the current url of the file to be renamed
newurl  the new url for the file Use this version if the other one wouldn't work :) (e.g. because name could be a relative path, including a '/').

Definition at line 669 of file konq_operations.cc.

References QString::right(), and setOperation().

void KonqOperations::newDir QWidget   parent,
const KURL &    baseURL
[static]
 

Ask for the name of a new directory and create it.

Parameters:
parent  the parent widget
baseURL  the directory to create the new directory in

Definition at line 808 of file konq_operations.cc.

References QString::arg(), QFile::encodeName(), QString::isEmpty(), mkdir(), and QObject::name().

Referenced by KNewMenu::slotNewDir().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for libkonq Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Apr 29 21:20:30 2004 by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2003