SVN_SILENT made messages (after extraction)
[kdepim.git] / kalarm / traywindow.h
blob599888a2148df32819950be23f025e9e03d5f888
1 /*
2 * traywindow.h - the KDE system tray applet
3 * Program: kalarm
4 * Copyright © 2002-2012 by David Jarvie <djarvie@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef TRAYWINDOW_H
22 #define TRAYWINDOW_H
24 #include "editdlg.h"
26 #include <kalarmcal/kaevent.h>
28 #include <kstatusnotifieritem.h>
29 #include <QIcon>
31 class QTimer;
32 class KToggleAction;
33 class MainWindow;
34 class NewAlarmAction;
35 class AlarmListModel;
37 using namespace KAlarmCal;
39 class TrayWindow : public KStatusNotifierItem
41 Q_OBJECT
42 public:
43 explicit TrayWindow(MainWindow* parent);
44 ~TrayWindow();
45 void removeWindow(MainWindow*);
46 MainWindow* assocMainWindow() const { return mAssocMainWindow; }
47 void setAssocMainWindow(MainWindow* win) { mAssocMainWindow = win; }
49 Q_SIGNALS:
50 void deleted();
52 private Q_SLOTS:
53 void slotActivateRequested();
54 void slotSecondaryActivateRequested();
55 void slotNewAlarm(EditAlarmDlg::Type);
56 void slotNewFromTemplate(const KAEvent*);
57 void slotPreferences();
58 void setEnabledStatus(bool status);
59 void slotHaveDisabledAlarms(bool disabled);
60 void slotQuit();
61 void slotQuitAfter();
62 void updateStatus();
63 void updateToolTip();
65 private:
66 QString tooltipAlarmText() const;
67 void updateIcon();
69 MainWindow* mAssocMainWindow; // main window associated with this, or null
70 QIcon mIconDisabled;
71 KToggleAction* mActionEnabled;
72 NewAlarmAction* mActionNew;
73 mutable AlarmListModel* mAlarmsModel; // active alarms sorted in time order
74 QTimer* mStatusUpdateTimer;
75 QTimer* mToolTipUpdateTimer;
76 bool mHaveDisabledAlarms; // some individually disabled alarms exist
79 #endif // TRAYWINDOW_H
81 // vim: et sw=4: