Eneboo - Documentación para desarrolladores
src/qt/src/dialogs/qprogressdialog.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/qprogressdialog.h   3.3.8   edited Jan 11 14:37 $
00003 **
00004 ** Definition of QProgressDialog class
00005 **
00006 ** Created : 970520
00007 **
00008 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00009 **
00010 ** This file is part of the dialogs module of the Qt GUI Toolkit.
00011 **
00012 ** This file may be distributed under the terms of the Q Public License
00013 ** as defined by Trolltech ASA of Norway and appearing in the file
00014 ** LICENSE.QPL included in the packaging of this file.
00015 **
00016 ** This file may be distributed and/or modified under the terms of the
00017 ** GNU General Public License version 2 as published by the Free Software
00018 ** Foundation and appearing in the file LICENSE.GPL included in the
00019 ** packaging of this file.
00020 **
00021 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00022 ** licenses may use this file in accordance with the Qt Commercial License
00023 ** Agreement provided with the Software.
00024 **
00025 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00026 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00027 **
00028 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00029 **   information about Qt Commercial License Agreements.
00030 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00031 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00032 **
00033 ** Contact info@trolltech.com if any conditions of this licensing are
00034 ** not clear to you.
00035 **
00036 **********************************************************************/
00037 
00038 #ifndef QPROGRESSDIALOG_H
00039 #define QPROGRESSDIALOG_H
00040 
00041 #ifndef QT_H
00042 #include "qsemimodal.h"
00043 #include "qlabel.h"       // ### remove or keep for users' convenience?
00044 #include "qprogressbar.h" // ### remove or keep for users' convenience?
00045 #endif // QT_H
00046 
00047 #ifndef QT_NO_PROGRESSDIALOG
00048 
00049 class QPushButton;
00050 class QTimer;
00051 class QProgressDialogData;
00052 
00053 class Q_EXPORT QProgressDialog : public QDialog
00054 {
00055     Q_OBJECT
00056     Q_PROPERTY( bool wasCancelled READ wasCancelled DESIGNABLE false STORED false ) // ### remove in 4.0
00057     Q_PROPERTY( bool wasCanceled READ wasCanceled )
00058     Q_PROPERTY( int totalSteps READ totalSteps WRITE setTotalSteps )
00059     Q_PROPERTY( int progress READ progress WRITE setProgress )
00060     Q_PROPERTY( bool autoReset READ autoReset WRITE setAutoReset )
00061     Q_PROPERTY( bool autoClose READ autoClose WRITE setAutoClose )
00062     Q_PROPERTY( int minimumDuration READ minimumDuration WRITE setMinimumDuration )
00063     Q_PROPERTY( QString labelText READ labelText WRITE setLabelText )
00064 
00065 public:
00066     QProgressDialog( QWidget* parent=0, const char* name=0, bool modal=FALSE,
00067                      WFlags f=0 );
00068     QProgressDialog( const QString& labelText, const QString &cancelButtonText,
00069                      int totalSteps, QWidget* parent=0, const char* name=0,
00070                      bool modal=FALSE, WFlags f=0 );
00071     ~QProgressDialog();
00072 
00073     void        setLabel( QLabel * );
00074     void        setCancelButton( QPushButton * );
00075     void        setBar( QProgressBar * );
00076 
00077     // ### Qt 4.0: remove wasCancelled() in 4.0
00078     bool        wasCancelled() const;
00079     inline bool wasCanceled() const { return wasCancelled(); }
00080 
00081     int         totalSteps() const;
00082     int         progress()   const;
00083 
00084     QSize       sizeHint() const;
00085 
00086     QString     labelText() const;
00087 
00088     void setAutoReset( bool b );
00089     bool autoReset() const;
00090     void setAutoClose( bool b );
00091     bool autoClose() const;
00092 
00093 public slots:
00094     void        cancel();
00095     void        reset();
00096     void        setTotalSteps( int totalSteps );
00097     void        setProgress( int progress );
00098     void        setProgress( int progress, int totalSteps );
00099     void        setLabelText( const QString &);
00100     void        setCancelButtonText( const QString &);
00101 
00102     void        setMinimumDuration( int ms );
00103 public:
00104     int         minimumDuration() const;
00105 
00106 signals:
00107     // ### remove cancelled() in 4.0
00108     void        cancelled();
00109     void        canceled();
00110 
00111 protected:
00112     void        resizeEvent( QResizeEvent * );
00113     void        closeEvent( QCloseEvent * );
00114     void        styleChange( QStyle& );
00115     void        showEvent( QShowEvent *e );
00116 
00117 protected slots:
00118     void        forceShow();
00119 
00120 private:
00121     void           init( QWidget *creator, const QString& lbl, const QString &canc,
00122                          int totstps);
00123     void           layout();
00124     QLabel        *label()  const;
00125     QProgressBar  *bar()    const;
00126     QProgressDialogData *d;
00127     QTimer        *forceTimer;
00128 
00129 private:        // Disabled copy constructor and operator=
00130 #if defined(Q_DISABLE_COPY)
00131     QProgressDialog( const QProgressDialog & );
00132     QProgressDialog &operator=( const QProgressDialog & );
00133 #endif
00134 };
00135 
00136 #endif // QT_NO_PROGRESSDIALOG
00137 
00138 #endif // QPROGRESSDIALOG_H
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'