KoUpdater Class Reference

An KoUpdater is a helper for keeping the progress of each subtask up to speed. More...

#include <KoProgressUpdater.h>

Inheritance diagram for KoUpdater:

KoProgressProxy List of all members.

Public Member Functions

 KoUpdater (const KoUpdater &other)
 copy constructor.
void cancel ()
 Call this when this subtask wants to abort all the actions.
void setProgress (int percent)
 Update your progress.
bool interrupted () const
 return true when this task should stop processing immediately.
int progress () const
 return the progress this subtask has made.
int maximum () const
void setValue (int value)
void setRange (int minimum, int maximum)
void setFormat (const QString &format)

Public Attributes

QPointer< KoProgressUpdaterPrivate > d
int range
int min
int max

Protected Member Functions

 KoUpdater (KoProgressUpdaterPrivate *p)

Friends

class KoProgressUpdater

Detailed Description

An KoUpdater is a helper for keeping the progress of each subtask up to speed.

This class is not thread safe, and it should only be used from one thread. The thread it is used in can be different from any other subtask or the KoProgressUpdater, though.

It is possible to create a KoProgressUpdater on a KoUpdater for when you need to recursively split up progress reporting. (For instance, when your progress reporting routine can be called by other progress reporting routines.)

KoUpdater implements KoProgressProxy because it is possible to recursively create anoter KoProgressUpdater with an updater as progress proxy.

See also:
KoProgressUpdater::startSubtask()


Member Function Documentation

bool KoUpdater::interrupted (  )  const

return true when this task should stop processing immediately.

When the task has been cancelled all the subtasks will get interrupted and should stop working. It is therefor important to have repeated calls to this method at regular (time) intervals and as soon as the method returns true cancel the subtask.

Returns:
true when this task should stop processing immediately.

void KoUpdater::setProgress ( int  percent  ) 

Update your progress.

Progress is always from 0 to 100. The global progress shown to the user is determined by the total amount of subtasks there are. This means that each subtasks can just report its own private progress in the range from 0 to 100.


The documentation for this class was generated from the following files:
Generated on Sun Jul 20 22:37:42 2008 for libs by  doxygen 1.4.7