00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef SCANLIST_H
00017 #define SCANLIST_H
00018
00019 #include "gps.h"
00020
00021
00022 #include <opie2/olistview.h>
00023 #include <opie2/onetutils.h>
00024
00025
00026 #include <qtextstream.h>
00027
00028 class QString;
00029 class MScanListItem;
00030
00031 class MScanListView: public Opie::Ui::OListView
00032 {
00033 Q_OBJECT
00034
00035 public:
00036 MScanListView( QWidget* parent = 0, const char* name = 0 );
00037 virtual ~MScanListView();
00038
00039 virtual Opie::Ui::OListViewItem* childFactory();
00040 virtual void serializeTo( QDataStream& s ) const;
00041 virtual void serializeFrom( QDataStream& s );
00042
00043 public slots:
00044 void addNewItem( const QString& type, const QString&, const Opie::Net::OMacAddress&, bool, int, int, const GpsLocation&, bool = false );
00045 void addService( const QString& name, const Opie::Net::OMacAddress& macaddr, const QString& ip );
00046
00047 void fromDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
00048 void toDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
00049 void WDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& viaFrom, const Opie::Net::OMacAddress& viaTo );
00050 void IBSStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via );
00051
00052 void identify( const Opie::Net::OMacAddress&, const QString& ipaddr );
00053
00054 void contextMenuRequested( QListViewItem* item, const QPoint&, int );
00055
00056 signals:
00057 void rightButtonClicked(QListViewItem*,const QPoint&,int);
00058
00059 protected:
00060 void addIfNotExisting( MScanListItem* parent, const Opie::Net::OMacAddress& addr, const QString& type = "station" );
00061
00062 };
00063
00064
00065
00066 class MScanListItem: public Opie::Ui::OListViewItem
00067 {
00068 public:
00069 MScanListItem::MScanListItem( QListView* parent,
00070 const QString& type = "unknown",
00071 const QString& essid = "unknown",
00072 const QString& macaddr = "unknown",
00073 bool wep = false,
00074 int channel = 0,
00075 int signal = 0,
00076 bool probed = false );
00077
00078 MScanListItem::MScanListItem( QListViewItem* parent,
00079 const QString& type = "unknown",
00080 const QString& essid = "unknown",
00081 const QString& macaddr = "unknown",
00082 bool wep = false,
00083 int channel = 0,
00084 int signal = 0 );
00085
00086
00087 protected:
00088 virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed );
00089
00090 public:
00091 QString type;
00092
00093 public:
00094
00095 const QString& essid() const;
00096 const QString& macaddr() { return _macaddr; };
00097 bool wep() { return _wep; };
00098 int channel() { return _channel; };
00099 int signal() { return _signal; };
00100 int beacons() { return _beacons; };
00101
00102 void setSignal( int signal ) { };
00103 void receivedBeacon();
00104
00105 void setManufacturer( const QString& manufacturer );
00106 void setLocation( const QString& location );
00107
00108 virtual Opie::Ui::OListViewItem* childFactory();
00109 virtual void serializeTo( QDataStream& s ) const;
00110 virtual void serializeFrom( QDataStream& s );
00111
00112 virtual QString key( int id, bool )const;
00113
00114 private:
00115 QString _type;
00116 QString _essid;
00117 QString _macaddr;
00118 bool _wep;
00119 int _channel;
00120 int _signal;
00121 int _beacons;
00122
00123 };
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 #endif
00141