2
* trayicon.h - system-independent trayicon class (adapted from Qt example)
3
* Copyright (C) 2003 Justin Karneges
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library 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 GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
class TrayIcon : public QObject
33
Q_PROPERTY( QString toolTip READ toolTip WRITE setToolTip )
34
Q_PROPERTY( QPixmap icon READ icon WRITE setIcon )
37
TrayIcon( QObject *parent = 0, const char *name = 0 );
38
TrayIcon( const QPixmap &, const QString &, QPopupMenu *popup = 0, QObject *parent = 0, const char *name = 0 );
41
// use WindowMaker dock mode. ignored on non-X11 platforms
42
void setWMDock(bool use) { v_isWMDock = use; }
43
bool isWMDock() { return v_isWMDock; }
45
// Set a popup menu to handle RMB
46
void setPopup( QPopupMenu * );
47
QPopupMenu* popup() const;
50
QString toolTip() const;
55
void setIcon( const QPixmap &icon );
56
void setToolTip( const QString &tip );
62
void clicked( const QPoint&, int);
63
void doubleClicked( const QPoint& );
67
bool event( QEvent * );
68
virtual void mouseMoveEvent( QMouseEvent *e );
69
virtual void mousePressEvent( QMouseEvent *e );
70
virtual void mouseReleaseEvent( QMouseEvent *e );
71
virtual void mouseDoubleClickEvent( QMouseEvent *e );
79
// system-dependant part
81
class TrayIconPrivate;
87
void sysUpdateToolTip();
89
friend class TrayIconPrivate;
92
#endif // CS_TRAYICON_H