1
/****************************************************************************
2
** trayicon.h - system-independent tray app class (adapted from Qt example)
3
** Copyright (C) 2001, 2002 Justin Karneges
5
** This program is free software; you can redistribute it and/or
6
** modify it under the terms of the GNU General Public License
7
** as published by the Free Software Foundation; either version 2
8
** of the License, or (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 Free Software
17
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
19
****************************************************************************/
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
80
class TrayIconPrivate;
85
void sysUpdateToolTip();