kdeui Library API Documentation

kprogress.h

00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1996 Martynas Kunigelis 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00016 Boston, MA 02111-1307, USA. 00017 */ 00018 /***************************************************************************** 00019 * * 00020 * KProgress -- progress indicator widget for KDE * 00021 * Original QRangeControl-based version written by Martynas Kunigelis * 00022 * Current QProgressBar based version by Aaron Seigo * 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 // ### Remove this KDE 4.0 00083 int value() const KDE_DEPRECATED; 00084 00091 bool textEnabled() const; 00092 00097 QString format() const; 00098 00103 // ### Remove this KDE 4.0 00104 void setRange(int min, int max) KDE_DEPRECATED; 00105 00109 // ### Remove this KDE 4.0 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 // ### Remove this KDE 4.0 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 // ### Remove this KDE 4.0 00239 QString labelText() KDE_DEPRECATED; 00240 00244 QString labelText() const; 00245 00255 void setAllowCancel(bool allowCancel); 00256 00261 // ### Remove this KDE 4.0 00262 bool allowCancel() KDE_DEPRECATED; 00263 00267 bool allowCancel() const; 00268 00275 void showCancelButton(bool show); 00276 00281 void setAutoClose(bool close); 00282 00287 // ### Remove this KDE 4.0 00288 bool autoClose(); 00289 00294 bool autoClose() const; 00295 00301 void setAutoReset(bool autoReset); 00302 00307 // ### Remove this KDE 4.0 00308 bool autoReset(); 00309 00314 bool autoReset() const; 00315 00321 // ### Remove this KDE 4.0 00322 bool wasCancelled(); 00323 00329 bool wasCancelled() const; 00330 00334 void setButtonText(const QString&); 00335 00340 // ### Remove this KDE 4.0 00341 QString buttonText() KDE_DEPRECATED; 00342 00346 QString buttonText() const; 00347 00352 void setMinimumDuration(int ms); 00353 00358 // ### Remove this KDE 4.0 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 // ### Move these member variables to d in KDE 4.0 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
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 10 18:55:09 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003