2 xtrazstatusmodel.h - Xtraz Status Model
4 Copyright (c) 2007 by Roman Jarosz <kedgedev@centrum.cz>
5 Kopete (c) 2007 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 *************************************************************************
17 #ifndef XTRAZSTATUSMODEL_H
18 #define XTRAZSTATUSMODEL_H
20 #include <QAbstractTableModel>
22 #include "xtrazstatus.h"
27 class StatusModel
: public QAbstractTableModel
30 StatusModel( QObject
* parent
= 0 );
32 QList
<Xtraz::Status
> getStatuses() const;
33 void setStatuses( const QList
<Xtraz::Status
> &statusList
);
35 virtual int rowCount( const QModelIndex
&parent
= QModelIndex() ) const;
36 virtual int columnCount( const QModelIndex
&parent
= QModelIndex() ) const;
38 virtual bool setData( const QModelIndex
&index
, const QVariant
&value
, int role
= Qt::EditRole
);
39 virtual QVariant
data( const QModelIndex
&index
, int role
= Qt::DisplayRole
) const;
41 virtual QVariant
headerData( int section
, Qt::Orientation orientation
, int role
= Qt::DisplayRole
) const;
43 virtual Qt::ItemFlags
flags( const QModelIndex
&index
) const;
45 bool swapRows( int i
, int j
);
47 virtual bool insertRows( int row
, int count
, const QModelIndex
&parent
= QModelIndex() );
48 virtual bool removeRows( int row
, int count
, const QModelIndex
&parent
= QModelIndex() );
51 QList
<Xtraz::Status
> mStatuses
;