libtdepim

statusbarprogresswidget.h
00001 #ifndef __KPIM_STATUSBARPROGRESSWIDGET_H
00002 #define __KPIM_STATUSBARPROGRESSWIDGET_H
00003 /*
00004   statusbarprogresswidget.h
00005 
00006   This file is part of KMail, the KDE mail client.
00007 
00008   (C) 2004 KMail Authors
00009 
00010   KMail is free software; you can redistribute it and/or modify it
00011   under the terms of the GNU General Public License, version 2, as
00012   published by the Free Software Foundation.
00013 
00014   KMail is distributed in the hope that it will be useful, but
00015   WITHOUT ANY WARRANTY; without even the implied warranty of
00016   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017   General Public License for more details.
00018 
00019   You should have received a copy of the GNU General Public License
00020   along with this program; if not, write to the Free Software
00021   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023   In addition, as a special exception, the copyright holders give
00024   permission to link the code of this program with any edition of
00025   the TQt library by Trolltech AS, Norway (or with modified versions
00026   of TQt that use the same license as TQt), and distribute linked
00027   combinations including the two.  You must obey the GNU General
00028   Public License in all respects for all of the code used other than
00029   TQt.  If you modify this file, you may extend this exception to
00030   your version of the file, but you are not obligated to do so.  If
00031   you do not wish to do so, delete this exception statement from
00032   your version.
00033 */
00039 #include <tdepimmacros.h>
00040 
00041 class KMMainWidget;
00042 class KProgress;
00043 class TQPushButton;
00044 class TQWidgetStack;
00045 class TQBoxLayout;
00046 class TQLabel;
00047 class TQTimer;
00048 
00049 namespace KPIM {
00050 class SSLLabel;
00051 class ProgressItem;
00052 class ProgressDialog;
00053 
00054 class KDE_EXPORT StatusbarProgressWidget : public TQFrame {
00055 
00056   Q_OBJECT
00057   
00058 
00059 public:
00060 
00061   StatusbarProgressWidget( ProgressDialog* progressDialog, TQWidget* parent, bool button = true );
00062 
00063 public slots:
00064 
00065   void slotClean();
00066   void slotSetSSL( bool );
00067 
00068   void slotProgressItemAdded( KPIM::ProgressItem *i );
00069   void slotProgressItemCompleted( KPIM::ProgressItem *i );
00070   void slotProgressItemProgress( KPIM::ProgressItem *i, unsigned int value );
00071 
00072 protected slots:
00073   void slotProgressDialogVisible( bool );
00074   void slotShowItemDelayed();
00075   void slotBusyIndicator();
00076   void updateBusyMode();
00077 
00078 protected:
00079   void setMode();
00080   void connectSingleItem();
00081   void activateSingleItemMode();
00082 
00083   virtual bool eventFilter( TQObject *, TQEvent * );
00084 
00085 private:
00086   KProgress* m_pProgressBar;
00087   TQLabel* m_pLabel;
00088   SSLLabel* m_sslLabel;
00089   TQPushButton* m_pButton;
00090 
00091   enum Mode { None, /*Label,*/ Progress };
00092 
00093   uint mode;
00094   bool m_bShowButton;
00095 
00096   TQBoxLayout *box;
00097   TQWidgetStack *stack;
00098   ProgressItem *mCurrentItem;
00099   ProgressDialog* mProgressDialog;
00100   TQTimer *mDelayTimer;
00101   TQTimer *mBusyTimer;
00102 };
00103 
00104 } // namespace
00105 
00106 #endif