domain::User Class Reference

Class to represent a user. More...

#include <user.h>

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

List of all members.

Public Member Functions

UserTypeuserType () const
const QString & name () const
QList< const Task * > tasks () const
QList< const Invitation * > invitations () const
virtual bool isAdmin () const

Protected Member Functions

 User (UserType *type, const QString &name)
virtual ~User ()

Private Member Functions

 User (const User &other)
Useroperator= (const User &other)
void addTask (Task *task)
void removeTask (Task *task)
void addInvitation (Invitation *invitation)
void removeInvitation (Invitation *invitation)
QList< StorableData * > dependentData () const

Private Attributes

UserPrivate *const d

Friends

class TaskManagerData
class Reservation
class Task
class Invitation

Detailed Description

Class to represent a user.

This class represents a user. A user has a name and can have multiple Task assigned to him/her. A user can also receive Invitation objects and choose to accept or decline these. An object of this class is not an administrator.

A user is always of a certain UserType.

Constructors and destructor are protected, creating and deleting users is handled by the class TaskManagerData.

See also:
TaskManagerData::createUser
AdminUser

Definition at line 38 of file user.h.


Constructor & Destructor Documentation

domain::User::User ( UserType type,
const QString &  name 
) [protected]

Creates a new user.

The newly created user will have the given properties

Definition at line 25 of file user.cpp.

domain::User::~User (  )  [protected, virtual]

Destructor for a user. This removes all dependent data.

See also:
dependentData().

Definition at line 34 of file user.cpp.

Here is the call graph for this function:


Member Function Documentation

QList< StorableData * > domain::User::dependentData (  )  const [private, virtual]

Data objects depending on the existence of a user are:

  • Task objects owned by this user.
  • Invitation objects received by this user.

Reimplemented from domain::StorableData.

Definition at line 78 of file user.cpp.

QList< const Invitation * > domain::User::invitations (  )  const

Returns a list with every Invitation this user has received.

Definition at line 73 of file user.cpp.

bool domain::User::isAdmin (  )  const [virtual]

Indicates whether this user is an administrator.

Returns:
False
See also:
AdminUser

Reimplemented in domain::AdminUser.

Definition at line 90 of file user.cpp.

const QString & domain::User::name (  )  const

Returns the name of this user.

Definition at line 46 of file user.cpp.

QList< const Task * > domain::User::tasks (  )  const

Returns all the Task objects to which this user is assigned

Definition at line 68 of file user.cpp.

UserType * domain::User::userType (  )  const

Returns the UserType of this user.

Definition at line 41 of file user.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:20 2010 for MopTaskManager by  doxygen 1.6.3