domain::TaskType Class Reference

Represents a type of Task objects. More...

#include <tasktype.h>

Inheritance diagram for domain::TaskType:
Inheritance graph
[legend]
Collaboration diagram for domain::TaskType:
Collaboration graph
[legend]

List of all members.

Signals

void dataChanged ()

Public Member Functions

const QList< Field > & fields () const
Field fieldById (const QString &id) const
RequirementrequirementByType (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)
ResourceRequirementaddRequirement (ResourceType *type, unsigned min, unsigned max)
UserRequirementaddRequirement (UserType *type, unsigned min, unsigned max)
void addPotentialOwner (UserType *owner)

Private Member Functions

 TaskType (const QString &id, const QString &name)

Private Attributes

TaskTypePrivated

Friends

class TaskManagerData
class TaskTypePrivate

Detailed Description

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.

See also:
TaskManagerData::createTaskType

Definition at line 188 of file tasktype.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

void domain::TaskType::addField ( const Field field  ) 

Adds the given field to the needed fields of this type.

Exceptions:
InvalidDataException 
  • If the given field is not valid.
  • If there already exists a field with the same id as the given field.
See also:
fieldById(), Field::isValid() const.

Definition at line 143 of file tasktype.cpp.

Here is the call graph for this function:

void domain::TaskType::addPotentialOwner ( UserType owner  ) 

Adds a user type that is allowed to create Task objects of this type.

See also:
UserType, potentialOwners().

Definition at line 171 of file tasktype.cpp.

Here is the call graph for this function:

UserRequirement* domain::TaskType::addRequirement ( UserType type,
unsigned  min,
unsigned  max 
)

Adds a requirement for a User of the given type.

See also:
UserRequirement, userRequirements().
ResourceRequirement* domain::TaskType::addRequirement ( ResourceType type,
unsigned  min,
unsigned  max 
)

Adds a requirement for a Resource of the given type.

See also:
ResourceRequirement, resourceRequirements().
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.

See also:
Requirement::canBeSuccessful(const Task*) const.

Definition at line 122 of file tasktype.cpp.

Here is the call graph for this function:

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.

See also:
Field::isNull().

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.

See also:
Field

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.

See also:
UserType, userCanCreate().

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.

See also:
Requirement.

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.

See also:
Requirement::isFulfilled(const Task*) const.

Definition at line 108 of file tasktype.cpp.

Here is the call graph for this function:

QList< Requirement * > domain::TaskType::resourceRequirements (  )  const

Returns a list of all requirements for resources of this type.

See also:
ResourceRequirement.

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.

See also:
potentialOwners().

Definition at line 138 of file tasktype.cpp.

Here is the call graph for this function:

QList< Requirement * > domain::TaskType::userRequirements (  )  const

Returns a list of all requirements for users of this type.

See also:
UserRequirement.

Definition at line 103 of file tasktype.cpp.


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:19 2010 for MopTaskManager by  doxygen 1.6.3