Fix no newlines warnings. Patch by Peter Oberndorfer
[kdevelopdvcssupport.git] / shell / statusbar.h
blobaa4ffeea49759bf75c15d6a9935b333976b53599
1 /* This file is part of the KDE project
2 Copyright 2007 Hamish Rodda <rodda@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef KDEVSTATUSBAR_H
21 #define KDEVSTATUSBAR_H
23 #include <QTime>
24 #include <QMap>
26 #include <KStatusBar>
28 class QProgressBar;
29 class QSignalMapper;
30 class QTimer;
31 class QLabel;
33 namespace Sublime {
34 class View;
37 namespace KDevelop
40 class IStatus;
41 class IPlugin;
43 /**
44 * Status bar
46 class StatusBar : public KStatusBar
48 Q_OBJECT
50 public:
51 /**
52 * Constructs a status bar.
54 StatusBar(QWidget* parent);
56 void registerStatus(QObject* status);
58 void updateMessage();
60 void viewChanged(Sublime::View* view);
62 private Q_SLOTS:
63 void clearMessage();
64 void showMessage(const QString & message, int timeout);
65 void hideProgress();
66 void showProgress(int minimum, int maximum, int value);
67 void slotTimeout();
68 void viewStatusChanged(Sublime::View* view);
69 void showErrorMessage(const QString& message, int timeout);
71 void pluginLoaded(KDevelop::IPlugin*);
72 void removeError(QWidget*);
74 private:
75 QTimer* errorTimeout(QWidget* error, int timeout);
77 private:
78 struct Message {
79 QString text;
80 int timeout;
83 QMap<IStatus*, Message> m_messages;
84 QMap<IStatus*, QProgressBar*> m_progressBars;
85 QTimer* m_timer;
86 QTime m_time;
87 Sublime::View* m_currentView;
88 QSignalMapper* m_errorRemovalMapper;
93 #endif // KDEVSTATUSBAR_H