Fix crash on login.
[kdenetwork.git] / kopete / protocols / oscar / icq / xtrazstatusmodel.h
blob478f65b0dfbbdf97456894c969f9d945a70139bb
1 /*
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 *************************************************************************
8 * *
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. *
13 * *
14 *************************************************************************
17 #ifndef XTRAZSTATUSMODEL_H
18 #define XTRAZSTATUSMODEL_H
20 #include <QAbstractTableModel>
22 #include "xtrazstatus.h"
24 namespace Xtraz
27 class StatusModel : public QAbstractTableModel
29 public:
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() );
50 private:
51 QList<Xtraz::Status> mStatuses;
57 #endif