/*
    knetd, KDE Network Daemon

    Copyright (c) 2005 by Engin AYDOGAN		<engin @ bzzzt.biz>

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef KNETD_H_
#define KNETD_H_

#define VER_MAJ (0)
#define VER_MID (0)
#define VER_MIN (3)

#include <kdedmodule.h>
#include <qcstring.h>
#include <qstringlist.h>

class AbstractDevice;

class KNetD : public KDEDModule
{
Q_OBJECT
K_DCOP
public:
	KNetD( const QCString& n );
	~KNetD();
	class Private;
protected:
	AbstractDevice* find( const QString& );
k_dcop:
	int version() const;

	QStringList devices() const;
	void toggleTray();
	void enableTray();
	void disableTray();
	bool isTrayEnabled();
	void reReadConfiguration();

	bool isWireless( const QString& );
	bool isEthernet( const QString& );
	QString ip4( const QString& );
	QString ip6( const QString& );
	QString mac( const QString& );
	QString netmask( const QString& );
	QString gateway( const QString& );
public slots:
	void readConfig();
	void slotIpChanged( AbstractDevice* );
	void slotDeviceFound( const QString& );
	void slotDeviceRemoved( const QString& );
	void slotLinkUp( AbstractDevice* );
	void slotLinkDown( AbstractDevice* );
	void slotInterfaceUp( AbstractDevice* );
	void slotInterfaceDown( AbstractDevice* );
	void selectBestDevice();
signals:
	void deviceFound( const QString& );
	void deviceRemoved( const QString& );
private:
	Private* d;
};

#endif
