1 /* This file is part of the KDE project
3 Copyright (C) 2005-2006 Tom Albers <tomalbers@kde.nl>
5 The base was copied from ksynaptics:
6 Copyright (C) 2004 Nadeem Hasan <nhasan@kde.org>
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 #include <qsystemtrayicon.h>
30 #include <QMouseEvent>
41 * This class is responsible for putting rsibreak in the system tray
42 * and provide a proper menu when right clicked on the icon.
44 * Originally this file was copied from KSynaptics
45 * @author Nadeem Hasan <nhasan@kde.org>
46 * @author Tom Albers <tomalbers@kde.nl>
48 class RSIDock
: public QSystemTrayIcon
55 * @param parent Parent Widget
58 RSIDock( QWidget
*parent
);
67 * This signal is emitted when the user has left
69 * @param restart Defines whether the timer should
70 * immediately restarted. This should not happen
71 * when RSIBreak is suspended.
73 void configChanged( bool restart
);
76 * This signal is emitted when the user enters a dialog
77 * this can be an about X screen or the settings.
82 * This signal is emitted when the user leaves one of the
83 * about X dialogs, it will not beemitted when the settings
84 * dialog is left, the configChanged() is emitted.
89 * This signal is emitted when the user wishes to take the break
90 * at this moment, either via the shortcut or the menu (lmb)
95 * This signal is emitted when the user wishes to see all
96 * debug timing info. Needs a --enable-debug comiled RSIBreak
101 * Suspend RSIBreak on user's request.
103 void suspend( bool );
112 * Reimplemented because we do not want an action on left click
114 void mousePressEvent( QMouseEvent
*e
);
117 * Reimplemented to catch the tooltip event.
119 virtual bool event( QEvent
* event
);
122 void slotActivated( QSystemTrayIcon::ActivationReason
);
123 void slotConfigure();
124 void slotConfigureNotifications();
126 void slotBreakRequest();
127 void slotDebugRequest();
128 void slotShowStatistics();
129 void slotResetStats();
135 QAction
* m_suspendItem
;
138 KDialog
*m_statsDialog
;
139 RSIStatWidget
*m_statsWidget
;