1 /***************************************************************************
2 * This file is part of KDevelop *
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de> *
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. *
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. *
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>
29 class ProjectBaseItem
;
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
; }
51 QString m_projectName
;
55 bool operator==( const BuildItem
& rhs
, const BuildItem
& lhs
);
57 class ProjectBuildSetModel
: public QAbstractTableModel
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();
72 void saveToProject( KDevelop::IProject
* ) const;
73 void loadFromProject( KDevelop::IProject
* );
75 QList
<BuildItem
> m_items
;
80 //kate: space-indent on; indent-width 4; replace-tabs on; auto-insert-doxygen on; indent-mode cstyle;