00001 #ifndef RESOURCEMODEL_H
00002 #define RESOURCEMODEL_H
00003
00004 #include "domainmodel.h"
00005
00006 namespace domain
00007 {
00008 class Resource;
00009 }
00010
00011 namespace control
00012 {
00013
00014 class CONTROL_EXPORT ResourceModel : public DomainModel
00015 {
00016 public:
00017
00018 enum Columns
00019 {
00020 Description,
00021 Type,
00022 LastColumn
00023 };
00024
00025 ResourceModel(domain::TaskManagerData* data,
00026 QList<domain::Resource*> shownResources =
00027 QList<domain::Resource*>());
00028
00029 int columnCount(const QModelIndex& parent = QModelIndex()) const;
00030 int rowCount(const QModelIndex& parent = QModelIndex()) const;
00031 QVariant headerData(int section, Qt::Orientation orientation,
00032 int role = Qt::DisplayRole) const;
00033 QVariant data(const QModelIndex& index,
00034 int role = Qt::DisplayRole) const;
00035
00036 domain::Resource* resourceForIndex(const QModelIndex& index) const;
00037 QModelIndex indexForResource(domain::Resource* resource) const;
00038
00039 private:
00040
00041 QList<domain::Resource*> resources() const;
00042 QList<domain::Resource*> resourcesList;
00043 };
00044
00045 }
00046
00047 #endif