Even though the last alpha was .91 this one is going to be 82 as I'd like to have...
[kdevelopdvcssupport.git] / plugins / projectmanagerview / projectbuildsetmodel.h
blob32ff898a6079526ffbcbe812f422067fdb9daca0
1 /***************************************************************************
2 * This file is part of KDevelop *
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU Library General Public License as *
7 * published by the Free Software Foundation; either version 2 of the *
8 * License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU Library General Public *
16 * License along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef PROJECTBUILDSETMODEL_H
22 #define PROJECTBUILDSETMODEL_H
24 #include <QAbstractTableModel>
25 #include <QSet>
27 namespace KDevelop
29 class ProjectBaseItem;
30 class ICore;
31 class IProject;
34 class KConfigGroup;
36 class BuildItem
38 public:
39 BuildItem();
40 BuildItem( const QString& itemName, const QString& projectName, const QString& itemPath );
41 BuildItem( const BuildItem& rhs );
42 BuildItem( KDevelop::ProjectBaseItem* );
43 void initializeFromItem( KDevelop::ProjectBaseItem* item );
44 KDevelop::ProjectBaseItem* findItem() const;
45 BuildItem& operator=( const BuildItem& );
46 QString itemName() const { return m_itemName; }
47 QString projectName() const { return m_projectName; }
48 QString itemPath() const { return m_itemPath; }
49 private:
50 QString m_itemName;
51 QString m_projectName;
52 QString m_itemPath;
55 bool operator==( const BuildItem& rhs, const BuildItem& lhs );
57 class ProjectBuildSetModel : public QAbstractTableModel
59 Q_OBJECT
60 public:
61 ProjectBuildSetModel( QObject* parent );
62 QVariant data( const QModelIndex&, int role = Qt::DisplayRole ) const;
63 QVariant headerData( int, Qt::Orientation, int role = Qt::DisplayRole ) const;
64 int rowCount( const QModelIndex& = QModelIndex() ) const;
65 int columnCount( const QModelIndex& = QModelIndex() ) const;
67 void addProjectItem( KDevelop::ProjectBaseItem* );
68 bool removeRows( int row, int count, const QModelIndex& parent = QModelIndex() );
69 KDevelop::ProjectBaseItem* itemForIndex( const QModelIndex& );
70 QList<BuildItem> items();
71 public slots:
72 void saveToProject( KDevelop::IProject* ) const;
73 void loadFromProject( KDevelop::IProject* );
74 private:
75 QList<BuildItem> m_items;
78 #endif
80 //kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;