00001 #ifndef INVITATIONMODEL_H
00002 #define INVITATIONMODEL_H
00003
00004 #include "domainmodel.h"
00005
00006 #include <domain/invitation.h>
00007
00008 namespace domain
00009 {
00010 class Task;
00011 class User;
00012 }
00013
00014 namespace control
00015 {
00016
00017 class CONTROL_EXPORT InvitationModel : public DomainModel
00018 {
00019 public:
00020
00021 enum Columns
00022 {
00023 Task,
00024 InvitedUser,
00025 UserType,
00026 Status,
00027 LastColumn
00028 };
00029
00030 InvitationModel(domain::TaskManagerData* data, int states = domain::Invitation::All);
00031 InvitationModel(domain::TaskManagerData* data, const domain::Task* task,
00032 int states = domain::Invitation::All);
00033 InvitationModel(domain::TaskManagerData* data, const domain::User* user,
00034 int states = domain::Invitation::All);
00035
00036 int columnCount(const QModelIndex& parent = QModelIndex()) const;
00037 int rowCount(const QModelIndex& parent = QModelIndex()) const;
00038 QVariant headerData(int section, Qt::Orientation orientation,
00039 int role = Qt::DisplayRole) const;
00040 QVariant data(const QModelIndex& index,
00041 int role = Qt::DisplayRole) const;
00042 const domain::Invitation* invitationForIndex(const QModelIndex& index) const;
00043 QModelIndex indexForInvitation(const domain::Invitation* invitation) const;
00044
00045 private:
00046
00047 QList<const domain::Invitation*> invitations() const;
00048
00049 const domain::Task* taskToShow;
00050 const domain::User* userToShow;
00051 int shownStates;
00052 };
00053
00054 }
00055
00056 #endif