/* 
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __NETTRAY_H
#define __NETTRAY_H

#include <qpair.h>
#include <qptrlist.h>
#include <dcopobject.h>

#include <netinterface.h>
#include <ipv4addr.h>

#include <trayicon.h>

#define K_DCOP_OBJID "Notify"

class QString;
class QPixmap;
class QPopupMenu;

class NetworkTray : public TrayIcon, virtual public DCOPObject {
   Q_OBJECT
   K_DCOP
   
public:
	NetworkTray();
	virtual ~NetworkTray();

	virtual QString toolTipRequested();

k_dcop:
	virtual void linkStatusChanged(const QString &);
	virtual void addressChanged(const QString &);

private slots:
	void  openConfigDlg();
	void  openPPPConnection();
	void  closePPPConnection();
   
protected:
	virtual void mouseDoubleClickEvent(QMouseEvent *e);

private:
	QString  statusToStr(NetInterface::Status);
	QPixmap  getIcon();

	QPopupMenu *menu;
};

#endif /* __NETTRAY_H */
