# kio Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# jobclasses.h

    00001 // -*- c++ -*-
    00002 /* This file is part of the KDE libraries
    00003     Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
    00004                        David Faure <faure@kde.org>
    00005
    00006     This library is free software; you can redistribute it and/or
    00007     modify it under the terms of the GNU Library General Public
    00008     License as published by the Free Software Foundation; either
    00009     version 2 of the License, or (at your option) any later version.
    00010
    00011     This library is distributed in the hope that it will be useful,
    00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014     Library General Public License for more details.
    00015
    00016     You should have received a copy of the GNU Library General Public License
    00017     along with this library; see the file COPYING.LIB.  If not, write to
    00018     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    00019     Boston, MA 02111-1307, USA.
    00020 */
    00021
    00022 #ifndef __kio_jobclasses_h__
    00023 #define __kio_jobclasses_h__
    00024
    00025 #include <qobject.h>
    00026 #include <qptrlist.h>
    00027 #include <qstring.h>
    00028 #include <qstringlist.h>
    00029 #include <qguardedptr.h>
    00030
    00031 #include <sys/types.h>
    00032 #include <sys/stat.h>
    00033
    00034 #include <kurl.h>
    00035 #include <kio/global.h>
    00036
    00037 class Observer;
    00038 class QTimer;
    00039
    00040 #define KIO_COPYJOB_HAS_SETINTERACTIVE // new in 3.4. Used by kio_trash.
    00041
    00042 namespace KIO {
    00043
    00044     class Slave;
    00045     class SlaveInterface;
    00046
    00047
    00068     class KIO_EXPORT Job : public QObject {
    00069         Q_OBJECT
    00070
    00071     protected:
    00072         Job( bool showProgressInfo );
    00073
    00074     public:
    00075         virtual ~Job();
    00076
    00087         virtual void kill( bool quietly = true );
    00088
    00095         int error() const { return m_error; }
    00096
    00101         int progressId() const { return m_progressId; }
    00102
    00111         const QString & errorText() const { return m_errorText; }
    00112
    00130         QString errorString() const;
    00131
    00142         QStringList detailedErrorStrings(const KURL *reqUrl = 0L,
    00143                                          int method = -1) const;
    00144
    00153         void showErrorDialog( QWidget * parent = 0L );
    00154
    00170         void setAutoErrorHandlingEnabled( bool enable, QWidget *parentWidget = 0 );
    00171
    00178         bool isAutoErrorHandlingEnabled() const;
    00179
    00187         void setInteractive(bool enable);
    00188
    00196         bool isInteractive() const;
    00202         void setWindow(QWidget *window);
    00203
    00209         QWidget *window() const;
    00210
    00221         void setParentJob( Job* parentJob );
    00222
    00229         Job* parentJob() const;
    00230
    00238         void setMetaData( const KIO::MetaData &metaData);
    00239
    00247         void addMetaData(const QString &key, const QString &value);
    00248
    00256         void addMetaData(const QMap<QString,QString> &values);
    00257
    00265         void mergeMetaData(const QMap<QString,QString> &values);
    00266
    00270         MetaData outgoingMetaData() const;
    00271
    00277         MetaData metaData() const;
    00278
    00286         QString queryMetaData(const QString &key);
    00287
    00293         KIO::filesize_t getProcessedSize();
    00294
    00295     signals:
    00301         void result( KIO::Job *job );
    00302
    00310         void canceled( KIO::Job *job );
    00311
    00318         void infoMessage( KIO::Job *job, const QString & msg );
    00319         // KDE4: Separate rich-text string from plain-text string, for different widgets.
    00320
    00327         void connected( KIO::Job *job );
    00328
    00337         void percent( KIO::Job *job, unsigned long percent );
    00338
    00345         void totalSize( KIO::Job *job, KIO::filesize_t size );
    00346
    00353         void processedSize( KIO::Job *job, KIO::filesize_t size );
    00354
    00360         void speed( KIO::Job *job, unsigned long bytes_per_second );
    00361
    00362     protected slots:
    00371         virtual void slotResult( KIO::Job *job );
    00372
    00379         void slotSpeed( KIO::Job *job, unsigned long bytes_per_second );
    00386         void slotInfoMessage( KIO::Job *job, const QString &msg );
    00387
    00391         void slotSpeedTimeout();
    00392
    00393     protected:
    00403         virtual void addSubjob( Job *job, bool inheritMetaData=true );
    00404
    00413         virtual void removeSubjob( Job *job );
    00422         void removeSubjob( Job *job, bool mergeMetaData, bool emitResultIfLast ); // KDE4: merge with above, with =true to both
    00423
    00432         void emitPercent( KIO::filesize_t processedSize, KIO::filesize_t totalSize );
    00433
    00440         void emitSpeed( unsigned long bytes_per_second );
    00441
    00446         void emitResult();
    00447
    00452         void setProcessedSize(KIO::filesize_t size);
    00453
    00459         enum { EF_TransferJobAsync    = (1 << 0),
    00460                EF_TransferJobNeedData = (1 << 1),
    00461                EF_TransferJobDataSent = (1 << 2),
    00462                EF_ListJobUnrestricted = (1 << 3) };
    00463         int &extraFlags();
    00464
    00465         QPtrList<Job> subjobs;
    00466         int m_error;
    00467         QString m_errorText;
    00468         unsigned long m_percent;
    00469         int m_progressId; // for uiserver
    00470         QTimer *m_speedTimer;
    00471         QGuardedPtr<QWidget> m_window;
    00472         MetaData m_outgoingMetaData;
    00473         MetaData m_incomingMetaData;
    00474     protected:
    00475     virtual void virtual_hook( int id, void* data );
    00476     private:
    00477         class JobPrivate;
    00478         JobPrivate *d;
    00479     };
    00480
    00487     class KIO_EXPORT SimpleJob : public KIO::Job {
    00488     Q_OBJECT
    00489
    00490     public:
    00499         SimpleJob(const KURL& url, int command, const QByteArray &packedArgs,
    00500                   bool showProgressInfo);
    00501
    00502         ~SimpleJob();
    00503
    00508         const KURL& url() const { return m_url; }
    00509
    00517         virtual void kill( bool quietly = true );
    00518
    00523         virtual void putOnHold();
    00524
    00528         static void removeOnHold();
    00529
    00535         virtual void start( Slave *slave );
    00536
    00541         void slaveDone();
    00542
    00547         Slave *slave() const { return m_slave; }
    00548
    00552         int command() const { return m_command; }
    00553
    00554     public slots:
    00560         void slotTotalSize( KIO::filesize_t data_size );
    00561
    00562     protected slots:
    00567         virtual void slotFinished( );
    00568
    00573         void slotWarning( const QString & ); // KDE4: make virtual
    00574
    00580         void slotInfoMessage( const QString &s ); // KDE4: make virtual
    00581
    00586         void slotConnected();
    00587
    00593         void slotProcessedSize( KIO::filesize_t data_size );
    00599         void slotSpeed( unsigned long bytes_per_second );
    00600
    00606         virtual void slotMetaData( const KIO::MetaData &_metaData);
    00607
    00608     public slots:
    00614         virtual void slotError( int , const QString & );
    00615
    00616     protected slots:
    00620         void slotNeedProgressId();
    00621
    00622     protected:
    00623         Slave * m_slave;
    00624         QByteArray m_packedArgs;
    00625         KURL m_url;
    00626         KURL m_subUrl;
    00627         int m_command;
    00628         KIO::filesize_t m_totalSize;
    00629     protected:
    00630     virtual void virtual_hook( int id, void* data );
    00631     /*
    00632      * Allow jobs that inherit SimpleJob and are aware
    00633      * of redirections to store the SSL session used.
    00634      * Retrieval is handled by SimpleJob::start
    00635      * @param m_redirectionURL Reference to redirection URL,
    00636      * used instead of m_url if not empty
    00637      */
    00638     void storeSSLSessionFromJob(const KURL &m_redirectionURL);
    00639     private:
    00640     class SimpleJobPrivate* d;
    00641     };
    00642
    00647     class KIO_EXPORT StatJob : public SimpleJob {
    00648
    00649     Q_OBJECT
    00650
    00651     public:
    00659         StatJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo);
    00660
    00668         void setSide( bool source ) { m_bSource = source; }
    00669
    00679         void setDetails( short int details ) { m_details = details; }
    00680
    00686         const UDSEntry & statResult() const { return m_statResult; }
    00687
    00694         virtual void start( Slave *slave );
    00695
    00696     signals:
    00704         void redirection( KIO::Job *job, const KURL &url );
    00705
    00714         void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
    00715
    00716     protected slots:
    00717         void slotStatEntry( const KIO::UDSEntry & entry );
    00718         void slotRedirection( const KURL &url);
    00719         virtual void slotFinished();
    00720         virtual void slotMetaData( const KIO::MetaData &_metaData);
    00721
    00722     protected:
    00723         UDSEntry m_statResult;
    00724         KURL m_redirectionURL;
    00725         bool m_bSource;
    00726         short int m_details;
    00727     protected:
    00728     virtual void virtual_hook( int id, void* data );
    00729     private:
    00730         class StatJobPrivate;
    00731         StatJobPrivate *d;
    00732     };
    00733
    00739     class KIO_EXPORT MkdirJob : public SimpleJob {
    00740
    00741     Q_OBJECT
    00742
    00743     public:
    00751         MkdirJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo);
    00752
    00759         virtual void start( Slave *slave );
    00760
    00761     signals:
    00769         void redirection( KIO::Job *job, const KURL &url );
    00770
    00778         void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
    00779
    00780     protected slots:
    00781         void slotRedirection( const KURL &url);
    00782         virtual void slotFinished();
    00783
    00784     protected:
    00785         KURL m_redirectionURL;
    00786
    00787     protected:
    00788     virtual void virtual_hook( int id, void* data );
    00789     private:
    00790         class MkdirJobPrivate;
    00791         MkdirJobPrivate *d;
    00792     };
    00793
    00798     class KIO_EXPORT DirectCopyJob : public SimpleJob {
    00799     Q_OBJECT
    00800
    00801     public:
    00805         DirectCopyJob(const KURL& url, int command, const QByteArray &packedArgs,
    00806                       bool showProgressInfo);
    00813         virtual void start(Slave *slave);
    00814
    00815     signals:
    00821         void canResume( KIO::Job *job, KIO::filesize_t offset );
    00822
    00823     private slots:
    00824         void slotCanResume( KIO::filesize_t offset );
    00825     };
    00826
    00827
    00834     class KIO_EXPORT TransferJob : public SimpleJob {
    00835     Q_OBJECT
    00836
    00837     public:
    00847         TransferJob(const KURL& url, int command,
    00848                     const QByteArray &packedArgs,
    00849                     const QByteArray &_staticData,
    00850                     bool showProgressInfo);
    00851
    00858         virtual void start(Slave *slave);
    00859
    00864         virtual void slotResult( KIO::Job *job );
    00865
    00869         void suspend();
    00870
    00874         void resume();
    00875
    00880     bool isSuspended() const { return m_suspended; }
    00881
    00882
    00890         bool isErrorPage() const { return m_errorPage; }
    00891
    00899         void setAsyncDataEnabled(bool enabled);
    00900
    00907         void sendAsyncData(const QByteArray &data);
    00908
    00916         void setReportDataSent(bool enabled);
    00917
    00924         bool reportDataSent();
    00925
    00926     signals:
    00936         void data( KIO::Job *job, const QByteArray &data );
    00937
    00949         void dataReq( KIO::Job *job, QByteArray &data );
    00950
    00958         void redirection( KIO::Job *job, const KURL &url );
    00959
    00968         void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
    00969
    00975         void mimetype( KIO::Job *job, const QString &type );
    00976
    00984         void canResume( KIO::Job *job, KIO::filesize_t offset );
    00985
    00986
    00987     protected slots:
    00988         virtual void slotRedirection( const KURL &url);
    00989         virtual void slotFinished();
    00990         virtual void slotData( const QByteArray &data);
    00991         virtual void slotDataReq();
    00992         virtual void slotMimetype( const QString &mimetype );
    00993         virtual void slotNeedSubURLData();
    00994         virtual void slotSubURLData(KIO::Job*, const QByteArray &);
    00995         virtual void slotMetaData( const KIO::MetaData &_metaData);
    00996         void slotErrorPage();
    00997         void slotCanResume( KIO::filesize_t offset );
    00998         void slotPostRedirection();
    00999
    01000     protected:
    01001         bool m_suspended;
    01002         bool m_errorPage;
    01003         QByteArray staticData;
    01004         KURL m_redirectionURL;
    01005         KURL::List m_redirectionList;
    01006         QString m_mimetype;
    01007         TransferJob *m_subJob;
    01008     protected:
    01009     virtual void virtual_hook( int id, void* data );
    01010     private:
    01011     class TransferJobPrivate *d;
    01012     };
    01013
    01034     class KIO_EXPORT StoredTransferJob : public KIO::TransferJob {
    01035         Q_OBJECT
    01036
    01037     public:
    01047         StoredTransferJob(const KURL& url, int command,
    01048                           const QByteArray &packedArgs,
    01049                           const QByteArray &_staticData,
    01050                           bool showProgressInfo);
    01051
    01057         void setData( const QByteArray& arr );
    01058
    01063         QByteArray data() const { return m_data; }
    01064
    01065     private slots:
    01066         void slotStoredData( KIO::Job *job, const QByteArray &data );
    01067         void slotStoredDataReq( KIO::Job *job, QByteArray &data );
    01068     private:
    01069         QByteArray m_data;
    01070         int m_uploadOffset;
    01071     };
    01072
    01079     class KIO_EXPORT MultiGetJob : public TransferJob {
    01080     Q_OBJECT
    01081
    01082     public:
    01090         MultiGetJob(const KURL& url, bool showProgressInfo);
    01091
    01098          virtual void start(Slave *slave);
    01099
    01107         void get(long id, const KURL &url, const MetaData &metaData);
    01108
    01109     signals:
    01116         void data( long id, const QByteArray &data);
    01117
    01123         void mimetype( long id, const QString &type );
    01124
    01132         void result( long id);
    01133
    01134     protected slots:
    01135         virtual void slotRedirection( const KURL &url);
    01136         virtual void slotFinished();
    01137         virtual void slotData( const QByteArray &data);
    01138         virtual void slotMimetype( const QString &mimetype );
    01139     private:
    01140         struct GetRequest {
    01141         public:
    01142            GetRequest(long _id, const KURL &_url, const MetaData &_metaData)
    01143              : id(_id), url(_url), metaData(_metaData) { }
    01144            long id;
    01145            KURL url;
    01146            MetaData metaData;
    01147         };
    01148         bool findCurrentEntry();
    01149         void flushQueue(QPtrList<GetRequest> &queue);
    01150
    01151         QPtrList<GetRequest> m_waitQueue;
    01152         QPtrList<GetRequest> m_activeQueue;
    01153         bool b_multiGetActive;
    01154         GetRequest *m_currentEntry;
    01155     protected:
    01156     virtual void virtual_hook( int id, void* data );
    01157     private:
    01158     class MultiGetJobPrivate* d;
    01159     };
    01160
    01167     class KIO_EXPORT MimetypeJob : public TransferJob {
    01168     Q_OBJECT
    01169
    01170     public:
    01179         MimetypeJob(const KURL& url, int command, const QByteArray &packedArgs, bool showProgressInfo);
    01180
    01186          QString mimetype() const { return m_mimetype; }
    01187
    01194         virtual void start( Slave *slave );
    01195
    01196     protected slots:
    01197         virtual void slotFinished( );
    01198     protected:
    01199     virtual void virtual_hook( int id, void* data );
    01200     private:
    01201     class MimetypeJobPrivate* d;
    01202     };
    01203
    01209     class KIO_EXPORT FileCopyJob : public Job {
    01210     Q_OBJECT
    01211
    01212     public:
    01224         FileCopyJob( const KURL& src, const KURL& dest, int permissions,
    01225                      bool move, bool overwrite, bool resume, bool showProgressInfo);
    01226
    01227         ~FileCopyJob();
    01234         void setSourceSize64(KIO::filesize_t size);
    01235
    01239         void setSourceSize( off_t size ) KDE_DEPRECATED;
    01240
    01245         KURL srcURL() const { return m_src; }
    01246
    01251         KURL destURL() const { return m_dest; }
    01252
    01253     public slots:
    01254         void slotStart();
    01255         void slotData( KIO::Job *, const QByteArray &data);
    01256         void slotDataReq( KIO::Job *, QByteArray &data);
    01257
    01258     protected slots:
    01263         virtual void slotResult( KIO::Job *job );
    01264
    01270         void slotProcessedSize( KIO::Job *job, KIO::filesize_t size );
    01276         void slotTotalSize( KIO::Job *job, KIO::filesize_t size );
    01282         void slotPercent( KIO::Job *job, unsigned long pct );
    01288         void slotCanResume( KIO::Job *job, KIO::filesize_t offset );
    01289
    01290     protected:
    01291         void startCopyJob();
    01292         void startCopyJob(const KURL &slave_url);
    01293         void startRenameJob(const KURL &slave_url);
    01294         void startDataPump();
    01295         void connectSubjob( SimpleJob * job );
    01296
    01297     private:
    01298         void startBestCopyMethod();
    01299
    01300     protected:
    01301         KURL m_src;
    01302         KURL m_dest;
    01303         int m_permissions;
    01304         bool m_move:1;
    01305         bool m_overwrite:1;
    01306         bool m_resume:1;
    01307         bool m_canResume:1;
    01308         bool m_resumeAnswerSent:1;
    01309         QByteArray m_buffer;
    01310         SimpleJob *m_moveJob;
    01311         SimpleJob *m_copyJob;
    01312         TransferJob *m_getJob;
    01313         TransferJob *m_putJob;
    01314         KIO::filesize_t m_totalSize;
    01315     protected:
    01316     virtual void virtual_hook( int id, void* data );
    01317     private:
    01318     class FileCopyJobPrivate;
    01319     FileCopyJobPrivate* d;
    01320     };
    01321
    01329     class KIO_EXPORT ListJob : public SimpleJob {
    01330     Q_OBJECT
    01331
    01332     public:
    01343         ListJob(const KURL& url, bool showProgressInfo,
    01344                 bool recursive = false, QString prefix = QString::null,
    01345                 bool includeHidden = true);
    01346
    01353         virtual void start( Slave *slave );
    01354
    01361         const KURL& redirectionURL() const { return m_redirectionURL; }
    01362
    01367         void setUnrestricted(bool unrestricted);
    01368
    01369     signals:
    01379         void entries( KIO::Job *job, const KIO::UDSEntryList& list);
    01380
    01388         void redirection( KIO::Job *job, const KURL &url );
    01389
    01398         void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
    01399
    01400     protected slots:
    01401         virtual void slotFinished( );
    01402         virtual void slotMetaData( const KIO::MetaData &_metaData);
    01403         virtual void slotResult( KIO::Job *job );
    01404         void slotListEntries( const KIO::UDSEntryList& list );
    01405         void slotRedirection( const KURL &url );
    01406         void gotEntries( KIO::Job * subjob, const KIO::UDSEntryList& list );
    01407
    01408     private:
    01409         bool recursive;
    01410         bool includeHidden;
    01411         QString prefix;
    01412         unsigned long m_processedEntries;
    01413         KURL m_redirectionURL;
    01414     protected:
    01415     virtual void virtual_hook( int id, void* data );
    01416     private:
    01417     class ListJobPrivate* d;
    01418     };
    01419
    01421     struct KIO_EXPORT CopyInfo
    01422     {
    01423         KURL uSource;
    01424         KURL uDest;
    01425         QString linkDest; // for symlinks only
    01426         int permissions;
    01427         //mode_t type;
    01428         time_t ctime;
    01429         time_t mtime;
    01430         KIO::filesize_t size; // 0 for dirs
    01431     };
    01432
    01445     class KIO_EXPORT CopyJob : public Job {
    01446     Q_OBJECT
    01447
    01448     public:
    01452         enum CopyMode{ Copy, Move, Link };
    01453
    01471         CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo );
    01472
    01473         virtual ~CopyJob();
    01474
    01479         KURL::List srcURLs() const { return m_srcList; }
    01480
    01485         KURL destURL() const { return m_dest; }
    01486
    01497         void setDefaultPermissions( bool b );
    01498
    01510         void setInteractive( bool b );
    01511
    01512     signals:
    01513
    01519         void totalFiles( KIO::Job *job, unsigned long files );
    01525         void totalDirs( KIO::Job *job, unsigned long dirs );
    01526
    01534         void aboutToCreate( KIO::Job *job, const QValueList<KIO::CopyInfo> &files);
    01535
    01541         void processedFiles( KIO::Job *job, unsigned long files );
    01547         void processedDirs( KIO::Job *job, unsigned long dirs );
    01548
    01556         void copying( KIO::Job *job, const KURL& from, const KURL& to );
    01564         void linking( KIO::Job *job, const QString& target, const KURL& to );
    01572         void moving( KIO::Job *job, const KURL& from, const KURL& to );
    01578         void creatingDir( KIO::Job *job, const KURL& dir );
    01585         void renamed( KIO::Job *job, const KURL& from, const KURL& to );
    01586
    01599         void copyingDone( KIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed );
    01609         void copyingLinkDone( KIO::Job *job, const KURL &from, const QString& target, const KURL& to );
    01610
    01611     protected:
    01612         void statCurrentSrc();
    01613         void statNextSrc();
    01614
    01615         // Those aren't slots but submethods for slotResult.
    01616         void slotResultStating( KIO::Job * job );
    01617         void startListing( const KURL & src );
    01618         void slotResultCreatingDirs( KIO::Job * job );
    01619         void slotResultConflictCreatingDirs( KIO::Job * job );
    01620         void createNextDir();
    01621         void slotResultCopyingFiles( KIO::Job * job );
    01622         void slotResultConflictCopyingFiles( KIO::Job * job );
    01623         void copyNextFile();
    01624         void slotResultDeletingDirs( KIO::Job * job );
    01625         void deleteNextDir();
    01626         void skip( const KURL & sourceURL );
    01627         void slotResultRenaming( KIO::Job * job );
    01628     private:
    01629         void startRenameJob(const KURL &slave_url);
    01630         bool shouldOverwrite( const QString& path ) const;
    01631         bool shouldSkip( const QString& path ) const;
    01632         void skipSrc();
    01633
    01634     protected slots:
    01635         void slotStart();
    01636         void slotEntries( KIO::Job*, const KIO::UDSEntryList& list );
    01637         virtual void slotResult( KIO::Job *job );
    01641         void slotProcessedSize( KIO::Job*, KIO::filesize_t data_size );
    01646         void slotTotalSize( KIO::Job*, KIO::filesize_t size );
    01647
    01648         void slotReport();
    01649     private:
    01650         CopyMode m_mode;
    01651         bool m_asMethod;
    01652         enum DestinationState { DEST_NOT_STATED, DEST_IS_DIR, DEST_IS_FILE, DEST_DOESNT_EXIST };
    01653         DestinationState destinationState;
    01654         enum { STATE_STATING, STATE_RENAMING, STATE_LISTING, STATE_CREATING_DIRS,
    01655                STATE_CONFLICT_CREATING_DIRS, STATE_COPYING_FILES, STATE_CONFLICT_COPYING_FILES,
    01656                STATE_DELETING_DIRS } state;
    01657         KIO::filesize_t m_totalSize;
    01658         KIO::filesize_t m_processedSize;
    01659         KIO::filesize_t m_fileProcessedSize;
    01660         int m_processedFiles;
    01661         int m_processedDirs;
    01662         QValueList<CopyInfo> files;
    01663         QValueList<CopyInfo> dirs;
    01664         KURL::List dirsToRemove;
    01665         KURL::List m_srcList;
    01666         KURL::List::Iterator m_currentStatSrc;
    01667         bool m_bCurrentSrcIsDir;
    01668         bool m_bCurrentOperationIsLink;
    01669         bool m_bSingleFileCopy;
    01670         bool m_bOnlyRenames;
    01671         KURL m_dest;
    01672         KURL m_currentDest;
    01673         //
    01674         QStringList m_skipList;
    01675         QStringList m_overwriteList;
    01676         bool m_bAutoSkip;
    01677         bool m_bOverwriteAll;
    01678         int m_conflictError;
    01679
    01680         QTimer *m_reportTimer;
    01681         //these both are used for progress dialog reporting
    01682         KURL m_currentSrcURL;
    01683         KURL m_currentDestURL;
    01684     protected:
    01685     virtual void virtual_hook( int id, void* data );
    01686     private:
    01687     class CopyJobPrivate;
    01688         CopyJobPrivate* d;
    01689         friend class CopyJobPrivate; // for DestinationState
    01690     };
    01691
    01698     class KIO_EXPORT DeleteJob : public Job {
    01699     Q_OBJECT
    01700
    01701     public:
    01711         DeleteJob( const KURL::List& src, bool shred, bool showProgressInfo );
    01712
    01717         KURL::List urls() const { return m_srcList; }
    01718
    01719     signals:
    01720
    01726         void totalFiles( KIO::Job *job, unsigned long files );
    01732         void totalDirs( KIO::Job *job, unsigned long dirs );
    01733
    01739         void processedFiles( KIO::Job *job, unsigned long files );
    01745         void processedDirs( KIO::Job *job, unsigned long dirs );
    01746
    01753         void deleting( KIO::Job *job, const KURL& file );
    01754
    01755     protected slots:
    01756         void slotStart();
    01757         void slotEntries( KIO::Job*, const KIO::UDSEntryList& list );
    01758         virtual void slotResult( KIO::Job *job );
    01759
    01763         void slotProcessedSize( KIO::Job*, KIO::filesize_t data_size );
    01764         void slotReport();
    01765
    01766     private:
    01767         void statNextSrc();
    01768         void deleteNextFile();
    01769         void deleteNextDir();
    01770
    01771     private:
    01772         enum { STATE_STATING, STATE_LISTING,
    01773                STATE_DELETING_FILES, STATE_DELETING_DIRS } state;
    01774         KIO::filesize_t m_totalSize;
    01775         KIO::filesize_t m_processedSize;
    01776         KIO::filesize_t m_fileProcessedSize;
    01777         int m_processedFiles;
    01778         int m_processedDirs;
    01779         int m_totalFilesDirs;
    01780         KURL m_currentURL;
    01781         KURL::List files;
    01782         KURL::List symlinks;
    01783         KURL::List dirs;
    01784         KURL::List m_srcList;
    01785         KURL::List::Iterator m_currentStat;
    01786     QStringList m_parentDirs;
    01787         bool m_shred; // BIC: remove in KDE4
    01788         QTimer *m_reportTimer;
    01789     protected:
    01791     virtual void virtual_hook( int id, void* data );
    01792     private:
    01793     class DeleteJobPrivate* d;
    01794     };
    01795
    01796 }
    01797
    01798 #endif

This file is part of the documentation for kio Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:23:54 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003