Updated the Tools menu to reflect current build.
[kdepim.git] / kalarm / traywindow.h
blob7f6edea41e553eccad4b292d9a1befb89a4250aa
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 QEvent;
32 class QDragEnterEvent;
33 class QDropEvent;
34 class QTimer;
35 class KAction;
36 class KToggleAction;
37 class MainWindow;
38 class NewAlarmAction;
39 #ifdef USE_AKONADI
40 class AlarmListModel;
41 #endif
43 using namespace KAlarmCal;
45 class TrayWindow : public KStatusNotifierItem
47 Q_OBJECT
48 public:
49 explicit TrayWindow(MainWindow* parent);
50 ~TrayWindow();
51 void removeWindow(MainWindow*);
52 MainWindow* assocMainWindow() const { return mAssocMainWindow; }
53 void setAssocMainWindow(MainWindow* win) { mAssocMainWindow = win; }
55 signals:
56 void deleted();
58 private slots:
59 void slotActivateRequested();
60 void slotSecondaryActivateRequested();
61 void slotNewAlarm(EditAlarmDlg::Type);
62 void slotNewFromTemplate(const KAEvent*);
63 void slotPreferences();
64 void setEnabledStatus(bool status);
65 void slotHaveDisabledAlarms(bool disabled);
66 void slotQuit();
67 void slotQuitAfter();
68 void updateStatus();
69 void updateToolTip();
71 private:
72 QString tooltipAlarmText() const;
73 void updateIcon();
75 MainWindow* mAssocMainWindow; // main window associated with this, or null
76 QIcon mIconDisabled;
77 KToggleAction* mActionEnabled;
78 NewAlarmAction* mActionNew;
79 #ifdef USE_AKONADI
80 mutable AlarmListModel* mAlarmsModel; // active alarms sorted in time order
81 #endif
82 QTimer* mStatusUpdateTimer;
83 QTimer* mToolTipUpdateTimer;
84 bool mHaveDisabledAlarms; // some individually disabled alarms exist
87 #endif // TRAYWINDOW_H
89 // vim: et sw=4: