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

tdeio/tdeio

  • tdeio
  • tdeio
jobclasses.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2000 Stephan Kulow <coolo@kde.org>
3  David Faure <faure@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __tdeio_jobclasses_h__
22 #define __tdeio_jobclasses_h__
23 
24 #include <tqobject.h>
25 #include <tqptrlist.h>
26 #include <tqstring.h>
27 #include <tqstringlist.h>
28 #include <tqguardedptr.h>
29 
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 
33 #include <kurl.h>
34 #include <tdeio/global.h>
35 
36 class Observer;
37 class TQTimer;
38 
39 #define TDEIO_COPYJOB_HAS_SETINTERACTIVE // new in 3.4. Used by tdeio_trash.
40 
41 namespace TDEIO {
42 
43  class Slave;
44  class SlaveInterface;
45 
46 
67  class TDEIO_EXPORT Job : public TQObject {
68  Q_OBJECT
69 
70  protected:
71  Job( bool showProgressInfo );
72 
73  public:
74  virtual ~Job();
75 
86  virtual void kill( bool quietly = true );
87 
94  int error() const { return m_error; }
95 
100  int progressId() const { return m_progressId; }
101 
110  const TQString & errorText() const { return m_errorText; }
111 
129  TQString errorString() const;
130 
141  TQStringList detailedErrorStrings(const KURL *reqUrl = 0L,
142  int method = -1) const;
143 
152  void showErrorDialog( TQWidget * parent = 0L );
153 
167  void setAutoErrorHandlingEnabled( bool enable, TQWidget *parentWidget = 0 );
168 
174  bool isAutoErrorHandlingEnabled() const;
175 
189  void setAutoWarningHandlingEnabled( bool enable );
190 
198  bool isAutoWarningHandlingEnabled() const;
199 
207  void setInteractive(bool enable);
208 
215  bool isInteractive() const;
221  void setWindow(TQWidget *window);
222 
228  TQWidget *window() const;
229 
235  void updateUserTimestamp( unsigned long time );
236 
247  void setParentJob( Job* parentJob );
248 
255  Job* parentJob() const;
256 
264  void setMetaData( const TDEIO::MetaData &metaData);
265 
273  void addMetaData(const TQString &key, const TQString &value);
274 
282  void addMetaData(const TQMap<TQString,TQString> &values);
283 
291  void mergeMetaData(const TQMap<TQString,TQString> &values);
292 
296  MetaData outgoingMetaData() const;
297 
303  MetaData metaData() const;
304 
312  TQString queryMetaData(const TQString &key);
313 
319  TDEIO::filesize_t getProcessedSize();
320 
321  signals:
327  void result( TDEIO::Job *job );
328 
336  void canceled( TDEIO::Job *job );
337 
344  void infoMessage( TDEIO::Job *job, const TQString & msg );
345  // KDE4: Separate rich-text string from plain-text string, for different widgets.
346 
353  void warning( TDEIO::Job *job, const TQString & msg );
354  // KDE4: Separate rich-text string from plain-text string, for different widgets.
355 
362  void connected( TDEIO::Job *job );
363 
372  void percent( TDEIO::Job *job, unsigned long percent );
373 
380  void totalSize( TDEIO::Job *job, TDEIO::filesize_t size );
381 
388  void processedSize( TDEIO::Job *job, TDEIO::filesize_t size );
389 
395  void speed( TDEIO::Job *job, unsigned long speed );
396 
397  protected slots:
406  virtual void slotResult( TDEIO::Job *job );
407 
414  void slotSpeed( TDEIO::Job *job, unsigned long speed );
421  void slotInfoMessage( TDEIO::Job *job, const TQString &msg );
422 
426  void slotSpeedTimeout();
427 
428  protected:
438  virtual void addSubjob( Job *job, bool inheritMetaData=true );
439 
448  virtual void removeSubjob( Job *job );
457  void removeSubjob( Job *job, bool mergeMetaData, bool emitResultIfLast ); // KDE4: merge with above, with =true to both
458 
467  void emitPercent( TDEIO::filesize_t processedSize, TDEIO::filesize_t totalSize );
468 
475  void emitSpeed( unsigned long speed );
476 
481  void emitResult();
482 
487  void setProcessedSize(TDEIO::filesize_t size);
488 
492  unsigned long userTimestamp() const;
493 
499  enum { EF_TransferJobAsync = (1 << 0),
500  EF_TransferJobNeedData = (1 << 1),
501  EF_TransferJobDataSent = (1 << 2),
502  EF_ListJobUnrestricted = (1 << 3) };
503  int &extraFlags();
504 
505  TQPtrList<Job> subjobs;
506  int m_error;
507  TQString m_errorText;
508  unsigned long m_percent;
509  int m_progressId; // for uiserver
510  TQTimer *m_speedTimer;
511  TQGuardedPtr<TQWidget> m_window;
512  MetaData m_outgoingMetaData;
513  MetaData m_incomingMetaData;
514  protected:
515  virtual void virtual_hook( int id, void* data );
516  private:
517  class JobPrivate;
518  JobPrivate *d;
519  };
520 
527  class TDEIO_EXPORT SimpleJob : public TDEIO::Job {
528  Q_OBJECT
529 
530  public:
539  SimpleJob(const KURL& url, int command, const TQByteArray &packedArgs,
540  bool showProgressInfo);
541 
542  ~SimpleJob();
543 
548  const KURL& url() const { return m_url; }
549 
557  virtual void kill( bool quietly = true );
558 
563  virtual void putOnHold();
564 
568  static void removeOnHold();
569 
575  virtual void start( Slave *slave );
576 
581  void slaveDone();
582 
587  Slave *slave() const { return m_slave; }
588 
592  int command() const { return m_command; }
593 
594  public slots:
600  void slotTotalSize( TDEIO::filesize_t data_size );
601 
602  protected slots:
607  virtual void slotFinished( );
608 
613  void slotWarning( const TQString & ); // KDE4: make virtual
614 
620  void slotInfoMessage( const TQString &s ); // KDE4: make virtual
621 
626  void slotConnected();
627 
633  void slotProcessedSize( TDEIO::filesize_t data_size );
639  void slotSpeed( unsigned long speed );
640 
646  virtual void slotMetaData( const TDEIO::MetaData &_metaData);
647 
648  public slots:
654  virtual void slotError( int , const TQString & );
655 
656  protected slots:
660  void slotNeedProgressId();
661 
662  protected:
663  Slave * m_slave;
664  TQByteArray m_packedArgs;
665  KURL m_url;
666  KURL m_subUrl;
667  int m_command;
668  TDEIO::filesize_t m_totalSize;
669  protected:
670  virtual void virtual_hook( int id, void* data );
671  /*
672  * Allow jobs that inherit SimpleJob and are aware
673  * of redirections to store the SSL session used.
674  * Retrieval is handled by SimpleJob::start
675  * @param m_redirectionURL Reference to redirection URL,
676  * used instead of m_url if not empty
677  */
678  void storeSSLSessionFromJob(const KURL &m_redirectionURL);
679  private:
680  class SimpleJobPrivate* d;
681  };
682 
687  class TDEIO_EXPORT StatJob : public SimpleJob {
688 
689  Q_OBJECT
690 
691  public:
699  StatJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
700 
708  void setSide( bool source ) { m_bSource = source; }
709 
719  void setDetails( short int details ) { m_details = details; }
720 
726  const UDSEntry & statResult() const { return m_statResult; }
727 
734  virtual void start( Slave *slave );
735 
736  signals:
744  void redirection( TDEIO::Job *job, const KURL &url );
745 
754  void permanentRedirection( TDEIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
755 
756  protected slots:
757  void slotStatEntry( const TDEIO::UDSEntry & entry );
758  void slotRedirection( const KURL &url);
759  virtual void slotFinished();
760  virtual void slotMetaData( const TDEIO::MetaData &_metaData);
761 
762  protected:
763  UDSEntry m_statResult;
764  KURL m_redirectionURL;
765  bool m_bSource;
766  short int m_details;
767  protected:
768  virtual void virtual_hook( int id, void* data );
769  private:
770  class StatJobPrivate;
771  StatJobPrivate *d;
772  };
773 
779  class TDEIO_EXPORT MkdirJob : public SimpleJob {
780 
781  Q_OBJECT
782 
783  public:
791  MkdirJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
792 
799  virtual void start( Slave *slave );
800 
801  signals:
809  void redirection( TDEIO::Job *job, const KURL &url );
810 
818  void permanentRedirection( TDEIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
819 
820  protected slots:
821  void slotRedirection( const KURL &url);
822  virtual void slotFinished();
823 
824  protected:
825  KURL m_redirectionURL;
826 
827  protected:
828  virtual void virtual_hook( int id, void* data );
829  private:
830  class MkdirJobPrivate;
831  MkdirJobPrivate *d;
832  };
833 
838  class TDEIO_EXPORT DirectCopyJob : public SimpleJob {
839  Q_OBJECT
840 
841  public:
845  DirectCopyJob(const KURL& url, int command, const TQByteArray &packedArgs,
846  bool showProgressInfo);
853  virtual void start(Slave *slave);
854 
855  signals:
861  void canResume( TDEIO::Job *job, TDEIO::filesize_t offset );
862 
863  private slots:
864  void slotCanResume( TDEIO::filesize_t offset );
865  };
866 
867 
874  class TDEIO_EXPORT TransferJob : public SimpleJob {
875  Q_OBJECT
876 
877  public:
887  TransferJob(const KURL& url, int command,
888  const TQByteArray &packedArgs,
889  const TQByteArray &_staticData,
890  bool showProgressInfo);
891 
898  virtual void start(Slave *slave);
899 
904  virtual void slotResult( TDEIO::Job *job );
905 
909  void suspend();
910 
914  void resume();
915 
920  bool isSuspended() const { return m_suspended; }
921 
922 
930  bool isErrorPage() const { return m_errorPage; }
931 
939  void setAsyncDataEnabled(bool enabled);
940 
947  void sendAsyncData(const TQByteArray &data);
948 
956  void setReportDataSent(bool enabled);
957 
964  bool reportDataSent();
965 
966  signals:
976  void data( TDEIO::Job *job, const TQByteArray &data );
977 
989  void dataReq( TDEIO::Job *job, TQByteArray &data );
990 
998  void redirection( TDEIO::Job *job, const KURL &url );
999 
1008  void permanentRedirection( TDEIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
1009 
1015  void mimetype( TDEIO::Job *job, const TQString &type );
1016 
1024  void canResume( TDEIO::Job *job, TDEIO::filesize_t offset );
1025 
1026 
1027  protected slots:
1028  virtual void slotRedirection( const KURL &url);
1029  virtual void slotFinished();
1030  virtual void slotData( const TQByteArray &data);
1031  virtual void slotDataReq();
1032  virtual void slotMimetype( const TQString &mimetype );
1033  virtual void slotNeedSubURLData();
1034  virtual void slotSubURLData(TDEIO::Job*, const TQByteArray &);
1035  virtual void slotMetaData( const TDEIO::MetaData &_metaData);
1036  void slotErrorPage();
1037  void slotCanResume( TDEIO::filesize_t offset );
1038  void slotPostRedirection();
1039 
1040  protected:
1041  bool m_suspended;
1042  bool m_errorPage;
1043  TQByteArray staticData;
1044  KURL m_redirectionURL;
1045  KURL::List m_redirectionList;
1046  TQString m_mimetype;
1047  TransferJob *m_subJob;
1048  protected:
1049  virtual void virtual_hook( int id, void* data );
1050  private:
1051  class TransferJobPrivate *d;
1052  };
1053 
1074  class TDEIO_EXPORT StoredTransferJob : public TDEIO::TransferJob {
1075  Q_OBJECT
1076 
1077  public:
1087  StoredTransferJob(const KURL& url, int command,
1088  const TQByteArray &packedArgs,
1089  const TQByteArray &_staticData,
1090  bool showProgressInfo);
1091 
1097  void setData( const TQByteArray& arr );
1098 
1103  TQByteArray data() const { return m_data; }
1104 
1105  private slots:
1106  void slotStoredData( TDEIO::Job *job, const TQByteArray &data );
1107  void slotStoredDataReq( TDEIO::Job *job, TQByteArray &data );
1108  private:
1109  TQByteArray m_data;
1110  int m_uploadOffset;
1111  };
1112 
1119  class TDEIO_EXPORT MultiGetJob : public TransferJob {
1120  Q_OBJECT
1121 
1122  public:
1130  MultiGetJob(const KURL& url, bool showProgressInfo);
1131 
1138  virtual void start(Slave *slave);
1139 
1147  void get(long id, const KURL &url, const MetaData &metaData);
1148 
1149  signals:
1156  void data( long id, const TQByteArray &data);
1157 
1163  void mimetype( long id, const TQString &type );
1164 
1172  void result( long id);
1173 
1174  protected slots:
1175  virtual void slotRedirection( const KURL &url);
1176  virtual void slotFinished();
1177  virtual void slotData( const TQByteArray &data);
1178  virtual void slotMimetype( const TQString &mimetype );
1179  private:
1180  struct GetRequest {
1181  public:
1182  GetRequest(long _id, const KURL &_url, const MetaData &_metaData)
1183  : id(_id), url(_url), metaData(_metaData) { }
1184  long id;
1185  KURL url;
1186  MetaData metaData;
1187  };
1188  bool findCurrentEntry();
1189  void flushQueue(TQPtrList<GetRequest> &queue);
1190 
1191  TQPtrList<GetRequest> m_waitQueue;
1192  TQPtrList<GetRequest> m_activeQueue;
1193  bool b_multiGetActive;
1194  GetRequest *m_currentEntry;
1195  protected:
1196  virtual void virtual_hook( int id, void* data );
1197  private:
1198  class MultiGetJobPrivate* d;
1199  };
1200 
1207  class TDEIO_EXPORT MimetypeJob : public TransferJob {
1208  Q_OBJECT
1209 
1210  public:
1219  MimetypeJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
1220 
1226  TQString mimetype() const { return m_mimetype; }
1227 
1234  virtual void start( Slave *slave );
1235 
1236  protected slots:
1237  virtual void slotFinished( );
1238  protected:
1239  virtual void virtual_hook( int id, void* data );
1240  private:
1241  class MimetypeJobPrivate* d;
1242  };
1243 
1249  class TDEIO_EXPORT FileCopyJob : public Job {
1250  Q_OBJECT
1251 
1252  public:
1264  FileCopyJob( const KURL& src, const KURL& dest, int permissions,
1265  bool move, bool overwrite, bool resume, bool showProgressInfo);
1266 
1267  ~FileCopyJob();
1274  void setSourceSize64(TDEIO::filesize_t size);
1275 
1283  void setModificationTime( time_t mtime );
1284 
1288  void setSourceSize( off_t size ) KDE_DEPRECATED;
1289 
1294  KURL srcURL() const { return m_src; }
1295 
1300  KURL destURL() const { return m_dest; }
1301 
1302  signals:
1312  void mimetype( TDEIO::Job *job, const TQString &type );
1313 
1314  public slots:
1315  void slotStart();
1316  void slotData( TDEIO::Job *, const TQByteArray &data);
1317  void slotDataReq( TDEIO::Job *, TQByteArray &data);
1318  void slotMimetype( TDEIO::Job *, const TQString& type );
1319 
1320  protected slots:
1325  virtual void slotResult( TDEIO::Job *job );
1326 
1332  void slotProcessedSize( TDEIO::Job *job, TDEIO::filesize_t size );
1338  void slotTotalSize( TDEIO::Job *job, TDEIO::filesize_t size );
1344  void slotPercent( TDEIO::Job *job, unsigned long pct );
1350  void slotCanResume( TDEIO::Job *job, TDEIO::filesize_t offset );
1351 
1352  protected:
1353  void startCopyJob();
1354  void startCopyJob(const KURL &slave_url);
1355  void startRenameJob(const KURL &slave_url);
1356  void startDataPump();
1357  void connectSubjob( SimpleJob * job );
1358 
1359  private:
1360  void startBestCopyMethod();
1361 
1362  protected:
1363  KURL m_src;
1364  KURL m_dest;
1365  int m_permissions;
1366  bool m_move:1;
1367  bool m_overwrite:1;
1368  bool m_resume:1;
1369  bool m_canResume:1;
1370  bool m_resumeAnswerSent:1;
1371  TQByteArray m_buffer;
1372  SimpleJob *m_moveJob;
1373  SimpleJob *m_copyJob;
1374  TransferJob *m_getJob;
1375  TransferJob *m_putJob;
1376  TDEIO::filesize_t m_totalSize;
1377  protected:
1378  virtual void virtual_hook( int id, void* data );
1379  private:
1380  class FileCopyJobPrivate;
1381  FileCopyJobPrivate* d;
1382  };
1383 
1391  class TDEIO_EXPORT ListJob : public SimpleJob {
1392  Q_OBJECT
1393 
1394  public:
1405  ListJob(const KURL& url, bool showProgressInfo,
1406  bool recursive = false, TQString prefix = TQString::null,
1407  bool includeHidden = true);
1408 
1415  virtual void start( Slave *slave );
1416 
1423  const KURL& redirectionURL() const { return m_redirectionURL; }
1424 
1429  void setUnrestricted(bool unrestricted);
1430 
1431  signals:
1441  void entries( TDEIO::Job *job, const TDEIO::UDSEntryList& list);
1442 
1450  void redirection( TDEIO::Job *job, const KURL &url );
1451 
1460  void permanentRedirection( TDEIO::Job *job, const KURL &fromUrl, const KURL &toUrl );
1461 
1462  protected slots:
1463  virtual void slotFinished( );
1464  virtual void slotMetaData( const TDEIO::MetaData &_metaData);
1465  virtual void slotResult( TDEIO::Job *job );
1466  void slotListEntries( const TDEIO::UDSEntryList& list );
1467  void slotRedirection( const KURL &url );
1468  void gotEntries( TDEIO::Job * subjob, const TDEIO::UDSEntryList& list );
1469 
1470  private:
1471  bool recursive;
1472  bool includeHidden;
1473  TQString prefix;
1474  unsigned long m_processedEntries;
1475  KURL m_redirectionURL;
1476  protected:
1477  virtual void virtual_hook( int id, void* data );
1478  private:
1479  class ListJobPrivate* d;
1480  };
1481 
1483  struct TDEIO_EXPORT CopyInfo
1484  {
1485  KURL uSource;
1486  KURL uDest;
1487  TQString linkDest; // for symlinks only
1488  int permissions;
1489  //mode_t type;
1490  time_t ctime;
1491  time_t mtime;
1492  TDEIO::filesize_t size; // 0 for dirs
1493  };
1494 
1507  class TDEIO_EXPORT CopyJob : public Job {
1508  Q_OBJECT
1509 
1510  public:
1514  enum CopyMode{ Copy, Move, Link };
1515 
1533  CopyJob( const KURL::List& src, const KURL& dest, CopyMode mode, bool asMethod, bool showProgressInfo );
1534 
1535  virtual ~CopyJob();
1536 
1541  KURL::List srcURLs() const { return m_srcList; }
1542 
1547  KURL destURL() const { return m_dest; }
1548 
1559  void setDefaultPermissions( bool b );
1560 
1572  void setInteractive( bool b );
1573 
1574  signals:
1575 
1581  void totalFiles( TDEIO::Job *job, unsigned long files );
1587  void totalDirs( TDEIO::Job *job, unsigned long dirs );
1588 
1596  void aboutToCreate( TDEIO::Job *job, const TQValueList<TDEIO::CopyInfo> &files);
1597 
1603  void processedFiles( TDEIO::Job *job, unsigned long files );
1609  void processedDirs( TDEIO::Job *job, unsigned long dirs );
1610 
1618  void copying( TDEIO::Job *job, const KURL& from, const KURL& to );
1626  void linking( TDEIO::Job *job, const TQString& target, const KURL& to );
1634  void moving( TDEIO::Job *job, const KURL& from, const KURL& to );
1640  void creatingDir( TDEIO::Job *job, const KURL& dir );
1647  void renamed( TDEIO::Job *job, const KURL& from, const KURL& to );
1648 
1661  void copyingDone( TDEIO::Job *job, const KURL &from, const KURL &to, bool directory, bool renamed );
1671  void copyingLinkDone( TDEIO::Job *job, const KURL &from, const TQString& target, const KURL& to );
1672 
1673  protected:
1674  void statCurrentSrc();
1675  void statNextSrc();
1676 
1677  // Those aren't slots but submethods for slotResult.
1678  void slotResultStating( TDEIO::Job * job );
1679  void startListing( const KURL & src );
1680  void slotResultCreatingDirs( TDEIO::Job * job );
1681  void slotResultConflictCreatingDirs( TDEIO::Job * job );
1682  void createNextDir();
1683  void slotResultCopyingFiles( TDEIO::Job * job );
1684  void slotResultConflictCopyingFiles( TDEIO::Job * job );
1685  void copyNextFile();
1686  void slotResultDeletingDirs( TDEIO::Job * job );
1687  void deleteNextDir();
1688  void skip( const KURL & sourceURL );
1689  void slotResultRenaming( TDEIO::Job * job );
1690  //void slotResultSettingDirAttributes( TDEIO::Job * job );
1691  void setNextDirAttribute();
1692  private:
1693  void startRenameJob(const KURL &slave_url);
1694  bool shouldOverwrite( const TQString& path ) const;
1695  bool shouldSkip( const TQString& path ) const;
1696  void skipSrc();
1697 
1698  protected slots:
1699  void slotStart();
1700  void slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& list );
1701  virtual void slotResult( TDEIO::Job *job );
1705  void slotProcessedSize( TDEIO::Job*, TDEIO::filesize_t data_size );
1710  void slotTotalSize( TDEIO::Job*, TDEIO::filesize_t size );
1711 
1712  void slotReport();
1713  private:
1714  CopyMode m_mode;
1715  bool m_asMethod;
1716  enum DestinationState { DEST_NOT_STATED, DEST_IS_DIR, DEST_IS_FILE, DEST_DOESNT_EXIST };
1717  DestinationState destinationState;
1718  enum { STATE_STATING, STATE_RENAMING, STATE_LISTING, STATE_CREATING_DIRS,
1719  STATE_CONFLICT_CREATING_DIRS, STATE_COPYING_FILES, STATE_CONFLICT_COPYING_FILES,
1720  STATE_DELETING_DIRS, STATE_SETTING_DIR_ATTRIBUTES } state;
1721  TDEIO::filesize_t m_totalSize;
1722  TDEIO::filesize_t m_processedSize;
1723  TDEIO::filesize_t m_fileProcessedSize;
1724  int m_processedFiles;
1725  int m_processedDirs;
1726  TQValueList<CopyInfo> files;
1727  TQValueList<CopyInfo> dirs;
1728  KURL::List dirsToRemove;
1729  KURL::List m_srcList;
1730  KURL::List::Iterator m_currentStatSrc;
1731  bool m_bCurrentSrcIsDir;
1732  bool m_bCurrentOperationIsLink;
1733  bool m_bSingleFileCopy;
1734  bool m_bOnlyRenames;
1735  KURL m_dest;
1736  KURL m_currentDest;
1737  //
1738  TQStringList m_skipList;
1739  TQStringList m_overwriteList;
1740  bool m_bAutoSkip;
1741  bool m_bOverwriteAll;
1742  int m_conflictError;
1743 
1744  TQTimer *m_reportTimer;
1745  //these both are used for progress dialog reporting
1746  KURL m_currentSrcURL;
1747  KURL m_currentDestURL;
1748  protected:
1749  virtual void virtual_hook( int id, void* data );
1750  private:
1751  class CopyJobPrivate;
1752  CopyJobPrivate* d;
1753  friend class CopyJobPrivate; // for DestinationState
1754  };
1755 
1762  class TDEIO_EXPORT DeleteJob : public Job {
1763  Q_OBJECT
1764 
1765  public:
1775  DeleteJob( const KURL::List& src, bool shred, bool showProgressInfo );
1776 
1781  KURL::List urls() const { return m_srcList; }
1782 
1783  signals:
1784 
1790  void totalFiles( TDEIO::Job *job, unsigned long files );
1796  void totalDirs( TDEIO::Job *job, unsigned long dirs );
1797 
1803  void processedFiles( TDEIO::Job *job, unsigned long files );
1809  void processedDirs( TDEIO::Job *job, unsigned long dirs );
1810 
1817  void deleting( TDEIO::Job *job, const KURL& file );
1818 
1819  protected slots:
1820  void slotStart();
1821  void slotEntries( TDEIO::Job*, const TDEIO::UDSEntryList& list );
1822  virtual void slotResult( TDEIO::Job *job );
1823 
1827  void slotProcessedSize( TDEIO::Job*, TDEIO::filesize_t data_size );
1828  void slotReport();
1829 
1830  private:
1831  void statNextSrc();
1832  void deleteNextFile();
1833  void deleteNextDir();
1834 
1835  private:
1836  enum { STATE_STATING, STATE_LISTING,
1837  STATE_DELETING_FILES, STATE_DELETING_DIRS } state;
1838  TDEIO::filesize_t m_totalSize;
1839  TDEIO::filesize_t m_processedSize;
1840  TDEIO::filesize_t m_fileProcessedSize;
1841  int m_processedFiles;
1842  int m_processedDirs;
1843  int m_totalFilesDirs;
1844  KURL m_currentURL;
1845  KURL::List files;
1846  KURL::List symlinks;
1847  KURL::List dirs;
1848  KURL::List m_srcList;
1849  KURL::List::Iterator m_currentStat;
1850  TQStringList m_parentDirs;
1851  bool m_shred; // BIC: remove in KDE4
1852  TQTimer *m_reportTimer;
1853  protected:
1855  virtual void virtual_hook( int id, void* data );
1856  private:
1857  class DeleteJobPrivate* d;
1858  };
1859 
1865  class TDEIO_EXPORT LocalURLJob : public SimpleJob {
1866 
1867  Q_OBJECT
1868 
1869  public:
1877  LocalURLJob(const KURL& url, int command, const TQByteArray &packedArgs, bool showProgressInfo);
1878 
1885  virtual void start( Slave *slave );
1886 
1887  signals:
1893  void localURL( TDEIO::LocalURLJob *job, const KURL &url, bool isLocal );
1894 
1895  protected slots:
1896  void slotLocalURL( const KURL &url, bool isLocal );
1897  virtual void slotFinished();
1898 
1899  protected:
1900  virtual void virtual_hook( int id, void* data );
1901  private:
1902  class LocalURLJobPrivate;
1903  LocalURLJobPrivate *d;
1904  };
1905 
1906 }
1907 
1908 #endif
TDEIO::UDSEntry
TQValueList< UDSAtom > UDSEntry
An entry is the list of atoms containing all the information for a file or URL.
Definition: global.h:507
TDEIO::filesize_t
TQ_ULLONG filesize_t
64-bit file size
Definition: global.h:39
TDEIO::FileCopyJob::srcURL
KURL srcURL() const
Returns the source URL.
Definition: jobclasses.h:1294
TDEIO::CopyJob::destURL
KURL destURL() const
Returns the destination URL.
Definition: jobclasses.h:1547
TDEIO::StoredTransferJob
StoredTransferJob is a TransferJob (for downloading or uploading data) that also stores a TQByteArray...
Definition: jobclasses.h:1074
TDEIO::SimpleJob::url
const KURL & url() const
Returns the SimpleJob's URL.
Definition: jobclasses.h:548
TDEIO::move
TDEIO_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:3943
TDEIO::MkdirJob
A TDEIO job that creates a directory.
Definition: jobclasses.h:779
TDEIO
A namespace for TDEIO globals.
Definition: authinfo.h:29
TDEIO::StatJob::setSide
void setSide(bool source)
A stat() can have two meanings.
Definition: jobclasses.h:708
TDEIO::MultiGetJob
The MultiGetJob is a TransferJob that allows you to get several files from a single server...
Definition: jobclasses.h:1119
TDEIO::Job
The base class for all jobs.
Definition: jobclasses.h:67
TDEIO::StatJob
A TDEIO job that retrieves information about a file or directory.
Definition: jobclasses.h:687
TDEIO::FileCopyJob::destURL
KURL destURL() const
Returns the destination URL.
Definition: jobclasses.h:1300
TDEIO::Job::progressId
int progressId() const
Returns the progress id for this job.
Definition: jobclasses.h:100
TDEIO::localURL
TDEIO_EXPORT LocalURLJob * localURL(const KURL &remoteUrl)
Retrieve local URL if available.
Definition: job.cpp:841
TDEIO::Job::error
int error() const
Returns the error code, if there has been an error.
Definition: jobclasses.h:94
TDEIO::mimetype
TDEIO_EXPORT MimetypeJob * mimetype(const KURL &url, bool showProgressInfo=true)
Find mimetype for one file or directory.
Definition: job.cpp:1544
TDEIO::TransferJob::isErrorPage
bool isErrorPage() const
Checks whether we got an error page.
Definition: jobclasses.h:930
TDEIO::LocalURLJob
A TDEIO job that finds a local URL.
Definition: jobclasses.h:1865
TDEIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: jobclasses.h:1507
Observer
Observer for TDEIO::Job progress information.
Definition: observer.h:55
TDEIO::MimetypeJob::mimetype
TQString mimetype() const
Call this in the slot connected to result, and only after making sure no error happened.
Definition: jobclasses.h:1226
TDEIO::StatJob::setDetails
void setDetails(short int details)
Selects the level of details we want.
Definition: jobclasses.h:719
TDEIO::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:726
TDEIO::SimpleJob
A simple job (one url and one command).
Definition: jobclasses.h:527
TDEIO::Job::errorText
const TQString & errorText() const
Returns the error text if there has been an error.
Definition: jobclasses.h:110
TDEIO::DeleteJob
A more complex Job to delete files and directories.
Definition: jobclasses.h:1762
TDEIO::ListJob
A ListJob is allows you to get the get the content of a directory.
Definition: jobclasses.h:1391
TDEIO::CopyJob::CopyMode
CopyMode
Defines the mode of the operation.
Definition: jobclasses.h:1514
TDEIO::Slave
Attention developers: If you change the implementation of TDEIO::Slave, do not use connection() or sl...
Definition: slave.h:43
TDEIO::TransferJob::isSuspended
bool isSuspended() const
Flow control.
Definition: jobclasses.h:920
TDEIO::CopyJob::srcURLs
KURL::List srcURLs() const
Returns the list of source URLs.
Definition: jobclasses.h:1541
TDEIO::StoredTransferJob::data
TQByteArray data() const
Get hold of the downloaded data.
Definition: jobclasses.h:1103
TDEIO::TransferJob
The transfer job pumps data into and/or out of a Slave.
Definition: jobclasses.h:874
TDEIO::FileCopyJob
The FileCopyJob copies data from one place to another.
Definition: jobclasses.h:1249
TDEIO::MimetypeJob
A MimetypeJob is a TransferJob that allows you to get the mime type of an URL.
Definition: jobclasses.h:1207
TDEIO::MetaData
MetaData is a simple map of key/value strings.
Definition: global.h:515
TDEIO::ListJob::redirectionURL
const KURL & redirectionURL() const
Returns the ListJob's redirection URL.
Definition: jobclasses.h:1423
TDEIO::DeleteJob::urls
KURL::List urls() const
Returns the list of URLs.
Definition: jobclasses.h:1781

tdeio/tdeio

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

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.8
This website is maintained by Timothy Pearson.