one entry for korganizer in khelpcenters navigation tree is enough
[kdepim.git] / libkdepim / progressdialog.h
blob2aa5501c031d0e8285dacdb992be32d88f1c6bf8
1 /* -*- c++ -*-
2 * progressdialog.h
4 * Copyright (c) 2004 Till Adam <adam@kde.org>
5 * based on imapprogressdialog.cpp ,which is
6 * Copyright (c) 2002-2003 Klar�vdalens Datakonsult AB
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * In addition, as a special exception, the copyright holders give
22 * permission to link the code of this program with any edition of
23 * the Qt library by Trolltech AS, Norway (or with modified versions
24 * of Qt that use the same license as Qt), and distribute linked
25 * combinations including the two. You must obey the GNU General
26 * Public License in all respects for all of the code used other than
27 * Qt. If you modify this file, you may extend this exception to
28 * your version of the file, but you are not obligated to do so. If
29 * you do not wish to do so, delete this exception statement from
30 * your version.
33 #ifndef KDEPIM_PROGRESSDIALOG_H
34 #define KDEPIM_PROGRESSDIALOG_H
36 #include "overlaywidget.h"
37 #include "kdepim_export.h"
39 #include <QScrollArea>
40 #include <QMap>
41 #include <KVBox>
43 class QProgressBar;
44 class QFrame;
45 class QLabel;
46 class QPushButton;
48 namespace KPIM {
49 class ProgressItem;
50 class TransactionItem;
51 class SSLLabel;
53 class TransactionItemView : public QScrollArea
55 Q_OBJECT
56 public:
57 explicit TransactionItemView( QWidget * parent = 0, const char * name = 0 );
59 virtual ~TransactionItemView() {}
60 TransactionItem *addTransactionItem( ProgressItem *item, bool first );
62 QSize sizeHint() const;
63 QSize minimumSizeHint() const;
65 public Q_SLOTS:
66 void slotLayoutFirstItem();
68 protected:
69 virtual void resizeEvent ( QResizeEvent *event );
71 private:
72 KVBox *mBigBox;
75 class TransactionItem : public KVBox
77 Q_OBJECT
78 public:
79 TransactionItem( QWidget *parent, ProgressItem *item, bool first );
81 ~TransactionItem();
83 void hideHLine();
85 void setProgress( int progress );
86 void setLabel( const QString & );
88 // the given text is interpreted as RichText, so you might need to
89 // Qt::escape() it before passing
90 void setStatus( const QString & );
92 void setCrypto( bool );
93 void setTotalSteps( int totalSteps );
95 ProgressItem *item() const { return mItem; }
97 void addSubTransaction( ProgressItem *item );
99 // The progressitem is deleted immediately, we take 5s to go out,
100 // so better not use mItem during this time.
101 void setItemComplete() { mItem = 0; }
103 public Q_SLOTS:
104 void slotItemCanceled();
106 protected:
107 QProgressBar *mProgress;
108 QPushButton *mCancelButton;
109 QLabel *mItemLabel;
110 QLabel *mItemStatus;
111 QFrame *mFrame;
112 SSLLabel *mSSLLabel;
113 ProgressItem *mItem;
116 class KDEPIM_EXPORT ProgressDialog : public OverlayWidget
118 Q_OBJECT
119 public:
120 ProgressDialog( QWidget *alignWidget, QWidget *parent, const char *name = 0 );
121 ~ProgressDialog();
122 void setVisible( bool b );
124 public Q_SLOTS:
125 void slotToggleVisibility();
127 protected Q_SLOTS:
128 void slotTransactionAdded( KPIM::ProgressItem *item );
129 void slotTransactionCompleted( KPIM::ProgressItem *item );
130 void slotTransactionCanceled( KPIM::ProgressItem *item );
131 void slotTransactionProgress( KPIM::ProgressItem *item, unsigned int progress );
132 void slotTransactionStatus( KPIM::ProgressItem *item, const QString & );
133 void slotTransactionLabel( KPIM::ProgressItem *item, const QString & );
134 void slotTransactionUsesCrypto( KPIM::ProgressItem *item, bool );
135 void slotTransactionUsesBusyIndicator( KPIM::ProgressItem *, bool );
137 void slotClose();
138 void slotShow();
139 void slotHide();
141 Q_SIGNALS:
142 void visibilityChanged( bool );
144 protected:
145 virtual void closeEvent( QCloseEvent * );
147 TransactionItemView *mScrollView;
148 TransactionItem *mPreviousItem;
149 QMap<const ProgressItem *, TransactionItem *> mTransactionsToListviewItems;
150 bool mWasLastShown;
153 } // namespace KPIM
155 #endif // __KPIM_PROGRESSDIALOG_H__