progressbase.h
/* This file is part of the KDE libraries
Copyright (C) 2000 Matej Koss <koss@miesto.sk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef __progressbase_h__
#define __progressbase_h__
#include <qwidget.h>
#include <kio/global.h>
class KURL;
namespace KIO {
class Job;
class CopyJob;
class DeleteJob;
}
namespace KIO
{
enum Progress {
DEFAULT = 1,
STATUSBAR = 2,
LIST = 3
};
class KIO_EXPORT ProgressBase : public QWidget {
Q_OBJECT
public:
ProgressBase( QWidget *parent );
~ProgressBase() {}
void setJob( KIO::Job *job );
void setJob( KIO::CopyJob *job );
void setJob( KIO::DeleteJob *job );
// should we stop the job when the dialog is closed ?
void setStopOnClose( bool stopOnClose ) { m_bStopOnClose = stopOnClose; }
bool stopOnClose() const { return m_bStopOnClose; }
// should we delete the dialog or just clean it when the job is finished ?
void setOnlyClean( bool onlyClean ) { m_bOnlyClean = onlyClean; }
bool onlyClean() const { return m_bOnlyClean; }
void finished();
public slots:
void slotStop();
virtual void slotClean();
// progress slots
virtual void slotTotalSize( KIO::Job* job, KIO::filesize_t size ) {
Q_UNUSED(job);Q_UNUSED(size);}
virtual void slotTotalFiles( KIO::Job* job, unsigned long files ) {
Q_UNUSED(job);Q_UNUSED(files);}
virtual void slotTotalDirs( KIO::Job* job, unsigned long dirs ) {
Q_UNUSED(job);Q_UNUSED(dirs);}
virtual void slotProcessedSize( KIO::Job* job, KIO::filesize_t bytes ) {
Q_UNUSED(job);Q_UNUSED(bytes);}
virtual void slotProcessedFiles( KIO::Job* job, unsigned long files ) {
Q_UNUSED(job);Q_UNUSED(files);}
virtual void slotProcessedDirs( KIO::Job* job, unsigned long dirs ) {
Q_UNUSED(job);Q_UNUSED(dirs);}
virtual void slotSpeed( KIO::Job* job, unsigned long speed ) {
Q_UNUSED(job);Q_UNUSED(speed);}
virtual void slotPercent( KIO::Job* job, unsigned long percent ) {
Q_UNUSED(job);Q_UNUSED(percent);}
virtual void slotCopying( KIO::Job* job, const KURL& src, const KURL& dest ) {
Q_UNUSED(job);Q_UNUSED(src);Q_UNUSED(dest);}
virtual void slotMoving( KIO::Job* job, const KURL& src, const KURL& dest ) {
Q_UNUSED(job);Q_UNUSED(src);Q_UNUSED(dest);}
virtual void slotDeleting( KIO::Job* job, const KURL& url) {
Q_UNUSED(job);Q_UNUSED(url);}
virtual void slotCreatingDir( KIO::Job* job, const KURL& dir ) {
Q_UNUSED(job);Q_UNUSED(dir);}
virtual void slotCanResume( KIO::Job* job, KIO::filesize_t from) {
Q_UNUSED(job);Q_UNUSED(from);}
signals:
void stopped();
protected slots:
void slotFinished( KIO::Job* );
protected:
virtual void closeEvent( QCloseEvent * );
KIO::Job* m_pJob;
private:
bool m_bOnlyClean;
bool m_bStopOnClose;
protected:
virtual void virtual_hook( int id, void* data );
private:
class ProgressBasePrivate* d;
};
} /* namespace */
#endif // __progressbase_h__
KIO::ProgressBase::slotTotalDirs
virtual void slotTotalDirs(KIO::Job *job, unsigned long dirs)
Called to set the total number of directories.
Definition: progressbase.h:163
KIO::ProgressBase::onlyClean
bool onlyClean() const
Checks whether the dialog should be deleted or cleaned.
Definition: progressbase.h:123
KIO::ProgressBase
This class does all initialization stuff for progress, like connecting signals to slots...
Definition: progressbase.h:70
KIO::ProgressBase::slotCanResume
virtual void slotCanResume(KIO::Job *job, KIO::filesize_t from)
Called when the job is resuming.
Definition: progressbase.h:240
KIO::ProgressBase::slotTotalFiles
virtual void slotTotalFiles(KIO::Job *job, unsigned long files)
Called to set the total number of files.
Definition: progressbase.h:156
KIO::DeleteJob
A more complex Job to delete files and directories.
Definition: jobclasses.h:1763
KIO::ProgressBase::slotCreatingDir
virtual void slotCreatingDir(KIO::Job *job, const KURL &dir)
Called when the job is creating a directory.
Definition: progressbase.h:232
KIO::ProgressBase::slotProcessedFiles
virtual void slotProcessedFiles(KIO::Job *job, unsigned long files)
Called to set the number of processed files.
Definition: progressbase.h:178
KIO::filesize_t
Q_ULLONG filesize_t
64-bit file size
Definition: global.h:39
KIO::ProgressBase::setOnlyClean
void setOnlyClean(bool onlyClean)
This controls whether the dialog should be deleted or only cleaned when the KIO::Job is finished (or ...
Definition: progressbase.h:115
KIO::ProgressBase::slotSpeed
virtual void slotSpeed(KIO::Job *job, unsigned long speed)
Called to set the speed.
Definition: progressbase.h:193
KIO::ProgressBase::slotProcessedSize
virtual void slotProcessedSize(KIO::Job *job, KIO::filesize_t bytes)
Called to set the processed size.
Definition: progressbase.h:171
KIO::ProgressBase::slotCopying
virtual void slotCopying(KIO::Job *job, const KURL &src, const KURL &dest)
Called when the job is copying.
Definition: progressbase.h:210
KIO::Job
The base class for all jobs.
Definition: jobclasses.h:68
KIO::ProgressBase::slotPercent
virtual void slotPercent(KIO::Job *job, unsigned long percent)
Called to set the percentage.
Definition: progressbase.h:201
KIO::ProgressBase::slotMoving
virtual void slotMoving(KIO::Job *job, const KURL &src, const KURL &dest)
Called when the job is moving.
Definition: progressbase.h:218
KIO::ProgressBase::slotDeleting
virtual void slotDeleting(KIO::Job *job, const KURL &url)
Called when the job is deleting.
Definition: progressbase.h:225
KIO::ProgressBase::slotProcessedDirs
virtual void slotProcessedDirs(KIO::Job *job, unsigned long dirs)
Called to set the number of processed directories.
Definition: progressbase.h:185
KIO::CopyJob
CopyJob is used to move, copy or symlink files and directories.
Definition: jobclasses.h:1508
KIO::ProgressBase::slotTotalSize
virtual void slotTotalSize(KIO::Job *job, KIO::filesize_t size)
Called to set the total size.
Definition: progressbase.h:149

KDE Home | KDE Accessibility Home | Description of Access Keys