kio
defaultprogress.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __defaultprogress_h__
00019 #define __defaultprogress_h__
00020
00021 #include <qlabel.h>
00022
00023 #include <kio/global.h>
00024
00025 #include <kprogress.h>
00026
00027 #include "progressbase.h"
00028
00029 class KLineEdit;
00030
00031 namespace KIO {
00032
00033
00034
00035
00036
00037 class KIO_EXPORT DefaultProgress : public ProgressBase {
00038
00039 Q_OBJECT
00040
00041 public:
00047 DefaultProgress( bool showNow = true );
00054 DefaultProgress( QWidget* parent, const char* name = 0 );
00055 ~DefaultProgress();
00056
00057 bool keepOpen() const;
00058
00060 static QString makePercentString( unsigned long percent,
00061 KIO::filesize_t totalSize,
00062 unsigned long totalFiles );
00063
00064 public slots:
00065 virtual void slotTotalSize( KIO::Job *job, KIO::filesize_t size );
00066 virtual void slotTotalFiles( KIO::Job *job, unsigned long files );
00067 virtual void slotTotalDirs( KIO::Job *job, unsigned long dirs );
00068
00069 virtual void slotProcessedSize( KIO::Job *job, KIO::filesize_t bytes );
00070 virtual void slotProcessedFiles( KIO::Job *job, unsigned long files );
00071 virtual void slotProcessedDirs( KIO::Job *job, unsigned long dirs );
00072
00073 virtual void slotSpeed( KIO::Job *job, unsigned long speed );
00074 virtual void slotPercent( KIO::Job *job, unsigned long percent );
00080 virtual void slotInfoMessage( KIO::Job *job, const QString & msg );
00081
00082 virtual void slotCopying( KIO::Job* job, const KURL& src, const KURL& dest );
00083 virtual void slotMoving( KIO::Job* job, const KURL& src, const KURL& dest );
00084 virtual void slotDeleting( KIO::Job* job, const KURL& url );
00091 void slotTransferring( KIO::Job* job, const KURL& url );
00092 virtual void slotCreatingDir( KIO::Job* job, const KURL& dir );
00099 virtual void slotStating( KIO::Job* job, const KURL& dir );
00106 virtual void slotMounting( KIO::Job* job, const QString & dev, const QString & point );
00112 virtual void slotUnmounting( KIO::Job* job, const QString & point );
00113 virtual void slotCanResume( KIO::Job* job, KIO::filesize_t from);
00114
00119 void slotClean();
00120
00121 protected:
00123 void init();
00124 void showTotals();
00125 void setDestVisible( bool visible );
00127 void checkDestination( const KURL& dest);
00128
00129 KLineEdit* sourceEdit;
00130 KLineEdit* destEdit;
00131 QLabel* progressLabel;
00132 QLabel* destInvite;
00133 QLabel* speedLabel;
00134 QLabel* sizeLabel;
00135 QLabel* resumeLabel;
00136
00137 KProgress* m_pProgressBar;
00138
00139 KIO::filesize_t m_iTotalSize;
00140 unsigned long m_iTotalFiles;
00141 unsigned long m_iTotalDirs;
00142
00143 KIO::filesize_t m_iProcessedSize;
00144 unsigned long m_iProcessedDirs;
00145 unsigned long m_iProcessedFiles;
00146
00147 enum ModeType { Copy, Move, Delete, Create, Done };
00148 ModeType mode;
00149
00150 protected:
00151 virtual void virtual_hook( int id, void* data );
00152 private:
00153 class DefaultProgressPrivate;
00154 DefaultProgressPrivate* d;
00155 private slots:
00156 void slotKeepOpenToggled(bool);
00157 void slotOpenFile();
00158 void slotOpenLocation();
00159 };
00160
00161 }
00162
00163 #endif // __defaultprogress_h__
00164