2008-05-25 06:30:30 -05:00
|
|
|
#ifndef _PACKET_MODEL_H
|
|
|
|
#define _PACKET_MODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractItemModel>
|
2009-08-02 09:52:34 -05:00
|
|
|
|
|
|
|
class ProtocolListIterator;
|
|
|
|
class AbstractProtocol;
|
2008-08-23 23:39:08 -05:00
|
|
|
|
2008-05-25 06:30:30 -05:00
|
|
|
class PacketModel: public QAbstractItemModel
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2009-08-02 09:52:34 -05:00
|
|
|
PacketModel(QObject *parent = 0);
|
|
|
|
void setSelectedProtocols(ProtocolListIterator &iter);
|
2008-05-25 06:30:30 -05:00
|
|
|
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const;
|
2008-05-25 06:53:49 -05:00
|
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
|
|
|
int role = Qt::DisplayRole) const { return QVariant(); } ;
|
2008-05-25 06:30:30 -05:00
|
|
|
QModelIndex index (int row, int col, const QModelIndex & parent = QModelIndex() ) const;
|
|
|
|
QModelIndex parent(const QModelIndex &index) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
typedef union _IndexId
|
|
|
|
{
|
|
|
|
quint32 w;
|
|
|
|
struct
|
|
|
|
{
|
2008-06-14 01:35:17 -05:00
|
|
|
quint16 type;
|
2008-05-25 06:53:49 -05:00
|
|
|
#define ITYP_PROTOCOL 1
|
|
|
|
#define ITYP_FIELD 2
|
2008-08-23 23:39:08 -05:00
|
|
|
quint16 protocol; // protocol is valid for both ITYPs
|
2008-05-25 06:30:30 -05:00
|
|
|
} ws;
|
|
|
|
} IndexId;
|
|
|
|
|
2009-08-02 09:52:34 -05:00
|
|
|
QList<const AbstractProtocol*> mSelectedProtocols;
|
2008-05-25 06:30:30 -05:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|