• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kio
 

kio/kio

  • kio
  • kio
jobclasses.h
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
4  David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef __kio_jobclasses_h__
23 #define __kio_jobclasses_h__
24 
25 #include <tqobject.h>
26 #include <tqptrlist.h>
27 #include <tqstring.h>
28 #include <tqstringlist.h>
29 #include <tqguardedptr.h>
30 
31 #include <sys/types.h>
32 #include <sys/stat.h>
33 
34 #include <kurl.h>
35 #include <kio/global.h>
36 
37 class Observer;
38 class TQTimer;
39 
40 #define KIO_COPYJOB_HAS_SETINTERACTIVE // new in 3.4. Used by kio_trash.
41 
42 namespace KIO {
43 
44  class Slave;
45  class SlaveInterface;
46 
47 
68  class KIO_EXPORT Job : public TQObject {
69  Q_OBJECT
70 
71  protected:
72  Job( bool showProgressInfo );
73 
74  public:
75  virtual ~Job();
76 
87  virtual void kill( bool quietly = true );
88 
95  int error() const { return m_error; }
96 
101  int progressId() const { return m_progressId; }
102 
111  const TQString & errorText() const { return m_errorText; }
112 
130  TQString errorString() const;
131 
142  TQStringList detailedErrorStrings(const KURL *reqUrl = 0L,
143  int method = -1) const;
144 
153  void showErrorDialog( TQWidget * parent = 0L );
154 
168  void setAutoErrorHandlingEnabled( bool enable, TQWidget *parentWidget = 0 );
169 
175  bool isAutoErrorHandlingEnabled() const;
176 
190  void setAutoWarningHandlingEnabled( bool enable );
191 
199  bool isAutoWarningHandlingEnabled() const;
200 
208  void setInteractive(bool enable);
209 
216  bool isInteractive() const;
222  void setWindow(TQWidget *window);
223 
229  TQWidget *window() const;
230 
236  void updateUserTimestamp( unsigned long time );
237 
248  void setParentJob( Job* parentJob );
249 
256  Job* parentJob() const;
257 
265  void setMetaData( const KIO::MetaData &metaData);
266 
274  void addMetaData(const TQString &key, const TQString &value);
275 
283  void addMetaData(const TQMap<TQString,TQString> &values);
284 
292  void mergeMetaData(const TQMap<TQString,TQString> &values);
293 
297  MetaData outgoingMetaData() const;
298 
304  MetaData metaData() const;
305 
313  TQString queryMetaData(const TQString &key);
314 
320  KIO::filesize_t getProcessedSize();
321 
322  signals:
328  void result( KIO::Job *job );
329 
337  void canceled( KIO::Job *job );
338 
345  void infoMessage( KIO::Job *job, const TQString & msg );
346  // KDE4: Separate rich-text string from plain-text string, for different widgets.
347 
354  void warning( KIO::Job *job, const TQString & msg );
355  // KDE4: Separate rich-text string from plain-text string, for different widgets.
356 
363  void connected( KIO::Job *job );
364 
373  void percent( KIO::Job *job, unsigned long percent );
374 
381  void totalSize( KIO::Job *job, KIO::filesize_t size );
382 
389  void processedSize( KIO::Job *job, KIO::filesize_t size );
390 
396  void speed( KIO::Job *job, unsigned long speed );
397 
398  protected slots:
407  virtual void slotResult( KIO::Job *job );
408 
415  void slotSpeed( KIO::Job *job, unsigned long speed );
422  void slotInfoMessage( KIO::Job *job, const TQString &msg );
423 
427  void slotSpeedTimeout();
428 
429  protected:
439  virtual void addSubjob( Job *job, bool inheritMetaData=true );
440 
449  virtual void removeSubjob( Job *job );
458  void removeSubjob( Job *job, bool mergeMetaData, bool emitResultIfLast ); // KDE4: merge with above, with =true to both
459 
468  void emitPercent( KIO::filesize_t processedSize, KIO::filesize_t totalSize );
469 
476  void emitSpeed( unsigned long speed );
477 
482  void emitResult();
483 
488  void setProcessedSize(KIO::filesize_t size);
489 
493  unsigned long userTimestamp() const;
494 
500  enum { EF_TransferJobAsync = (1 << 0),
501  EF_TransferJobNeedData = (1 << 1),
502  EF_TransferJobDataSent = (1 << 2),
503  EF_ListJobUnrestricted = (1 << 3) };
504  int &extraFlags();
505 
506  TQPtrList<Job> subjobs;
507  int m_error;
508  TQString m_errorText;
509  unsigned long m_percent;
510  int m_progressId; // for uiserver
511  TQTimer *m_speedTimer;
512  TQGuardedPtr<TQWidget> m_window;
513  MetaData m_outgoingMetaData;
514  MetaData m_incomingMetaData;
515  protected:
516  virtual void virtual_hook( int id, void* data );
517  private:
518  class JobPrivate;
519  JobPrivate *d;
520  };
521 
528  class KIO_EXPORT SimpleJob : public KIO::Job {
529  Q_OBJECT
530 
531  public:
540  SimpleJob(const KURL& url, int command, const TQByteArray &packedArgs,
541  bool showProgressInfo);
542 
543  ~SimpleJob();
544 
549  const KURL& url() const { return m_url; }
550 
558  virtual void kill( bool quietly = true );
559 
564  virtual void putOnHold();
565 
569  static void removeOnHold();
570 
576  virtual void start( Slave *slave );
577 
582  void slaveDone();
583 
588  Slave *slave() const { return m_slave; }
589 
593  int command() const { return m_command; }
594 
595  public slots:
601  void slotTotalSize( KIO::filesize_t data_size );
602 
603  protected slots:
608  virtual void slotFinished( );
609 
614  void slotWarning( const TQString & ); // KDE4: make virtual
615 
621  void slotInfoMessage( const TQString &s ); // KDE4: make virtual
622 
627  void slotConnected();
628 
634  void slotProcessedSize( KIO::filesize_t data_size );
640  void slotSpeed( unsigned long speed );
641 
647  virtual void slotMetaData( const KIO::MetaData &_metaData);
648 
649  public slots:
655  virtual void slotError( int , const TQString & );
656 
657  protected slots:
661  void slotNeedProgressId();
662 
663  protected:
664  Slave * m_slave;
665  TQByteArray m_packedArgs;
666  KURL m_url;
667  KURL m_subUrl;
668  int m_command;
669  KIO::filesize_t m_totalSize;
670  protected:
671  virtual void virtual_hook( int id, void* data );
672  /*
673  * Allow jobs that inherit SimpleJob and are aware
674  * of redirections to store the SSL session used.
675  * Retrieval is handled by SimpleJob::start
676  * @param m_redirectionURL Reference to redirection URL,
677  * used instead of m_url if not empty
678  */
679  void storeSSLSessionFromJob(const KURL &m_redirectionURL);
680  private:
681  class SimpleJobPrivate* d;
682  };
683 
688  class KIO_EXPORT StatJob : public SimpleJob {
689 
690  Q_OBJECT
691 
692  public:
700  StatJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
701 
709  void setSide( bool source ) { m_bSource = source; }
710 
720  void setDetails( short int details ) { m_details = details; }
721 
727  const UDSEntry & statResult() const { return m_statResult; }
728 
735  virtual void start( Slave *slave );
736 
737  signals:
745  void redirection( KIO::Job *job, const KURL &url );
746 
755  void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
756 
757  protected slots:
758  void slotStatEntry( const KIO::UDSEntry & entry );
759  void slotRedirection( const KURL &url);
760  virtual void slotFinished();
761  virtual void slotMetaData( const KIO::MetaData &_metaData);
762 
763  protected:
764  UDSEntry m_statResult;
765  KURL m_redirectionURL;
766  bool m_bSource;
767  short int m_details;
768  protected:
769  virtual void virtual_hook( int id, void* data );
770  private:
771  class StatJobPrivate;
772  StatJobPrivate *d;
773  };
774 
780  class KIO_EXPORT MkdirJob : public SimpleJob {
781 
782  Q_OBJECT
783 
784  public:
792  MkdirJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
793 
800  virtual void start( Slave *slave );
801 
802  signals:
810  void redirection( KIO::Job *job, const KURL &url );
811 
819  void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
820 
821  protected slots:
822  void slotRedirection( const KURL &url);
823  virtual void slotFinished();
824 
825  protected:
826  KURL m_redirectionURL;
827 
828  protected:
829  virtual void virtual_hook( int id, void* data );
830  private:
831  class MkdirJobPrivate;
832  MkdirJobPrivate *d;
833  };
834 
839  class KIO_EXPORT DirectCopyJob : public SimpleJob {
840  Q_OBJECT
841 
842  public:
846  DirectCopyJob(const KURL& url, int command, const TQByteArray &packedArgs,
847  bool showProgressInfo);
854  virtual void start(Slave *slave);
855 
856  signals:
862  void canResume( KIO::Job *job, KIO::filesize_t offset );
863 
864  private slots:
865  void slotCanResume( KIO::filesize_t offset );
866  };
867 
868 
875  class KIO_EXPORT TransferJob : public SimpleJob {
876  Q_OBJECT
877 
878  public:
888  TransferJob(const KURL& url, int command,
889  const TQByteArray &packedArgs,
890  const TQByteArray &_staticData,
891  bool showProgressInfo);
892 
899  virtual void start(Slave *slave);
900 
905  virtual void slotResult( KIO::Job *job );
906 
910  void suspend();
911 
915  void resume();
916 
921  bool isSuspended() const { return m_suspended; }
922 
923 
931  bool isErrorPage() const { return m_errorPage; }
932 
940  void setAsyncDataEnabled(bool enabled);
941 
948  void sendAsyncData(const TQByteArray &data);
949 
957  void setReportDataSent(bool enabled);
958 
965  bool reportDataSent();
966 
967  signals:
977  void data( KIO::Job *job, const TQByteArray &data );
978 
990  void dataReq( KIO::Job *job, TQByteArray &data );
991 
999  void redirection( KIO::Job *job, const KURL &url );
1000 
1009  void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
1010 
1016  void mimetype( KIO::Job *job, const TQString &type );
1017 
1025  void canResume( KIO::Job *job, KIO::filesize_t offset );
1026 
1027 
1028  protected slots:
1029  virtual void slotRedirection( const KURL &url);
1030  virtual void slotFinished();
1031  virtual void slotData( const TQByteArray &data);
1032  virtual void slotDataReq();
1033  virtual void slotMimetype( const TQString &mimetype );
1034  virtual void slotNeedSubURLData();
1035  virtual void slotSubURLData(KIO::Job*, const TQByteArray &);
1036  virtual void slotMetaData( const KIO::MetaData &_metaData);
1037  void slotErrorPage();
1038  void slotCanResume( KIO::filesize_t offset );
1039  void slotPostRedirection();
1040 
1041  protected:
1042  bool m_suspended;
1043  bool m_errorPage;
1044  TQByteArray staticData;
1045  KURL m_redirectionURL;
1046  KURL::List m_redirectionList;
1047  TQString m_mimetype;
1048  TransferJob *m_subJob;
1049  protected:
1050  virtual void virtual_hook( int id, void* data );
1051  private:
1052  class TransferJobPrivate *d;
1053  };
1054 
1075  class KIO_EXPORT StoredTransferJob : public KIO::TransferJob {
1076  Q_OBJECT
1077 
1078  public:
1088  StoredTransferJob(const KURL& url, int command,
1089  const TQByteArray &packedArgs,
1090  const TQByteArray &_staticData,
1091  bool showProgressInfo);
1092 
1098  void setData( const TQByteArray& arr );
1099 
1104  TQByteArray data() const { return m_data; }
1105 
1106  private slots:
1107  void slotStoredData( KIO::Job *job, const TQByteArray &data );
1108  void slotStoredDataReq( KIO::Job *job, TQByteArray &data );
1109  private:
1110  TQByteArray m_data;
1111  int m_uploadOffset;
1112  };
1113 
1120  class KIO_EXPORT MultiGetJob : public TransferJob {
1121  Q_OBJECT
1122 
1123  public:
1131  MultiGetJob(const KURL& url, bool showProgressInfo);
1132 
1139  virtual void start(Slave *slave);
1140 
1148  void get(long id, const KURL &url, const MetaData &metaData);
1149 
1150  signals:
1157  void data( long id, const TQByteArray &data);
1158 
1164  void mimetype( long id, const TQString &type );
1165 
1173  void result( long id);
1174 
1175  protected slots:
1176  virtual void slotRedirection( const KURL &url);
1177  virtual void slotFinished();
1178  virtual void slotData( const TQByteArray &data);
1179  virtual void slotMimetype( const TQString &mimetype );
1180  private:
1181  struct GetRequest {
1182  public:
1183  GetRequest(long _id, const KURL &_url, const MetaData &_metaData)
1184  : id(_id), url(_url), metaData(_metaData) { }
1185  long id;
1186  KURL url;
1187  MetaData metaData;
1188  };
1189  bool findCurrentEntry();
1190  void flushQueue(TQPtrList<GetRequest> &queue);
1191 
1192  TQPtrList<GetRequest> m_waitQueue;
1193  TQPtrList<GetRequest> m_activeQueue;
1194  bool b_multiGetActive;
1195  GetRequest *m_currentEntry;
1196  protected:
1197  virtual void virtual_hook( int id, void* data );
1198  private:
1199  class MultiGetJobPrivate* d;
1200  };
1201 
1208  class KIO_EXPORT MimetypeJob : public TransferJob {
1209  Q_OBJECT
1210 
1211  public:
1220  MimetypeJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
1221 
1227  TQString mimetype() const { return m_mimetype; }
1228 
1235  virtual void start( Slave *slave );
1236 
1237  protected slots:
1238  virtual void slotFinished( );
1239  protected:
1240  virtual void virtual_hook( int id, void* data );
1241  private:
1242  class MimetypeJobPrivate* d;
1243  };
1244 
1250  class KIO_EXPORT FileCopyJob : public Job {
1251  Q_OBJECT
1252 
1253  public:
1265  FileCopyJob( const KURL& src, const KURL& dest, int permissions,
1266  bool move, bool overwrite, bool resume, bool showProgressInfo);
1267 
1268  ~FileCopyJob();
1275  void setSourceSize64(KIO::filesize_t size);
1276 
1284  void setModificationTime( time_t mtime );
1285 
1289  void setSourceSize( off_t size ) KDE_DEPRECATED;
1290 
1295  KURL srcURL() const { return m_src; }
1296 
1301  KURL destURL() const { return m_dest; }
1302 
1303  signals:
1313  void mimetype( KIO::Job *job, const TQString &type );
1314 
1315  public slots:
1316  void slotStart();
1317  void slotData( KIO::Job *, const TQByteArray &data);
1318  void slotDataReq( KIO::Job *, TQByteArray &data);
1319  void slotMimetype( KIO::Job *, const TQString& type );
1320 
1321  protected slots:
1326  virtual void slotResult( KIO::Job *job );
1327 
1333  void slotProcessedSize( KIO::Job *job, KIO::filesize_t size );
1339  void slotTotalSize( KIO::Job *job, KIO::filesize_t size );
1345  void slotPercent( KIO::Job *job, unsigned long pct );
1351  void slotCanResume( KIO::Job *job, KIO::filesize_t offset );
1352 
1353  protected:
1354  void startCopyJob();
1355  void startCopyJob(const KURL &slave_url);
1356  void startRenameJob(const KURL &slave_url);
1357  void startDataPump();
1358  void connectSubjob( SimpleJob * job );
1359 
1360  private:
1361  void startBestCopyMethod();
1362 
1363  protected:
1364  KURL m_src;
1365  KURL m_dest;
1366  int m_permissions;
1367  bool m_move:1;
1368  bool m_overwrite:1;
1369  bool m_resume:1;
1370  bool m_canResume:1;
1371  bool m_resumeAnswerSent:1;
1372  TQByteArray m_buffer;
1373  SimpleJob *m_moveJob;
1374  SimpleJob *m_copyJob;
1375  TransferJob *m_getJob;
1376  TransferJob *m_putJob;
1377  KIO::filesize_t m_totalSize;
1378  protected:
1379  virtual void virtual_hook( int id, void* data );
1380  private:
1381  class FileCopyJobPrivate;
1382  FileCopyJobPrivate* d;
1383  };
1384 
1392  class KIO_EXPORT ListJob : public SimpleJob {
1393  Q_OBJECT
1394 
1395  public:
1406  ListJob(const KURL& url, bool showProgressInfo,
1407  bool recursive = false, TQString prefix = TQString::null,
1408  bool includeHidden = true);
1409 
1416  virtual void start( Slave *slave );
1417 
1424  const KURL& redirectionURL() const { return m_redirectionURL; }
1425 
1430  void setUnrestricted(bool unrestricted);
1431 
1432  signals:
1442  void entries( KIO::Job *job, const KIO::UDSEntryList& list);
1443 
1451  void redirection( KIO::Job *job, const KURL &url );
1452 
1461  void permanentRedirection( KIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
1462 
1463  protected slots:
1464  virtual void slotFinished( );
1465  virtual void slotMetaData( const KIO::MetaData &_metaData);
1466  virtual void slotResult( KIO::Job *job );
1467  void slotListEntries( const KIO::UDSEntryList& list );
1468  void slotRedirection( const KURL &url );
1469  void gotEntries( KIO::Job * subjob, const KIO::UDSEntryList& list );
1470 
1471  private:
1472  bool recursive;
1473  bool includeHidden;
1474  TQString prefix;
1475  unsigned long m_processedEntries;
1476  KURL m_redirectionURL;
1477  protected:
1478  virtual void virtual_hook( int id, void* data );
1479  private:
1480  class ListJobPrivate* d;
1481  };
1482 
1484  struct KIO_EXPORT CopyInfo
1485  {
1486  KURL uSource;
1487  KURL uDest;
1488  TQString linkDest; // for symlinks only
1489  int permissions;
1490  //mode_t type;
1491  time_t ctime;
1492  time_t mtime;
1493  KIO::filesize_t size; // 0 for dirs
1494  };
1495 
1508  class KIO_EXPORT CopyJob : public Job {
1509  Q_OBJECT
1510 
1511  public:
1515  enum CopyMode{ Copy, Move, Link };
1516 
1534  CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo );
1535 
1536  virtual ~CopyJob();
1537 
1542  KURL::List srcURLs() const { return m_srcList; }
1543 
1548  KURL destURL() const { return m_dest; }
1549 
1560  void setDefaultPermissions( bool b );
1561 
1573  void setInteractive( bool b );
1574 
1575  signals:
1576 
1582  void totalFiles( KIO::Job *job, unsigned long files );
1588  void totalDirs( KIO::Job *job, unsigned long dirs );
1589 
1597  void aboutToCreate( KIO::Job *job, const TQValueList<KIO::CopyInfo> &files);
1598 
1604  void processedFiles( KIO::Job *job, unsigned long files );
1610  void processedDirs( KIO::Job *job, unsigned long dirs );
1611 
1619  void copying( KIO::Job *job, const KURL& from, const KURL& to );
1627  void linking( KIO::Job *job, const TQString& target, const KURL& to );
1635  void moving( KIO::Job *job, const KURL& from, const KURL& to );
1641  void creatingDir( KIO::Job *job, const KURL& dir );
1648  void renamed( KIO::Job *job, const KURL& from, const KURL& to );
1649 
1662  void copyingDone( KIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed );
1672  void copyingLinkDone( KIO::Job *job, const KURL &from, const TQString& target, const KURL& to );
1673 
1674  protected:
1675  void statCurrentSrc();
1676  void statNextSrc();
1677 
1678  // Those aren't slots but submethods for slotResult.
1679  void slotResultStating( KIO::Job * job );
1680  void startListing( const KURL & src );
1681  void slotResultCreatingDirs( KIO::Job * job );
1682  void slotResultConflictCreatingDirs( KIO::Job * job );
1683  void createNextDir();
1684  void slotResultCopyingFiles( KIO::Job * job );
1685  void slotResultConflictCopyingFiles( KIO::Job * job );
1686  void copyNextFile();
1687  void slotResultDeletingDirs( KIO::Job * job );
1688  void deleteNextDir();
1689  void skip( const KURL & sourceURL );
1690  void slotResultRenaming( KIO::Job * job );
1691  //void slotResultSettingDirAttributes( KIO::Job * job );
1692  void setNextDirAttribute();
1693  private:
1694  void startRenameJob(const KURL &slave_url);
1695  bool shouldOverwrite( const TQString& path ) const;
1696  bool shouldSkip( const TQString& path ) const;
1697  void skipSrc();
1698 
1699  protected slots:
1700  void slotStart();
1701  void slotEntries( KIO::Job*, const KIO::UDSEntryList& list );
1702  virtual void slotResult( KIO::Job *job );
1706  void slotProcessedSize( KIO::Job*, KIO::filesize_t data_size );
1711  void slotTotalSize( KIO::Job*, KIO::filesize_t size );
1712 
1713  void slotReport();
1714  private:
1715  CopyMode m_mode;
1716  bool m_asMethod;
1717  enum DestinationState { DEST_NOT_STATED, DEST_IS_DIR, DEST_IS_FILE, DEST_DOESNT_EXIST };
1718  DestinationState destinationState;
1719  enum { STATE_STATING, STATE_RENAMING, STATE_LISTING, STATE_CREATING_DIRS,
1720  STATE_CONFLICT_CREATING_DIRS, STATE_COPYING_FILES, STATE_CONFLICT_COPYING_FILES,
1721  STATE_DELETING_DIRS, STATE_SETTING_DIR_ATTRIBUTES } state;
1722  KIO::filesize_t m_totalSize;
1723  KIO::filesize_t m_processedSize;
1724  KIO::filesize_t m_fileProcessedSize;
1725  int m_processedFiles;
1726  int m_processedDirs;
1727  TQValueList<CopyInfo> files;
1728  TQValueList<CopyInfo> dirs;
1729  KURL::List dirsToRemove;
1730  KURL::List m_srcList;
1731  KURL::List::Iterator m_currentStatSrc;
1732  bool m_bCurrentSrcIsDir;
1733  bool m_bCurrentOperationIsLink;
1734  bool m_bSingleFileCopy;
1735  bool m_bOnlyRenames;
1736  KURL m_dest;
1737  KURL m_currentDest;
1738  //
1739  TQStringList m_skipList;
1740  TQStringList m_overwriteList;
1741  bool m_bAutoSkip;
1742  bool m_bOverwriteAll;
1743  int m_conflictError;
1744 
1745  TQTimer *m_reportTimer;
1746  //these both are used for progress dialog reporting
1747  KURL m_currentSrcURL;
1748  KURL m_currentDestURL;
1749  protected:
1750  virtual void virtual_hook( int id, void* data );
1751  private:
1752  class CopyJobPrivate;
1753  CopyJobPrivate* d;
1754  friend class CopyJobPrivate; // for DestinationState
1755  };
1756 
1763  class KIO_EXPORT DeleteJob : public Job {
1764  Q_OBJECT
1765 
1766  public:
1776  DeleteJob( const KURL::List& src, bool shred, bool showProgressInfo );
1777 
1782  KURL::List urls() const { return m_srcList; }
1783 
1784  signals:
1785 
1791  void totalFiles( KIO::Job *job, unsigned long files );
1797  void totalDirs( KIO::Job *job, unsigned long dirs );
1798 
1804  void processedFiles( KIO::Job *job, unsigned long files );
1810  void processedDirs( KIO::Job *job, unsigned long dirs );
1811 
1818  void deleting( KIO::Job *job, const KURL& file );
1819 
1820  protected slots:
1821  void slotStart();
1822  void slotEntries( KIO::Job*, const KIO::UDSEntryList& list );
1823  virtual void slotResult( KIO::Job *job );
1824 
1828  void slotProcessedSize( KIO::Job*, KIO::filesize_t data_size );
1829  void slotReport();
1830 
1831  private:
1832  void statNextSrc();
1833  void deleteNextFile();
1834  void deleteNextDir();
1835 
1836  private:
1837  enum { STATE_STATING, STATE_LISTING,
1838  STATE_DELETING_FILES, STATE_DELETING_DIRS } state;
1839  KIO::filesize_t m_totalSize;
1840  KIO::filesize_t m_processedSize;
1841  KIO::filesize_t m_fileProcessedSize;
1842  int m_processedFiles;
1843  int m_processedDirs;
1844  int m_totalFilesDirs;
1845  KURL m_currentURL;
1846  KURL::List files;
1847  KURL::List symlinks;
1848  KURL::List dirs;
1849  KURL::List m_srcList;
1850  KURL::List::Iterator m_currentStat;
1851  TQStringList m_parentDirs;
1852  bool m_shred; // BIC: remove in KDE4
1853  TQTimer *m_reportTimer;
1854  protected:
1856  virtual void virtual_hook( int id, void* data );
1857  private:
1858  class DeleteJobPrivate* d;
1859  };
1860 
1861 }
1862 
1863 #endif
KIO::DeleteJob::urls
KURL::List urls() const
Returns the list of URLs.
Definition: jobclasses.h:1782
KIO::MimetypeJob::mimetype
TQString mimetype() const
Call this in the slot connected to result, and only after making sure no error happened.
Definition: jobclasses.h:1227
KIO::CopyJob::srcURLs
KURL::List srcURLs() const
Returns the list of source URLs.
Definition: jobclasses.h:1542
KIO::TransferJob::isSuspended
bool isSuspended() const
Flow control.
Definition: jobclasses.h:921
KIO
A namespace for KIO globals.
Definition: authinfo.h:29
KIO::StoredTransferJob::data
TQByteArray data() const
Get hold of the downloaded data.
Definition: jobclasses.h:1104
KIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1392
KIO::SimpleJob::url
const KURL & url() const
Returns the SimpleJob&#39;s URL.
Definition: jobclasses.h:549
KIO::StoredTransferJob
StoredTransferJob is a TransferJob (for downloading or uploading data) that also stores a TQByteArray...
Definition: jobclasses.h:1075
KIO::StatJob::setSide
void setSide(bool source)
A stat() can have two meanings.
Definition: jobclasses.h:709
KIO::TransferJob::isErrorPage
bool isErrorPage() const
Checks whether we got an error page.
Definition: jobclasses.h:931
KIO::StatJob
A KIO job that retrieves information about a file or directory.
Definition: jobclasses.h:688
KIO::CopyJob::destURL
KURL destURL() const
Returns the destination URL.
Definition: jobclasses.h:1548
KIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:514
KIO::Slave
Attention developers: If you change the implementation of KIO::Slave, do not use connection() or slav...
Definition: slave.h:44
KIO::move
KIO_EXPORT CopyJob * move(const KURL &src, const KURL &dest, bool showProgressInfo=true)
Moves a file or directory src to the given destination dest.
Definition: job.cpp:3908
KIO::mimetype
KIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1509
KIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:506
KIO::DeleteJob
A more complex Job to delete files and directories.
Definition: jobclasses.h:1763
KIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
KIO::Job::progressId
int progressId() const
Returns the progress id for this job.
Definition: jobclasses.h:101
Observer
Observer for KIO::Job progress information.
Definition: observer.h:55
KIO::Job::error
int error() const
Returns the error code, if there has been an error.
Definition: jobclasses.h:95
KIO::FileCopyJob::destURL
KURL destURL() const
Returns the destination URL.
Definition: jobclasses.h:1301
KIO::CopyJob::CopyMode
CopyMode
Defines the mode of the operation.
Definition: jobclasses.h:1515
KIO::StatJob::statResult
const UDSEntry & statResult() const
Call this in the slot connected to result, and only after making sure no error happened.
Definition: jobclasses.h:727
KIO::Job::errorText
const TQString & errorText() const
Returns the error text if there has been an error.
Definition: jobclasses.h:111
KIO::FileCopyJob
The FileCopyJob copies data from one place to another.
Definition: jobclasses.h:1250
KIO::StatJob::setDetails
void setDetails(short int details)
Selects the level of details we want.
Definition: jobclasses.h:720
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::FileCopyJob::srcURL
KURL srcURL() const
Returns the source URL.
Definition: jobclasses.h:1295
KIO::MimetypeJob
A MimetypeJob is a TransferJob that allows you to get the mime type of an URL.
Definition: jobclasses.h:1208
KIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:875
KIO::MultiGetJob
The MultiGetJob is a TransferJob that allows you to get several files from a single server...
Definition: jobclasses.h:1120
KIO::MkdirJob
A KIO job that creates a directory.
Definition: jobclasses.h:780
KIO::ListJob::redirectionURL
const KURL & redirectionURL() const
Returns the ListJob&#39;s redirection URL.
Definition: jobclasses.h:1424
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: jobclasses.h:1508
KIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:528

kio/kio

Skip menu "kio/kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kio/kio

Skip menu "kio/kio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kio by doxygen 1.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |