kio Library: KIO::ProgressBase Class Reference (kio Library)

| # kio Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KIO::ProgressBase Class Reference

This class does all initialization stuff for progress, like connecting signals to slots. Base class for IO progress dialogs. More...

`#include <progressbase.h>`

Inheritance diagram for KIO::ProgressBase:

[legend]
Collaboration diagram for KIO::ProgressBase:

[legend]
List of all members.

## Public Slots
void | slotStop ()
virtual void | slotClean ()
virtual void | slotTotalSize (KIO::Job *job, KIO::filesize_t bytes)
virtual void | slotTotalFiles (KIO::Job *job, unsigned long files)
virtual void | slotTotalDirs (KIO::Job *job, unsigned long dirs)
virtual void | slotProcessedSize (KIO::Job *job, KIO::filesize_t bytes)
virtual void | slotProcessedFiles (KIO::Job *job, unsigned long files)
virtual void | slotProcessedDirs (KIO::Job *job, unsigned long dirs)
virtual void | slotSpeed (KIO::Job *job, unsigned long speed)
virtual void | slotPercent (KIO::Job *job, unsigned long percent)
virtual void | slotCopying (KIO::Job *job, const KURL &src, const KURL &dest)
virtual void | slotMoving (KIO::Job *job, const KURL &src, const KURL &dest)
virtual void | slotDeleting (KIO::Job *job, const KURL &url)
virtual void | slotCreatingDir (KIO::Job *job, const KURL &dir)
virtual void | slotCanResume (KIO::Job *job, KIO::filesize_t from)
## Signals
void | stopped ()
## Public Member Functions
| ProgressBase (QWidget *parent)
void | setJob (KIO::Job *job)
void | setJob (KIO::CopyJob *job)
void | setJob (KIO::DeleteJob *job)
void | setStopOnClose (bool stopOnClose)
bool | stopOnClose () const
void | setOnlyClean (bool onlyClean)
bool | onlyClean () const
void | finished ()
## Protected Slots
void | slotFinished (KIO::Job *)
## Protected Member Functions
virtual void | closeEvent (QCloseEvent *)
virtual void | virtual_hook (int id, void *data)
## Protected Attributes
KIO::Job * | m_pJob

## Detailed Description

This class does all initialization stuff for progress, like connecting signals to slots. Base class for IO progress dialogs.

All slots are implemented as pure virtual methods.

All custom IO progress dialog should inherit this class. Add your GUI code to the constructor and implemement those virtual methods which you need in order to display progress.

E.g. StatusbarProgress only implements slotTotalSize(), slotPercent() and slotSpeed().

Custom progress dialog will be used like this :

     // create job
     CopyJob* job = KIO::copy(...);
     // create a dialog
     MyCustomProgress *customProgress;
     customProgress = new MyCustomProgress();
     // connect progress with job
     customProgress->setJob( job );
     ...

There is a special method setStopOnClose() that controls the behavior of the dialog.

Author:
  Matej Koss <koss@miesto.sk>

Definition at line 70 of file progressbase.h.

## Constructor & Destructor Documentation

KIO::ProgressBase::ProgressBase | ( | QWidget * | parent | ) |

  | Creates a new progress dialog. Parameters:
  | parent | the parent of this dialog window, or 0
Definition at line 24 of file progressbase.cpp.

## Member Function Documentation

void KIO::ProgressBase::setJob | ( | KIO::Job * | job | ) |

  | Assign a KIO::Job to this progress dialog. Parameters:
  | job | the job to assign
Reimplemented in KIO::StatusbarProgress. Definition at line 37 of file progressbase.cpp. References slotPercent().

void KIO::ProgressBase::setJob | ( | KIO::CopyJob * | job | ) |

  | Assign a KIO::Job to this progress dialog. Parameters:
  | job | the job to assign
Definition at line 54 of file progressbase.cpp. References slotCopying(), slotCreatingDir(), slotMoving(), slotPercent(), slotProcessedDirs(), slotProcessedFiles(), slotProcessedSize(), slotSpeed(), slotTotalDirs(), slotTotalFiles(), and slotTotalSize().

void KIO::ProgressBase::setJob | ( | KIO::DeleteJob * | job | ) |

  | Assign a KIO::Job to this progress dialog. Parameters:
  | job | the job to assign
Definition at line 94 of file progressbase.cpp. References slotDeleting(), slotPercent(), slotProcessedDirs(), slotProcessedFiles(), slotProcessedSize(), slotSpeed(), slotTotalDirs(), slotTotalFiles(), and slotTotalSize().

void KIO::ProgressBase::setOnlyClean | ( | bool | onlyClean | ) | `[inline]`

  | This controls whether the dialog should be deleted or only cleaned when the KIO::Job is finished (or canceled). If your dialog is an embedded widget and not a separate window, you should setOnlyClean(true) in the constructor of your custom dialog. Parameters:
  | onlyClean | If true the dialog will only call method slotClean. If false the dialog will be deleted.
See also: onlyClean() Definition at line 115 of file progressbase.h. Referenced by KIO::StatusbarProgress::StatusbarProgress().

