2 * This file is part of family-shop-mgr.
\r
4 * family-shop-mgr is free software: you can redistribute it and/or modify
\r
5 * it under the terms of the GNU General Public License as published by
\r
6 * the Free Software Foundation, either version 3 of the License, or
\r
7 * (at your option) any later version.
\r
9 * family-shop-mgr is distributed in the hope that it will be useful,
\r
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
12 * GNU General Public License for more details.
\r
14 * You should have received a copy of the GNU General Public License
\r
15 * along with family-shop-mgr. If not, see <http://www.gnu.org/licenses/>.
\r
17 * Author: Unai IRIGOYEN
\r
22 #ifndef SHOPPINGTREEMODEL_H
\r
23 #define SHOPPINGTREEMODEL_H
\r
25 #include <QAbstractItemModel>
\r
26 #include <QDomDocument>
\r
27 #include <QModelIndex>
\r
30 class ShoppingTreeItem;
\r
32 class ShoppingTreeModel : public QAbstractItemModel
\r
35 ShoppingTreeModel(const QString &xmlFileName, QObject *parent = 0);
\r
36 ~ShoppingTreeModel();
\r
38 QVariant data(const QModelIndex &index, int role) const;
\r
39 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
\r
40 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
\r
41 QModelIndex parent(const QModelIndex &index) const;
\r
43 int rowCount(const QModelIndex &parent = QModelIndex()) const;
\r
44 int columnCount(const QModelIndex &parent = QModelIndex()) const;
\r
46 Qt::ItemFlags flags(const QModelIndex &index) const;
\r
47 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
\r
48 bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole);
\r
50 bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
\r
51 bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex());
\r
52 bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex());
\r
53 bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex());
\r
56 QDomDocument m_document;
\r
59 #endif // SHOPPINGTREEMODEL_H
\r