Updated the README file with some contributor tips.
[basket4.git] / src / systemtray.h
blob8bc4248dff644442a4dbbd675f72de84e22b5ee0
1 /***************************************************************************
2 * Copyright (C) 2003 by S�astien Laot *
3 * slaout@linux62.org *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
21 #ifndef SYSTEMTRAY_H
22 #define SYSTEMTRAY_H
24 #include <KSystemTrayIcon>
25 //Added by qt3to4:
26 #include <QMouseEvent>
27 #include <QEvent>
28 #include <QDragMoveEvent>
29 #include <QDragLeaveEvent>
30 #include <QWheelEvent>
31 #include <QDropEvent>
32 #include <QDragEnterEvent>
33 #include <QPixmap>
35 class MainWindow;
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
43 Q_OBJECT
44 public:
45 KSystemTray2(QWidget *parent = 0, const char *name = 0);
46 ~KSystemTray2();
47 /**
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()
54 * @since 3.4
56 void displayCloseMessage(QString fileMenu = "");
59 /** This class provide a personalized system tray icon.
60 * @author S�astien Laot
62 class SystemTray : public KSystemTray2
64 Q_OBJECT
65 public:
66 SystemTray(QWidget *parent = 0, const char *name = 0);
67 ~SystemTray();
68 protected:
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*);
79 public slots:
80 void updateToolTip();
81 protected slots:
82 void updateToolTipDelayed();
83 signals:
84 void showPart();
85 private:
86 QTimer *m_showTimer;
87 QTimer *m_autoShowTimer;
88 bool m_canDrag;
89 QPoint m_pressPos;
90 QPixmap m_iconPixmap;
91 QPixmap m_lockedIconPixmap;
94 #endif // SYSTEMTRAY_H