libkonq Library API Documentation

konq_operations.h

00001 /*  This file is part of the KDE project
00002     Copyright (C) 2000  David Faure <faure@kde.org>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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     // internal, for COPY/MOVE/LINK/MKDIR
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     // internal, for doDrop
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     //KURL::List m_srcURLs;
00135     KURL m_destURL;
00136     // for doDrop
00137     DropInfo * m_info;
00138     KIOPasteInfo * m_pasteInfo;
00139 };
00140 
00141 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Thu Jan 29 23:03:28 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001