| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# 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 353331 2004-10-10 11:30:06Z bhards $"
    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   // ### Remove this KDE 4.0
    00081   int value() const KDE_DEPRECATED;
    00082
    00089   bool textEnabled() const;
    00090
    00095   QString format() const;
    00096
    00101   // ### Remove this KDE 4.0
    00102   void setRange(int min, int max) KDE_DEPRECATED;
    00103
    00107   // ### Remove this KDE 4.0
    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   // ### Remove this KDE 4.0
    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         // ### Remove this KDE 4.0
    00237         QString labelText() KDE_DEPRECATED;
    00238
    00242         QString labelText() const;
    00243
    00253         void setAllowCancel(bool allowCancel);
    00254
    00259         // ### Remove this KDE 4.0
    00260         bool allowCancel() KDE_DEPRECATED;
    00261
    00265         bool allowCancel() const;
    00266
    00273         void showCancelButton(bool show);
    00274
    00279         void setAutoClose(bool close);
    00280
    00285         // ### Remove this KDE 4.0
    00286         bool autoClose();
    00287
    00292         bool autoClose() const;
    00293
    00299         void setAutoReset(bool autoReset);
    00300
    00305         // ### Remove this KDE 4.0
    00306         bool autoReset();
    00307
    00312         bool autoReset() const;
    00313
    00319         // ### Remove this KDE 4.0
    00320         bool wasCancelled();
    00321
    00327         bool wasCancelled() const;
    00328
    00332         void setButtonText(const QString&);
    00333
    00338         // ### Remove this KDE 4.0
    00339         QString buttonText() KDE_DEPRECATED;
    00340
    00344         QString buttonText() const;
    00345
    00350         void setMinimumDuration(int ms);
    00351
    00356         // ### Remove this KDE 4.0
    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         // ### Move these member variables to d in KDE 4.0
    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

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:20:21 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003