domain::TaskState Class Reference

A class to represent the state of a Task. More...

#include <taskstates.h>

Inheritance diagram for domain::TaskState:
Inheritance graph
[legend]

List of all members.

Public Types

enum  SettableState {
  Failed,
  Unfinished,
  Successful
}

Public Member Functions

virtual QString name () const =0

Static Public Member Functions

static QList
< TaskState::SettableState > 
allStates ()
static TaskStatestateForEnum (TaskState::SettableState state)
static QString nameForEnum (TaskState::SettableState state)

Protected Member Functions

 TaskState (const TaskState &other)
TaskStateoperator= (const TaskState &other)

Static Protected Member Functions

static void setTaskState (Task *task, TaskState *state)
static void setTaskField (Task *task, const QString &id, const QVariant &value)
static void addTaskReservation (Task *task, Reservation *reservation)
static void setTaskProject (Task *task, Project *project)
static void addTaskSubTask (Task *task, Task *subTask)

Private Member Functions

virtual SettableState settableState () const =0
virtual void updateTask (Task *task)
virtual void setField (Task *task, const QString &id, const QVariant &value)
virtual void addReservation (Task *task, Reservation *reservation)
virtual void setProject (Task *task, Project *project)
virtual void addSubTask (Task *task, Task *subTask)

Friends

class Task

Detailed Description

A class to represent the state of a Task.

This class is the general superclass to represent the state a Task has. Because the state of a task determines its behavior, this class has the responsibility to correctly implement that behavior for a certain state.

Definition at line 28 of file taskstates.h.


Member Function Documentation

void TaskState::addReservation ( Task task,
Reservation reservation 
) [private, virtual]

Adds a given reservation to a given task.

Parameters:
task The task to change
reservation The reservation to add
Exceptions:
StringException 

Reimplemented in domain::TaskSuccessful, domain::TaskFailed, domain::TaskUnfinished, and domain::TaskDeleting.

Definition at line 98 of file taskstates.cpp.

void TaskState::addSubTask ( Task task,
Task subTask 
) [private, virtual]

Adds a given subtask to a given task.

Parameters:
task The task to change
subTask The task to add as subtask
Exceptions:
StringException 

Reimplemented in domain::TaskUnfinished, and domain::TaskDeleting.

Definition at line 110 of file taskstates.cpp.

void TaskState::addTaskReservation ( Task task,
Reservation reservation 
) [static, protected]

Adds a given reservation to a given task.

Parameters:
task The task to change
reservation The reservation to add

Definition at line 72 of file taskstates.cpp.

void TaskState::addTaskSubTask ( Task task,
Task subTask 
) [static, protected]

Adds a given subtask to a given task.

Parameters:
task The task to change
subTask The task to add as subtask

Definition at line 82 of file taskstates.cpp.

QList< TaskState::SettableState > TaskState::allStates (  )  [static]

Returns all the possible states that can be used to set the state of a Task.

Definition at line 23 of file taskstates.cpp.

QString TaskState::nameForEnum ( TaskState::SettableState  state  )  [static]

Returns the name for a given setttable state.

Parameters:
state The state to give the name for

Definition at line 53 of file taskstates.cpp.

Here is the call graph for this function:

void TaskState::setField ( Task task,
const QString &  id,
const QVariant &  value 
) [private, virtual]

Sets a field of a given task.

Parameters:
task The task to change
id The id of the field to set
value The value to set the field to
Exceptions:
StringException 

Reimplemented in domain::TaskSuccessful, domain::TaskFailed, domain::TaskUnfinished, and domain::TaskDeleting.

Definition at line 92 of file taskstates.cpp.

void TaskState::setProject ( Task task,
Project project 
) [private, virtual]

Sets the project of a given task to the given project.

Parameters:
task The task to change
project The project to set
Exceptions:
StringException 

Reimplemented in domain::TaskSuccessful, domain::TaskFailed, domain::TaskUnfinished, and domain::TaskDeleting.

Definition at line 104 of file taskstates.cpp.

virtual SettableState domain::TaskState::settableState (  )  const [private, pure virtual]

Returns the settable state for this task state.

Implemented in domain::TaskSuccessful, domain::TaskFailed, domain::TaskUnfinished, and domain::TaskDeleting.

void TaskState::setTaskField ( Task task,
const QString &  id,
const QVariant &  value 
) [static, protected]

Sets a field of a given task.

Parameters:
task The task to change
id The id of the field to set
value The value to set the field to

Definition at line 67 of file taskstates.cpp.

void TaskState::setTaskProject ( Task task,
Project project 
) [static, protected]

Sets the project of a given task to the given project.

Parameters:
task The task to change
project The project to set

Definition at line 77 of file taskstates.cpp.

void TaskState::setTaskState ( Task task,
TaskState state 
) [static, protected]

Sets the state of a given task to the given state.

Parameters:
task The Task to change
state The state to set

Definition at line 62 of file taskstates.cpp.

Here is the call graph for this function:

TaskState * TaskState::stateForEnum ( TaskState::SettableState  state  )  [static]

Returns the TaskState for a given settable state.

Parameters:
state The state to give the TaskState representation for

Definition at line 37 of file taskstates.cpp.

void TaskState::updateTask ( Task task  )  [private, virtual]

Updates the state of the given task to the correct state.

Parameters:
task The task to update the state of

Reimplemented in domain::TaskSuccessful, and domain::TaskUnfinished.

Definition at line 87 of file taskstates.cpp.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator
Generated on Thu May 27 14:20:17 2010 for MopTaskManager by  doxygen 1.6.3