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.46 2004/10/10 11:30:06 bhards Exp $"
00028
00029
#include <qprogressbar.h>
00030
#include <kdialogbase.h>
00031
00046 class KDEUI_EXPORT KProgress :
public QProgressBar
00047 {
00048 Q_OBJECT
00049
00050
public:
00054 KProgress(
QWidget *parent=0,
const char *name=0, WFlags f = 0);
00055
00062 KProgress(
int totalSteps,
QWidget *parent=0,
const char *name=0, WFlags f = 0);
00063
00067 ~KProgress();
00068
00073
void setTextEnabled(
bool);
00074
00080
00081
int value()
const KDE_DEPRECATED;
00082
00089
bool textEnabled()
const;
00090
00095
QString format()
const;
00096
00101
00102
void setRange(
int min,
int max) KDE_DEPRECATED;
00103
00107
00108
int maxValue() KDE_DEPRECATED;
00109
00110
public slots:
00111
00124
void setFormat(
const QString & format);
00125
00130
void setTotalSteps(
int totalSteps);
00131
00135
virtual void setProgress(
int progress);
00136
00140
00141
void setValue(
int progress);
00142
00150
virtual void advance(
int offset);
00151
00152 signals:
00156
void percentageChanged(
int);
00157
00158
protected:
00159
virtual bool setIndicator(
QString & indicator,
int progress,
int totalSteps);
00160
00161
private:
00162
QString mFormat;
00163
00164
protected:
00165
virtual void virtual_hook(
int id,
void* data );
00166
private:
00167
class KProgressPrivate;
00168 KProgressPrivate *d;
00169 };
00170
00187 class KDEUI_EXPORT KProgressDialog :
public KDialogBase
00188 {
00189 Q_OBJECT
00190
00191
public:
00201 KProgressDialog(
QWidget* parent = 0,
const char* name = 0,
00202
const QString& caption = QString::null,
00203
const QString& text = QString::null,
00204
bool modal =
false);
00205
00209 ~KProgressDialog();
00210
00216 KProgress* progressBar();
00217
00223
const KProgress* progressBar()
const;
00224
00230
void setLabel(
const QString & text);
00231
00236
00237
QString labelText() KDE_DEPRECATED;
00238
00242
QString labelText()
const;
00243
00253
void setAllowCancel(
bool allowCancel);
00254
00259
00260
bool allowCancel() KDE_DEPRECATED;
00261
00265
bool allowCancel()
const;
00266
00273
void showCancelButton(
bool show);
00274
00279
void setAutoClose(
bool close);
00280
00285
00286
bool autoClose();
00287
00292
bool autoClose()
const;
00293
00299
void setAutoReset(
bool autoReset);
00300
00305
00306
bool autoReset();
00307
00312
bool autoReset()
const;
00313
00319
00320
bool wasCancelled();
00321
00327
bool wasCancelled()
const;
00328
00332
void setButtonText(
const QString&);
00333
00338
00339
QString buttonText() KDE_DEPRECATED;
00340
00344
QString buttonText()
const;
00345
00350
void setMinimumDuration(
int ms);
00351
00356
00357
int minimumDuration() KDE_DEPRECATED;
00358
00362
int minimumDuration()
const;
00363
00364
protected slots:
00365
void slotAutoShow();
00366
void slotAutoActions(
int percentage);
00367
void slotCancel();
00368
00369
private:
00370
00371
bool mAutoClose;
00372
bool mAutoReset;
00373
bool mCancelled;
00374
bool mAllowCancel;
00375
bool mShown;
00376
QString mCancelText;
00377
QLabel* mLabel;
00378 KProgress* mProgressBar;
00379
QTimer* mShowTimer;
00380
int mMinDuration;
00381
protected:
00382
virtual void virtual_hook(
int id,
void* data );
00383
private:
00384
struct KProgressDialogPrivate;
00385 KProgressDialogPrivate *d;
00386 };
00387
00388
#endif