File indexing completed on 2024-05-12 04:39:39

0001 /*
0002     SPDX-FileCopyrightText: 2010 Andreas Pakulat <apaku@gmx.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-or-later
0005 */
0006 
0007 #ifndef DEFINESMODEL_H
0008 #define DEFINESMODEL_H
0009 
0010 #include <QAbstractTableModel>
0011 
0012 #include "idefinesandincludesmanager.h"
0013 
0014 class DefinesModel : public QAbstractTableModel
0015 {
0016 Q_OBJECT
0017 public:
0018     explicit DefinesModel( QObject* parent = nullptr );
0019     void setDefines( const KDevelop::Defines& defines );
0020     KDevelop::Defines defines() const;
0021     QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
0022     int rowCount(const QModelIndex& parent = QModelIndex()) const override;
0023     bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
0024     Qt::ItemFlags flags(const QModelIndex& index) const override;
0025     int columnCount(const QModelIndex& parent = QModelIndex()) const override;
0026     QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
0027     bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
0028 private:
0029     QVector<QPair<QString, QString>> m_defines;
0030 };
0031 
0032 #endif // DEFINESMODEL_H