Don't offer to restart a Running (=busy) agent, it won't work.
[kdepim.git] / libkdepim / statusbarprogresswidget.h
blobc1a40d6554382977057a48bf96589781cae49bdc
1 #ifndef KDEPIM_STATUSBARPROGRESSWIDGET_H
2 #define KDEPIM_STATUSBARPROGRESSWIDGET_H
3 /*
4 statusbarprogresswidget.h
6 (C) 2004 Till Adam <adam@kde.org>
7 Don Sanders
8 David Faure <dfaure@kde.org>
9 Copyright 2004 David Faure <faure@kde.org>
11 KMail is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License, version 2
13 or above, as published by the Free Software Foundation.
15 KMail is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 In addition, as a special exception, the copyright holders give
25 permission to link the code of this program with any edition of
26 the Qt library by Trolltech AS, Norway (or with modified versions
27 of Qt that use the same license as Qt), and distribute linked
28 combinations including the two. You must obey the GNU General
29 Public License in all respects for all of the code used other than
30 Qt. If you modify this file, you may extend this exception to
31 your version of the file, but you are not obligated to do so. If
32 you do not wish to do so, delete this exception statement from
33 your version.
35 /**
36 * A specialized progress widget class, heavily based on
37 * kio_littleprogress_dlg (it looks similar)
40 #include "kdepim_export.h"
42 #include <QFrame>
44 class QBoxLayout;
45 class QEvent;
46 class QProgressBar;
47 class QPushButton;
48 class QStackedWidget;
49 class QBoxLayout;
50 class QLabel;
51 class QTimer;
53 namespace KPIM {
54 class SSLLabel;
55 class ProgressItem;
56 class ProgressDialog;
58 class KDEPIM_EXPORT StatusbarProgressWidget : public QFrame {
60 Q_OBJECT
62 public:
64 StatusbarProgressWidget( ProgressDialog* progressDialog, QWidget* parent, bool button = true );
66 public Q_SLOTS:
68 void slotClean();
69 void slotSetSSL( bool );
71 void slotProgressItemAdded( KPIM::ProgressItem *i );
72 void slotProgressItemCompleted( KPIM::ProgressItem *i );
73 void slotProgressItemProgress( KPIM::ProgressItem *i, unsigned int value );
75 protected Q_SLOTS:
76 void slotProgressDialogVisible( bool );
77 void slotShowItemDelayed();
78 void slotBusyIndicator();
79 void updateBusyMode();
81 protected:
82 void setMode();
83 void connectSingleItem();
84 void activateSingleItemMode();
86 virtual bool eventFilter( QObject *, QEvent * );
88 private:
89 QProgressBar* m_pProgressBar;
90 QLabel* m_pLabel;
91 SSLLabel* m_sslLabel;
92 QPushButton* m_pButton;
94 enum Mode { None, /*Label,*/ Progress };
96 uint mode;
97 bool m_bShowButton;
99 QBoxLayout *box;
100 QStackedWidget *stack;
101 ProgressItem *mCurrentItem;
102 ProgressDialog* mProgressDialog;
103 QTimer *mDelayTimer;
104 QTimer *mBusyTimer;
105 QTimer *mCleanTimer;
108 } // namespace
110 #endif