00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
#ifndef _KPROGRESS_H
00027
#define _KPROGRESS_H "$Id: kprogress.h,v 1.43 2003/09/07 12:58:25 coolo Exp $"
00028
00029
#include <qprogressbar.h>
00030
#include <kdialogbase.h>
00031
00048 class KProgress :
public QProgressBar
00049 {
00050 Q_OBJECT
00051
00052
public:
00056
KProgress(
QWidget *parent=0,
const char *name=0, WFlags f = 0);
00057
00064
KProgress(
int totalSteps,
QWidget *parent=0,
const char *name=0, WFlags f = 0);
00065
00069
~KProgress();
00070
00075
void setTextEnabled(
bool);
00076
00082
00083
int value()
const KDE_DEPRECATED;
00084
00091
bool textEnabled()
const;
00092
00097
QString format()
const;
00098
00103
00104
void setRange(
int min,
int max) KDE_DEPRECATED;
00105
00109
00110
int maxValue() KDE_DEPRECATED;
00111
00112
public slots:
00113
00126
void setFormat(
const QString &
format);
00127
00132
void setTotalSteps(
int totalSteps);
00133
00137
virtual void setProgress(
int progress);
00138
00142
00143
void setValue(
int progress);
00144
00152
virtual void advance(
int offset);
00153
00154 signals:
00158
void percentageChanged(
int);
00159
00160
protected:
00161
virtual bool setIndicator(
QString & indicator,
int progress,
int totalSteps);
00162
00163
private:
00164
QString mFormat;
00165
00166
protected:
00167
virtual void virtual_hook(
int id,
void* data );
00168
private:
00169
class KProgressPrivate;
00170 KProgressPrivate *d;
00171 };
00172
00189 class KProgressDialog :
public KDialogBase
00190 {
00191 Q_OBJECT
00192
00193
public:
00203
KProgressDialog(
QWidget* parent = 0,
const char* name = 0,
00204
const QString& caption = QString::null,
00205
const QString& text = QString::null,
00206
bool modal =
false);
00207
00211
~KProgressDialog();
00212
00218
KProgress*
progressBar();
00219
00225
const KProgress*
progressBar()
const;
00226
00232
void setLabel(
const QString & text);
00233
00238
00239
QString labelText() KDE_DEPRECATED;
00240
00244
QString labelText()
const;
00245
00255
void setAllowCancel(
bool allowCancel);
00256
00261
00262
bool allowCancel() KDE_DEPRECATED;
00263
00267
bool allowCancel()
const;
00268
00275
void showCancelButton(
bool show);
00276
00281
void setAutoClose(
bool close);
00282
00287
00288
bool autoClose();
00289
00294
bool autoClose()
const;
00295
00301
void setAutoReset(
bool autoReset);
00302
00307
00308
bool autoReset();
00309
00314
bool autoReset()
const;
00315
00321
00322
bool wasCancelled();
00323
00329
bool wasCancelled()
const;
00330
00334
void setButtonText(
const QString&);
00335
00340
00341
QString buttonText() KDE_DEPRECATED;
00342
00346
QString buttonText()
const;
00347
00352
void setMinimumDuration(
int ms);
00353
00358
00359
int minimumDuration() KDE_DEPRECATED;
00360
00364
int minimumDuration()
const;
00365
00366
protected slots:
00367
void slotAutoShow();
00368
void slotAutoActions(
int percentage);
00369
void slotCancel();
00370
00371
private:
00372
00373
bool mAutoClose;
00374
bool mAutoReset;
00375
bool mCancelled;
00376
bool mAllowCancel;
00377
bool mShown;
00378
QString mCancelText;
00379
QLabel* mLabel;
00380
KProgress* mProgressBar;
00381
QTimer* mShowTimer;
00382
int mMinDuration;
00383
protected:
00384
virtual void virtual_hook(
int id,
void* data );
00385
private:
00386
class KProgressDialogPrivate;
00387 KProgressDialogPrivate *d;
00388 };
00389
00390
#endif