Represents a type of Task objects. More...
#include <tasktype.h>
Signals | |
void | dataChanged () |
Public Member Functions | |
const QList< Field > & | fields () const |
Field | fieldById (const QString &id) const |
Requirement * | requirementByType (Type *type) const |
const QList< Requirement * > & | requirements () const |
QList< Requirement * > | userRequirements () const |
QList< Requirement * > | resourceRequirements () const |
bool | requirementsAreFulfilled (const Task *task) const |
bool | canBeSuccessful (const Task *task) const |
const QList< UserType * > & | potentialOwners () const |
bool | userCanCreate (UserType *userType) const |
void | addField (const Field &field) |
ResourceRequirement * | addRequirement (ResourceType *type, unsigned min, unsigned max) |
UserRequirement * | addRequirement (UserType *type, unsigned min, unsigned max) |
void | addPotentialOwner (UserType *owner) |
Private Member Functions | |
TaskType (const QString &id, const QString &name) | |
Private Attributes | |
TaskTypePrivate * | d |
Friends | |
class | TaskManagerData |
class | TaskTypePrivate |
Represents a type of Task objects.
It is represented by a list of needed fields, a list of requirements for users, a list of requirements for resources and a list of user types that are allowed to create Task objects with this type.
Constructors and destructor are private, creating and deleting resourcetypes is handled by the class TaskManagerData.
Definition at line 188 of file tasktype.h.
domain::TaskType::TaskType | ( | const QString & | id, | |
const QString & | name | |||
) | [private] |
Creates a new tasktype with the given properties.
Definition at line 78 of file tasktype.cpp.
void domain::TaskType::addField | ( | const Field & | field | ) |
Adds the given field to the needed fields of this type.
InvalidDataException |
|
Definition at line 143 of file tasktype.cpp.
void domain::TaskType::addPotentialOwner | ( | UserType * | owner | ) |
Adds a user type that is allowed to create Task objects of this type.
Definition at line 171 of file tasktype.cpp.
UserRequirement* domain::TaskType::addRequirement | ( | UserType * | type, | |
unsigned | min, | |||
unsigned | max | |||
) |
Adds a requirement for a User of the given type.
ResourceRequirement* domain::TaskType::addRequirement | ( | ResourceType * | type, | |
unsigned | min, | |||
unsigned | max | |||
) |
Adds a requirement for a Resource of the given type.
bool domain::TaskType::canBeSuccessful | ( | const Task * | task | ) | const |
Indicates whether none of the given tasks requirements prevents the task from being in a successful state.
Definition at line 122 of file tasktype.cpp.
void domain::TaskType::dataChanged | ( | ) | [signal] |
Emitted when anything changes in this object.
Field domain::TaskType::fieldById | ( | const QString & | id | ) | const |
Returns the field with the given id
if there is such a field. Otherwise returns a null field.
Definition at line 180 of file tasktype.cpp.
const QList< Field > & domain::TaskType::fields | ( | ) | const |
Returns a list of all fields needed by this type.
Definition at line 88 of file tasktype.cpp.
const QList< UserType * > & domain::TaskType::potentialOwners | ( | ) | const |
Returns a list of user types that are allowed to create Task objects with this type.
Definition at line 133 of file tasktype.cpp.
Requirement * domain::TaskType::requirementByType | ( | Type * | type | ) | const |
Returns the Requirement for the given Type if the is such a requirement. Otherwise returns 0.
Definition at line 191 of file tasktype.cpp.
const QList< Requirement * > & domain::TaskType::requirements | ( | ) | const |
Returns a list of all requirements needed by this type.
Definition at line 93 of file tasktype.cpp.
bool domain::TaskType::requirementsAreFulfilled | ( | const Task * | task | ) | const |
Indicates whether all requirements of the given task are fulfilled. Returns false if the given task does not have this type as its type.
Definition at line 108 of file tasktype.cpp.
QList< Requirement * > domain::TaskType::resourceRequirements | ( | ) | const |
Returns a list of all requirements for resources of this type.
Definition at line 98 of file tasktype.cpp.
bool domain::TaskType::userCanCreate | ( | UserType * | userType | ) | const |
Indicates whether users of this given type are allowed to create Task objects with this type.
Definition at line 138 of file tasktype.cpp.
QList< Requirement * > domain::TaskType::userRequirements | ( | ) | const |
Returns a list of all requirements for users of this type.
Definition at line 103 of file tasktype.cpp.