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 #include <libkonq_export.h>
00026 
00027 namespace KIO { class Job; class CopyInfo; }
00028 class QWidget;
00029 class KFileItem;
00030 class KonqMainWindow;
00031 
00036 class LIBKONQ_EXPORT KonqOperations : public QObject
00037 {
00038     Q_OBJECT
00039 protected:
00040     KonqOperations( QWidget * parent );
00041     virtual ~KonqOperations();
00042 
00043 public:
00047     static void editMimeType( const QString & mimeType );
00048 
00049     enum { TRASH, DEL, SHRED, COPY, MOVE, LINK, EMPTYTRASH, STAT, MKDIR };
00053     static void del( QWidget * parent, int method, const KURL::List & selectedURLs );
00054 
00058     static void copy( QWidget * parent, int method, const KURL::List & selectedURLs, const KURL& destUrl );
00068     static void doDrop( const KFileItem * destItem, const KURL & destURL, QDropEvent * ev, QWidget * parent );
00069 
00073     static void doPaste( QWidget * parent, const KURL & destURL, const QPoint &pos );
00074     static void doPaste( QWidget * parent, const KURL & destURL );
00075 
00076     static void emptyTrash();
00077 
00081     static void mkdir( QWidget *parent, const KURL & url );
00082 
00089     static void statURL( const KURL & url, const QObject *receiver, const char *member );
00090 
00097     static void rename( QWidget * parent, const KURL & oldurl, const QString & name );
00098 
00107     static void rename( QWidget * parent, const KURL & oldurl, const KURL & newurl );
00108 
00114     static void newDir( QWidget * parent, const KURL & baseURL );
00115 
00116 signals:
00117     void statFinished( const KFileItem * item );
00118     void aboutToCreate(const QPoint &pos, const QValueList<KIO::CopyInfo> &files);
00119 
00120 protected:
00121     enum { DEFAULT_CONFIRMATION, SKIP_CONFIRMATION, FORCE_CONFIRMATION };
00122     bool askDeleteConfirmation( const KURL::List & selectedURLs, int confirmation );
00123     void _del( int method, const KURL::List & selectedURLs, int confirmation );
00124     void _statURL( const KURL & url, const QObject *receiver, const char *member );
00125 
00126     // internal, for COPY/MOVE/LINK/MKDIR
00127     void setOperation( KIO::Job * job, int method, const KURL::List & src, const KURL & dest );
00128 
00129     struct DropInfo
00130     {
00131         DropInfo( uint k, KURL::List & l, const QMap<QString,QString> &m,
00132                   int x, int y, QDropEvent::Action a ) :
00133             keybstate(k), lst(l), metaData(m), mousePos(x,y), action(a) {}
00134         uint keybstate;
00135         KURL::List lst;
00136         QMap<QString,QString> metaData;
00137         QPoint mousePos;
00138         QDropEvent::Action action;
00139     };
00140     // internal, for doDrop
00141     void setDropInfo( DropInfo * info ) { m_info = info; }
00142 
00143     struct KIOPasteInfo
00144     {
00145         QByteArray data;
00146         KURL destURL;
00147         QPoint mousePos;
00148         QString dialogText;
00149     };
00150     void setPasteInfo( KIOPasteInfo * info ) { m_pasteInfo = info; }
00151 
00152 protected slots:
00153 
00154     void slotAboutToCreate(KIO::Job *job, const QValueList<KIO::CopyInfo> &files);
00155     void slotResult( KIO::Job * job );
00156     void slotStatResult( KIO::Job * job );
00157     void asyncDrop( const KFileItem * item );
00158     void slotKIOPaste();
00159     void doFileCopy();
00160 
00161 private:
00162     int m_method;
00163     //KURL::List m_srcURLs;
00164     KURL m_destURL;
00165     // for doDrop
00166     DropInfo * m_info;
00167     KIOPasteInfo * m_pasteInfo;
00168 };
00169 
00170 #endif
KDE Logo
This file is part of the documentation for libkonq Library Version 3.3.90.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 11:21:34 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003