kprogress.h
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.31 2002/05/21 16:55:30 tjansen Exp $"
00028
00029 #include <qprogressbar.h>
00030 #include <kdialogbase.h>
00031
00046 class 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 int value() const;
00081
00088 bool textEnabled() const;
00089
00094 QString format() const;
00095
00100 void setRange(int min, int max);
00101
00105 int maxValue();
00106
00107 public slots:
00108
00117 void setFormat(const QString & format);
00118
00123 void setTotalSteps(int totalSteps);
00124
00129 virtual void setProgress(int progress);
00130
00134 void setValue(int progress);
00135
00143 virtual void advance(int offset);
00144
00145 signals:
00149 void percentageChanged(int);
00150
00151 protected:
00155 virtual bool setIndicator(QString & indicator, int progress, int totalSteps);
00156
00157 private:
00158 QString mFormat;
00159
00160 protected:
00161 virtual void virtual_hook( int id, void* data );
00162 private:
00163 class KProgressPrivate;
00164 KProgressPrivate *d;
00165 };
00166
00183 class KProgressDialog : public KDialogBase
00184 {
00185 Q_OBJECT
00186
00187 public:
00197 KProgressDialog(QWidget* parent = 0, const char* name = 0,
00198 const QString& caption = QString::null,
00199 const QString& text = QString::null,
00200 bool modal = false);
00201
00205 ~KProgressDialog();
00206
00212 KProgress* progressBar();
00213
00219 void setLabel(const QString&);
00220
00224 QString labelText();
00225
00235 void setAllowCancel(bool allowCancel);
00236
00240 bool allowCancel();
00241
00248 void showCancelButton(bool show);
00249
00254 void setAutoClose(bool close);
00255
00260 bool autoClose();
00261
00267 void setAutoReset(bool autoReset);
00268
00273 bool autoReset();
00274
00280 bool wasCancelled();
00281
00285 void setButtonText(const QString&);
00286
00290 QString buttonText();
00291
00296 void setMinimumDuration(int ms);
00297
00301 int minimumDuration();
00302
00303 protected slots:
00304 void slotAutoShow();
00305 void slotAutoActions(int percentage);
00306 void slotCancel();
00307
00308 private:
00309 bool mAutoClose;
00310 bool mAutoReset;
00311 bool mCancelled;
00312 bool mAllowCancel;
00313 bool mShown;
00314 QString mCancelText;
00315 QLabel* mLabel;
00316 KProgress* mProgressBar;
00317 QTimer* mShowTimer;
00318 int mMinDuration;
00319 protected:
00320 virtual void virtual_hook( int id, void* data );
00321 private:
00322 class KProgressDialogPrivate;
00323 KProgressDialogPrivate *d;
00324 };
00325
00326 #endif
This file is part of the documentation for kdelibs Version 3.1.0.