00001 #ifndef STATECHANGEDATA_H 00002 #define STATECHANGEDATA_H 00003 00004 #include <QMap> 00005 #include <QString> 00006 00007 #include "taskstates.h" 00008 #include <tools/global.h> 00009 00010 namespace domain 00011 { 00012 00013 class Task; 00014 00025 class DOMAIN_EXPORT StateChangeData 00026 { 00027 public: 00028 00035 StateChangeData(bool possible); 00036 00040 bool isChangePossible() const; 00041 00046 bool areMoreChangesNeeded() const; 00047 00052 QList<const Task*> violatingTasks() const; 00053 00063 TaskState::SettableState suggestedState(const Task* task) const; 00064 00068 const QString& message() const; 00069 00070 operator bool() const; 00071 00079 void addViolatingTask(const Task* task, 00080 TaskState::SettableState newState = TaskState::Failed); 00081 00087 void setMessage(const QString& message); 00088 00089 private: 00090 00091 bool changePossible; 00092 QMap<const Task*, TaskState::SettableState> badTasks; 00093 QString msg; 00094 }; 00095 00096 } 00097 00098 #endif