bool KIO::ProgressBase::onlyClean | ( |  | ) | const`[inline]`

| Checks whether the dialog should be deleted or cleaned. Returns: true if the dialog only calls slotClean, false if it will be deleted See also: setOnlyClean() Definition at line 123 of file progressbase.h.

void KIO::ProgressBase::finished | ( |  | ) |

| Call when the operation finished. Since: 3.1 Definition at line 144 of file progressbase.cpp. References slotClean().

void KIO::ProgressBase::slotStop | ( |  | ) | `[slot]`

| This method should be called for correct cancellation of IO operation Connect this to the progress widgets buttons etc. Definition at line 158 of file progressbase.cpp. References KIO::Job::kill(), and stopped(). Referenced by KIO::StatusbarProgress::StatusbarProgress().

void KIO::ProgressBase::slotClean | ( |  | ) | `[virtual, slot]`

| This method is called when the widget should be cleaned (after job is finished). redefine this for custom behavior. Reimplemented in KIO::StatusbarProgress. Definition at line 170 of file progressbase.cpp. References QWidget::hide(). Referenced by finished().

virtual void KIO::ProgressBase::slotTotalSize | ( | KIO::Job * | job,
|  | KIO::filesize_t | bytes
| ) | `[inline, virtual, slot]`

  | Called to set the total size. Parameters:
  | job | the KIO::Job
  | bytes | the total size in bytes
Reimplemented in KIO::StatusbarProgress. Definition at line 149 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotTotalFiles | ( | KIO::Job * | job,
|  | unsigned long | files
| ) | `[inline, virtual, slot]`

  | Called to set the total number of files. Parameters:
  | job | the KIO::Job
  | files | the number of files
Definition at line 156 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotTotalDirs | ( | KIO::Job * | job,
|  | unsigned long | dirs
| ) | `[inline, virtual, slot]`

  | Called to set the total number of directories. Parameters:
  | job | the KIO::Job
  | dirs | the number of directories
Definition at line 163 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotProcessedSize | ( | KIO::Job * | job,
|  | KIO::filesize_t | bytes
| ) | `[inline, virtual, slot]`

  | Called to set the processed size. Parameters:
  | job | the KIO::Job
  | bytes | the processed size in bytes
Definition at line 171 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotProcessedFiles | ( | KIO::Job * | job,
|  | unsigned long | files
| ) | `[inline, virtual, slot]`

  | Called to set the number of processed files. Parameters:
  | job | the KIO::Job
  | files | the number of files
Definition at line 178 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotProcessedDirs | ( | KIO::Job * | job,
|  | unsigned long | dirs
| ) | `[inline, virtual, slot]`

  | Called to set the number of processed directories. Parameters:
  | job | the KIO::Job
  | dirs | the number of directories
Definition at line 185 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotSpeed | ( | KIO::Job * | job,
|  | unsigned long | speed
| ) | `[inline, virtual, slot]`

  | Called to set the speed. Parameters:
  | job | the KIO::Job
  | speed | the speed in bytes/second
Reimplemented in KIO::StatusbarProgress. Definition at line 193 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotPercent | ( | KIO::Job * | job,
|  | unsigned long | percent
| ) | `[inline, virtual, slot]`

  | Called to set the percentage. Parameters:
  | job | the KIO::Job
  | percent | the percentage
Reimplemented in KIO::StatusbarProgress. Definition at line 201 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotCopying | ( | KIO::Job * | job,
|  | const KURL & | src,
|  | const KURL & | dest
| ) | `[inline, virtual, slot]`

  | Called when the job is copying. Parameters:
  | job | the KIO::Job
  | src | the source of the operation
  | dest | the destination of the operation
Definition at line 210 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotMoving | ( | KIO::Job * | job,
|  | const KURL & | src,
|  | const KURL & | dest
| ) | `[inline, virtual, slot]`

  | Called when the job is moving. Parameters:
  | job | the KIO::Job
  | src | the source of the operation
  | dest | the destination of the operation
Definition at line 218 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotDeleting | ( | KIO::Job * | job,
|  | const KURL & | url
| ) | `[inline, virtual, slot]`

  | Called when the job is deleting. Parameters:
  | job | the KIO::Job
  | url | the URL to delete
Definition at line 225 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotCreatingDir | ( | KIO::Job * | job,
|  | const KURL & | dir
| ) | `[inline, virtual, slot]`

  | Called when the job is creating a directory. Parameters:
  | job | the KIO::Job
  | dir | the URL of the directory to create
Definition at line 232 of file progressbase.h. Referenced by setJob().

virtual void KIO::ProgressBase::slotCanResume | ( | KIO::Job * | job,
|  | KIO::filesize_t | from
| ) | `[inline, virtual, slot]`

  | Called when the job is resuming.. Parameters:
  | job | the KIO::Job
  | from | the position to resume from in bytes
Definition at line 240 of file progressbase.h.

void KIO::ProgressBase::stopped | ( |  | ) | `[signal]`

| Called when the operation stopped. Referenced by slotStop().

The documentation for this class was generated from the following files:

- progressbase.h
- progressbase.cpp

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:26:55 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003