00001 #ifndef INVITATION_H 00002 #define INVITATION_H 00003 00004 #include "storabledata.h" 00005 00006 namespace domain 00007 { 00008 00009 class Task; 00010 class User; 00011 struct InvitationPrivate; 00012 00020 class DOMAIN_EXPORT Invitation : public StorableData 00021 { 00022 Q_OBJECT 00023 00024 friend class TaskManagerData; 00025 00026 public: 00027 00032 enum State 00033 { 00035 Accepted = 0x1, 00036 00038 Pending = 0x2, 00039 00041 Declined = 0x4, 00042 00044 All = Accepted | Pending | Declined 00045 }; 00046 00050 const Task* task() const; 00051 00055 const User* user() const; 00056 00060 State state() const; 00061 00065 QString stateString() const; 00066 00073 void setState(State state); 00074 00075 private: 00076 00077 Invitation(Task* task, User* user); 00078 ~Invitation(); 00079 00080 InvitationPrivate* const d; 00081 }; 00082 00090 struct InvitationData 00091 { 00092 User* user; 00093 Invitation::State state; 00094 }; 00095 00096 } 00097 00098 #endif