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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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; class CopyInfo; }
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, const QPoint &pos );
00073     static void doPaste( QWidget * parent, const KURL & destURL );
00074 
00075     static void emptyTrash();
00076 
00080     static void mkdir( QWidget *parent, const KURL & url );
00081 
00088     static void statURL( const KURL & url, const QObject *receiver, const char *member );
00089 
00096     static void rename( QWidget * parent, const KURL & oldurl, const QString & name );
00097 
00106     static void rename( QWidget * parent, const KURL & oldurl, const KURL & newurl );
00107 
00113     static void newDir( QWidget * parent, const KURL & baseURL );
00114 
00115 signals:
00116     void statFinished( const KFileItem * item );
00117     void aboutToCreate(const QPoint &pos, const QValueList<KIO::CopyInfo> &files);
00118 
00119 protected:
00120     enum { DEFAULT_CONFIRMATION, SKIP_CONFIRMATION, FORCE_CONFIRMATION };
00121     bool askDeleteConfirmation( const KURL::List & selectedURLs, int confirmation );
00122     void _del( int method, const KURL::List & selectedURLs, int confirmation );
00123     void _statURL( const KURL & url, const QObject *receiver, const char *member );
00124 
00125     // internal, for COPY/MOVE/LINK/MKDIR
00126     void setOperation( KIO::Job * job, int method, const KURL::List & src, const KURL & dest );
00127 
00128     struct DropInfo
00129     {
00130         DropInfo( uint k, KURL::List & l, const QMap<QString,QString> &m,
00131                   int x, int y, QDropEvent::Action a ) :
00132             keybstate(k), lst(l), metaData(m), mousePos(x,y), action(a) {}
00133         uint keybstate;
00134         KURL::List lst;
00135         QMap<QString,QString> metaData;
00136         QPoint mousePos;
00137         QDropEvent::Action action;
00138     };
00139     // internal, for doDrop
00140     void setDropInfo( DropInfo * info ) { m_info = info; }
00141 
00142     struct KIOPasteInfo
00143     {
00144         QByteArray data;
00145         KURL destURL;
00146         QPoint mousePos;
00147     };
00148     void setPasteInfo( KIOPasteInfo * info ) { m_pasteInfo = info; }
00149 
00150 protected slots:
00151 
00152     void slotAboutToCreate(KIO::Job *job, const QValueList<KIO::CopyInfo> &files);
00153     void slotResult( KIO::Job * job );
00154     void slotStatResult( KIO::Job * job );
00155     void asyncDrop( const KFileItem * item );
00156     void slotKIOPaste();
00157     void doFileCopy();
00158 
00159 private:
00160     int m_method;
00161     //KURL::List m_srcURLs;
00162     KURL m_destURL;
00163     // for doDrop
00164     DropInfo * m_info;
00165     KIOPasteInfo * m_pasteInfo;
00166 };
00167 
00168 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 5 04:41:08 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003