Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

scanlist.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer.  All rights reserved.
00003 **
00004 ** This file is part of Wellenreiter II.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 **********************************************************************/
00015 
00016 #ifndef SCANLIST_H
00017 #define SCANLIST_H
00018 
00019 #include "gps.h"
00020 
00021 /* OPIE */
00022 #include <opie2/olistview.h>
00023 #include <opie2/onetutils.h>
00024 
00025 /* QT */
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 //****************************** MScanListItem ****************************************************************
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     //const QString& type() { return _type; };
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 ) { /* TODO */ };
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 //****************************** MScanListViewFactory ****************************************************************
00126 
00127 /*
00128 
00129 class MScanListViewFactory : public Opie::Ui::OListViewFactory
00130 {
00131 public:
00132     virtual QListView* listViewFactory();
00133     virtual QListViewItem* listViewItemFactory( QListView* lv );
00134     virtual QListViewItem* listViewItemFactory( QListViewItem* lvi );
00135     virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text );
00136     virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text );
00137 }
00138 */
00139 
00140 #endif
00141 

Generated on Sat Nov 5 16:17:45 2005 for OPIE by  doxygen 1.4.2