kprogress.h
/* This file is part of the KDE libraries
Copyright (C) 1996 Martynas Kunigelis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
/*****************************************************************************
* *
* KProgress -- progress indicator widget for KDE *
* Original QRangeControl-based version written by Martynas Kunigelis *
* Current QProgressBar based version by Aaron Seigo *
* *
*****************************************************************************/
#ifndef _KPROGRESS_H
#define _KPROGRESS_H "$Id: kprogress.h 589356 2006-09-28 00:58:09Z jbaptiste $"
#include <qprogressbar.h>
#include <kdialogbase.h>
class KDEUI_EXPORT KProgress : public QProgressBar
{
Q_OBJECT
public:
KProgress(QWidget *parent=0, const char *name=0, WFlags f = 0);
KProgress(int totalSteps, QWidget *parent=0, const char *name=0, WFlags f = 0);
~KProgress();
void setTextEnabled(bool);
// ### Remove this KDE 4.0
int value() const KDE_DEPRECATED;
bool textEnabled() const;
QString format() const;
// ### Remove this KDE 4.0
void setRange(int min, int max) KDE_DEPRECATED;
// ### Remove this KDE 4.0
int maxValue() KDE_DEPRECATED;
public slots:
void setFormat(const QString & format);
void setTotalSteps(int totalSteps);
virtual void setProgress(int progress);
// ### Remove this KDE 4.0
void setValue(int progress);
virtual void advance(int offset);
signals:
void percentageChanged(int);
protected:
virtual bool setIndicator(QString & indicator, int progress, int totalSteps);
private:
QString mFormat;
protected:
virtual void virtual_hook( int id, void* data );
private:
class KProgressPrivate;
KProgressPrivate *d;
};
class KDEUI_EXPORT KProgressDialog : public KDialogBase
{
Q_OBJECT
public:
KProgressDialog(QWidget* parent = 0, const char* name = 0,
const QString& caption = QString::null,
const QString& text = QString::null,
bool modal = false);
~KProgressDialog();
KProgress* progressBar();
const KProgress* progressBar() const;
void setLabel(const QString & text);
// ### Remove this KDE 4.0
QString labelText() KDE_DEPRECATED;
QString labelText() const;
void setAllowCancel(bool allowCancel);
// ### Remove this KDE 4.0
bool allowCancel() KDE_DEPRECATED;
bool allowCancel() const;
void showCancelButton(bool show);
void setAutoClose(bool close);
// ### Remove this KDE 4.0
bool autoClose();
bool autoClose() const;
void setAutoReset(bool autoReset);
// ### Remove this KDE 4.0
bool autoReset();
bool autoReset() const;
// ### Remove this KDE 4.0
bool wasCancelled();
bool wasCancelled() const;
void ignoreCancel();
void setButtonText(const QString&);
// ### Remove this KDE 4.0
QString buttonText() KDE_DEPRECATED;
QString buttonText() const;
void setMinimumDuration(int ms);
// ### Remove this KDE 4.0
int minimumDuration() KDE_DEPRECATED;
int minimumDuration() const;
virtual void show();
protected slots:
void slotAutoShow();
void slotAutoActions(int percentage);
void slotCancel();
private:
// ### Move these member variables to d in KDE 4.0
bool mAutoClose;
bool mAutoReset;
bool mCancelled;
bool mAllowCancel;
bool mShown;
QString mCancelText;
QLabel* mLabel;
KProgress* mProgressBar;
QTimer* mShowTimer;
int mMinDuration;
protected:
virtual void virtual_hook( int id, void* data );
private:
struct KProgressDialogPrivate;
KProgressDialogPrivate *d;
};
#endif
KProgress
A progress indicator widget.
Definition: kprogress.h:46
KDialogBase::setButtonText
void setButtonText(ButtonCode id, const QString &text)
Sets the text of any button.
Definition: kdialogbase.cpp:986
KDialogBase
A dialog base class with standard buttons and predefined layouts.
Definition: kdialogbase.h:191
KDialogBase::slotCancel
virtual void slotCancel()
Activated when the Cancel button has been clicked.
Definition: kdialogbase.cpp:1215
KProgressDialog
KProgressDialog provides a dialog with a text label, a progress bar and an optional cancel button wit...
Definition: kprogress.h:187

KDE Home | KDE Accessibility Home | Description of Access Keys