2019-11-17 23:09:11 +01:00
|
|
|
/*
|
|
|
|
Copyright (C) 2019 Filippo Cucchetto.
|
|
|
|
Contact: https://github.com/filcuc/dotherside
|
|
|
|
|
|
|
|
This file is part of the DOtherSide library.
|
|
|
|
|
|
|
|
The DOtherSide library is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the license, or (at your opinion) any later version.
|
|
|
|
|
|
|
|
The DOtherSide library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
|
|
along with the DOtherSide library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-03-03 22:38:52 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Qt
|
|
|
|
#include <QtCore/QModelIndex>
|
|
|
|
#include <QtCore/QVariant>
|
|
|
|
#include <QtCore/QHash>
|
|
|
|
#include <QtCore/QByteArray>
|
|
|
|
#include <QtCore/QVector>
|
2019-11-17 23:09:11 +01:00
|
|
|
|
2016-03-03 22:38:52 +01:00
|
|
|
// DOtherSide
|
|
|
|
#include "DOtherSide/DosIQObjectImpl.h"
|
|
|
|
|
|
|
|
namespace DOS {
|
|
|
|
|
2017-03-05 18:18:30 +01:00
|
|
|
class DosIQAbstractItemModelImpl : public DosIQObjectImpl
|
2016-03-03 22:38:52 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// Destructor
|
2017-03-05 18:18:30 +01:00
|
|
|
virtual ~DosIQAbstractItemModelImpl() = default;
|
2016-03-03 22:38:52 +01:00
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::setData
|
2017-03-22 22:23:17 +01:00
|
|
|
virtual bool defaultSetData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) = 0;
|
2016-03-03 22:38:52 +01:00
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::flags
|
2017-03-22 22:23:17 +01:00
|
|
|
virtual Qt::ItemFlags defaultFlags(const QModelIndex &index) const = 0;
|
2016-03-03 22:38:52 +01:00
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::headerData
|
2017-03-22 22:23:17 +01:00
|
|
|
virtual QVariant defaultHeaderData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const = 0;
|
2016-03-03 22:38:52 +01:00
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::roleNames
|
2017-03-22 22:23:17 +01:00
|
|
|
virtual QHash<int, QByteArray> defaultRoleNames() const = 0;
|
2016-03-03 22:38:52 +01:00
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::beginInsertRows
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicBeginInsertRows(const QModelIndex &index, int first, int last) = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::endInsertRows
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicEndInsertRows() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::beginRemoveRows
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicBeginRemoveRows(const QModelIndex &index, int first, int last) = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::endRemoveRows
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicEndRemoveRows() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::beginInsertColumns
|
2017-03-05 18:34:35 +01:00
|
|
|
virtual void publicBeginInsertColumns(const QModelIndex &index, int first, int last) = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::endInsertColumns
|
2017-03-05 18:34:35 +01:00
|
|
|
virtual void publicEndInsertColumns() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::beginRemoveColumns
|
2017-03-05 18:34:35 +01:00
|
|
|
virtual void publicBeginRemoveColumns(const QModelIndex &index, int first, int last) = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::endRemoveColumns
|
2017-03-05 18:34:35 +01:00
|
|
|
virtual void publicEndRemoveColumns() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::beginResetModel
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicBeginResetModel() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::endResetModel
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicEndResetModel() = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::dataChanged
|
2016-03-03 22:38:52 +01:00
|
|
|
virtual void publicDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles = QVector<int>()) = 0;
|
|
|
|
|
2017-03-25 15:08:04 +01:00
|
|
|
/// @see QAbstractItemModel::createIndex
|
2018-10-07 10:42:59 +02:00
|
|
|
virtual QModelIndex publicCreateIndex(int row, int column, void *data = nullptr) const = 0;
|
2017-04-02 16:12:18 +02:00
|
|
|
|
|
|
|
/// @see QAbstractItemModel::hasChildren
|
|
|
|
virtual bool defaultHasChildren(const QModelIndex &parent) const = 0;
|
|
|
|
|
|
|
|
/// @see QAbstractItemModel::canFetchMore
|
|
|
|
virtual bool defaultCanFetchMore(const QModelIndex &parent) const = 0;
|
|
|
|
|
|
|
|
/// @see QAbstractItemModel::fetchMore
|
|
|
|
virtual void defaultFetchMore(const QModelIndex &parent) = 0;
|
2017-04-17 00:52:43 +04:00
|
|
|
|
|
|
|
/// @see QAbstractItemModel::hasIndex
|
|
|
|
virtual bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const = 0;
|
2016-03-03 22:38:52 +01:00
|
|
|
};
|
|
|
|
} // namespace dos
|