Astyle kdelibs
[kdepim.git] / kmail / widgets / vacationscriptindicatorwidget.h
blob6473385cdefae920d72e76fdb176483db50577f0
1 /*
2 Copyright (c) 2013, 2014 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef VACATIONSCRIPTINDICATORWIDGET_H
19 #define VACATIONSCRIPTINDICATORWIDGET_H
21 #include <QLabel>
22 class QHBoxLayout;
23 class QLabel;
24 namespace KMail
27 class ServerLabel : public QLabel
29 Q_OBJECT
30 public:
31 explicit ServerLabel(const QString &toolTip, QWidget *parent = 0);
32 ~ServerLabel();
34 Q_SIGNALS:
35 void clicked(const QString &serverName);
37 protected:
38 void mouseReleaseEvent(QMouseEvent *event);
40 private:
41 QString mServerName;
44 class VacationLabel : public QLabel
46 Q_OBJECT
47 public:
48 explicit VacationLabel(const QString &text, QWidget *parent = 0);
49 ~VacationLabel();
51 Q_SIGNALS:
52 void clicked();
54 protected:
55 void mouseReleaseEvent(QMouseEvent *event);
58 class VacationScriptIndicatorWidget : public QWidget
60 Q_OBJECT
61 public:
62 explicit VacationScriptIndicatorWidget(QWidget *parent = 0);
63 ~VacationScriptIndicatorWidget();
65 void setVacationScriptActive(bool active, const QString &serverName);
67 void updateIndicator();
69 bool hasVacationScriptActive() const;
71 Q_SIGNALS:
72 void clicked(const QString &serverName = QString());
74 private:
75 void createIndicator();
76 QStringList mServerActive;
77 QHBoxLayout *mBoxLayout;
78 VacationLabel *mInfo;
82 #endif // VACATIONSCRIPTINDICATORWIDGET_H