00001 /**************************************************************** 00002 * Vidalia is distributed under the following license: 00003 * 00004 * Copyright (C) 2006, Matt Edman, Justin Hipple 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 * Boston, MA 02110-1301, USA. 00020 *************************************************************** 00021 * This code is derived from systemtray.cpp from QMPDClient. It is 00022 * licensed as follows: 00023 * 00024 * QMPDClient - An MPD client written in Qt 4. 00025 * Copyright (C) 2005 Håvard Tautra Knutsen <havtknut@tihlde.org> 00026 * 00027 * This program is free software; you can redistribute it and/or 00028 * modify it under the terms of the GNU General Public License 00029 * as published by the Free Software Foundation; either version 2 00030 * of the License, or (at your option) any later version. 00031 * 00032 * This program is distributed in the hope that it will be useful, 00033 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00034 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00035 * GNU General Public License for more details. 00036 * 00037 * You should have received a copy of the GNU General Public License 00038 * along with this program; if not, write to the Free Software 00039 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00040 ***************************************************************/ 00041 00042 /** 00043 * \file trayicon_x11.h 00044 * \version $Id: trayicon_x11.h 1769 2007-06-03 21:59:21Z edmanm $ 00045 * \brief Tray icon implementation on X11 00046 */ 00047 00048 #ifndef _TRAYICON_X11_H 00049 #define _TRAYICON_X11_H 00050 00051 #include <QLabel> 00052 #include <QPixmap> 00053 #include <QString> 00054 #include <QEvent> 00055 00056 00057 class TrayIconImpl : public QLabel 00058 { 00059 protected: 00060 /** Default constructor. */ 00061 TrayIconImpl(); 00062 00063 /** Show the tray icon image. */ 00064 void show(); 00065 /** Hide the tray icon image. */ 00066 void hide(); 00067 /** Modify the tray icon's image. */ 00068 void setIcon(const QString &iconFile); 00069 /** Modify the tray icon's tooltip. */ 00070 void setToolTip(const QString &toolTip); 00071 00072 /** Process events when the mouse enters the icon area. */ 00073 void enterEvent(QEvent *event); 00074 00075 private: 00076 /** Adds this widget to the system notification area. */ 00077 void addToTray(); 00078 }; 00079 00080 #endif 00081