Class to represent the change between different taskstates for a task. More...
#include <statechangedata.h>
Public Member Functions | |
StateChangeData (bool possible) | |
bool | isChangePossible () const |
bool | areMoreChangesNeeded () const |
QList< const Task * > | violatingTasks () const |
TaskState::SettableState | suggestedState (const Task *task) const |
const QString & | message () const |
operator bool () const | |
void | addViolatingTask (const Task *task, TaskState::SettableState newState=TaskState::Failed) |
void | setMessage (const QString &message) |
Private Attributes | |
bool | changePossible |
QMap< const Task *, TaskState::SettableState > | badTasks |
QString | msg |
Class to represent the change between different taskstates for a task.
This class is used to represent the (im)possibility to change states of a certain task. It contains a bool to indicate whether the change is possible, a potential error message and a map of the tasks that need to be adjusted to the settable state they need to be set to in order for the change to be possible.
Definition at line 25 of file statechangedata.h.
StateChangeData::StateChangeData | ( | bool | possible | ) |
Creates a new object of this class, with the 'possibility' bool set to the given argument.
possible | bool whether the change is possible or not. |
Definition at line 6 of file statechangedata.cpp.
void domain::StateChangeData::addViolatingTask | ( | const Task * | task, | |
TaskState::SettableState | newState = TaskState::Failed | |||
) |
Adds a given task with the given suggested new state to the list of tasks to adjust for this change to be possible.
tasks | The task to add. | |
newState | The suggested new state for the task. |
Definition at line 43 of file statechangedata.cpp.
bool domain::StateChangeData::areMoreChangesNeeded | ( | ) | const |
Indicates whether more tasks need a status update in order to update this task's status.
Definition at line 15 of file statechangedata.cpp.
bool StateChangeData::isChangePossible | ( | ) | const |
Indicates whether the state change is possible.
Definition at line 10 of file statechangedata.cpp.
const QString & domain::StateChangeData::message | ( | ) | const |
Returns the error message.
Definition at line 20 of file statechangedata.cpp.
void domain::StateChangeData::setMessage | ( | const QString & | message | ) |
Sets the error message.
message | The error message to set. |
Definition at line 49 of file statechangedata.cpp.
TaskState::SettableState StateChangeData::suggestedState | ( | const Task * | task | ) | const |
Returns the new suggested state for a given violating task.
task | The violating task for which to give the suggested state. |
InvalidDataException | If there is no suggested state for the given task. |
Definition at line 30 of file statechangedata.cpp.
QList< const domain::Task * > domain::StateChangeData::violatingTasks | ( | ) | const |
Returns a list of the tasks that need to be adjusted in order for the change to be possible.
Definition at line 25 of file statechangedata.cpp.