konq_operations.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __konq_operations_h__
00020 #define __konq_operations_h__
00021
00022 #include <kurl.h>
00023 #include <qobject.h>
00024 #include <qevent.h>
00025
00026 namespace KIO { class Job; }
00027 class QWidget;
00028 class KFileItem;
00029 class KonqMainWindow;
00030
00035 class KonqOperations : public QObject
00036 {
00037 Q_OBJECT
00038 protected:
00039 KonqOperations( QWidget * parent );
00040 virtual ~KonqOperations();
00041
00042 public:
00046 static void editMimeType( const QString & mimeType );
00047
00048 enum { TRASH, DEL, SHRED, COPY, MOVE, LINK, EMPTYTRASH, STAT, MKDIR };
00052 static void del( QWidget * parent, int method, const KURL::List & selectedURLs );
00053
00057 static void copy( QWidget * parent, int method, const KURL::List & selectedURLs, const KURL& destUrl );
00067 static void doDrop( const KFileItem * destItem, const KURL & destURL, QDropEvent * ev, QWidget * parent );
00068
00072 static void doPaste( QWidget * parent, const KURL & destURL );
00073
00074 static void emptyTrash();
00075
00079 static void mkdir( QWidget *parent, const KURL & url );
00080
00087 static void statURL( const KURL & url, const QObject *receiver, const char *member );
00088
00089 static void rename( QWidget * parent, const KURL & oldurl, const QString & name );
00090
00091 signals:
00092 void statFinished( const KFileItem * item );
00093
00094 protected:
00095 enum { DEFAULT_CONFIRMATION, SKIP_CONFIRMATION, FORCE_CONFIRMATION };
00096 bool askDeleteConfirmation( const KURL::List & selectedURLs, int confirmation );
00097 void _del( int method, const KURL::List & selectedURLs, int confirmation );
00098 void _statURL( const KURL & url, const QObject *receiver, const char *member );
00099
00100
00101 void setOperation( KIO::Job * job, int method, const KURL::List & src, const KURL & dest );
00102
00103 struct DropInfo
00104 {
00105 DropInfo( uint k, KURL::List & l, const QMap<QString,QString> &m,
00106 int x, int y, QDropEvent::Action a ) :
00107 keybstate(k), lst(l), metaData(m), mousePos(x,y), action(a) {}
00108 uint keybstate;
00109 KURL::List lst;
00110 QMap<QString,QString> metaData;
00111 QPoint mousePos;
00112 QDropEvent::Action action;
00113 };
00114
00115 void setDropInfo( DropInfo * info ) { m_info = info; }
00116
00117 struct KIOPasteInfo
00118 {
00119 QByteArray data;
00120 KURL destURL;
00121 };
00122 void setPasteInfo( KIOPasteInfo * info ) { m_pasteInfo = info; }
00123
00124 protected slots:
00125
00126 void slotResult( KIO::Job * job );
00127 void slotStatResult( KIO::Job * job );
00128 void asyncDrop( const KFileItem * item );
00129 void slotKIOPaste();
00130 void doFileCopy();
00131
00132 private:
00133 int m_method;
00134
00135 KURL m_destURL;
00136
00137 DropInfo * m_info;
00138 KIOPasteInfo * m_pasteInfo;
00139 };
00140
00141 #endif
This file is part of the documentation for kdelibs Version 3.1.5.