1 /***************************************************************************
2 * Copyright (C) 2003 by S�astien Laot *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include <KSystemTrayIcon>
26 #include <QMouseEvent>
28 #include <QDragMoveEvent>
29 #include <QDragLeaveEvent>
30 #include <QWheelEvent>
32 #include <QDragEnterEvent>
37 /** Convenient class to develop the displayCloseMessage() dialog
38 * hopefuly integrated in KDE 3.4
39 * @author S�astien Laot
41 class KSystemTray2
: public KSystemTrayIcon
45 KSystemTray2(QWidget
*parent
= 0, const char *name
= 0);
48 * Call this method when the user clicked the close button of the window
49 * (the [x]) to inform him that the application sit in the system tray
50 * and willn't be closed (as he is used to).
52 * You usualy call it from reimplemented KMainWindow::queryClose()
56 void displayCloseMessage(QString fileMenu
= "");
59 /** This class provide a personalized system tray icon.
60 * @author S�astien Laot
62 class SystemTray
: public KSystemTray2
66 SystemTray(QWidget
*parent
= 0, const char *name
= 0);
69 void mousePressEvent(QMouseEvent
*event
);
70 void mouseMoveEvent(QMouseEvent
*event
);
71 void mouseReleaseEvent(QMouseEvent
*event
);
72 virtual void dragEnterEvent(QDragEnterEvent
*event
);
73 virtual void dragMoveEvent(QDragMoveEvent
* event
);
74 virtual void dragLeaveEvent(QDragLeaveEvent
*);
75 virtual void dropEvent(QDropEvent
*event
);
76 void wheelEvent(QWheelEvent
*event
);
77 void enterEvent(QEvent
*);
78 void leaveEvent(QEvent
*);
82 void updateToolTipDelayed();
87 QTimer
*m_autoShowTimer
;
91 QPixmap m_lockedIconPixmap
;
94 #endif // SYSTEMTRAY_H