control::ControllerInterface Class Reference

An interface for all the controllers. More...

#include <controllerinterface.h>

Inheritance diagram for control::ControllerInterface:
Inheritance graph
[legend]
Collaboration diagram for control::ControllerInterface:
Collaboration graph
[legend]

List of all members.

Public Types

enum  ActionType {
  LoadDataAction,
  LoadThemeAction,
  SaveAction,
  CreateAction,
  RemoveAction,
  ModifyAction,
  AssignAction,
  UpdateAction,
  ManageAction,
  SelectAction,
  ViewAction,
  FocusAction,
  CustomAction
}
enum  DataType {
  FileData,
  TaskData,
  ResourceData,
  ProjectData,
  ReservationData,
  UserData,
  InvitationData,
  NoData
}

Public Slots

void run ()
void run (const domain::StorableData *data)

Public Member Functions

virtual QString description () const =0
virtual QString name () const =0
virtual DataType dataType () const =0
virtual ActionType actionType () const =0
QString dataTypeString () const
QString actionTypeString () const
virtual bool userCanExecute () const
virtual void init (domain::TaskManagerData *data, ui::UiInterface *ui, ControllerFactory *factory)
const domain::Useruser () const

Static Public Member Functions

static QString actionTypeToString (ActionType type)
static QString dataTypeToString (DataType type)

Protected Member Functions

bool userHasLoggedIn () const
bool userIsAdmin () const

Protected Attributes

domain::TaskManagerDatadata
ui::UiInterfaceui

Private Member Functions

virtual void execute ()=0
virtual void execute (const domain::StorableData *data)
virtual bool userIsValid () const =0
bool checkUser () const

Detailed Description

An interface for all the controllers.

Definition at line 24 of file controllerinterface.h.


Member Function Documentation

virtual ActionType control::ControllerInterface::actionType (  )  const [pure virtual]
QString control::ControllerInterface::actionTypeString (  )  const

Returns a string for the action type of the controller

Definition at line 79 of file controllerinterface.cpp.

Here is the call graph for this function:

virtual DataType control::ControllerInterface::dataType (  )  const [pure virtual]
QString control::ControllerInterface::dataTypeString (  )  const

Returns a string for the data type of the controller

Definition at line 74 of file controllerinterface.cpp.

Here is the call graph for this function:

virtual QString control::ControllerInterface::description (  )  const [pure virtual]
void ControllerInterface::execute ( const domain::StorableData data  )  [private, virtual]

Executes a use case for a given object

Parameters:
data Data that has to be executed

Reimplemented in control::ProjectRemover, control::TaskModifier, control::TaskRemover, control::TaskUpdater, and control::TaskWorker.

Definition at line 34 of file controllerinterface.cpp.

virtual void control::ControllerInterface::execute (  )  [private, pure virtual]
void ControllerInterface::init ( domain::TaskManagerData data,
ui::UiInterface ui,
ControllerFactory factory 
) [virtual]

Initiates the controller with a pointer to a TaskManagerData object, a user interface and a controller factory

Parameters:
data Pointer to TaskManagerData object
ui Pointer to a user interface
factory Pointer to a controller factory
See also:
domain::TaskManagerData, ui::UiInterface, ControllerFactory

Reimplemented in control::DataLoader, control::DataSaver, control::OverviewShower, control::ProjectRemover, control::TaskWorker, and control::ThemeLoader.

Definition at line 15 of file controllerinterface.cpp.

virtual QString control::ControllerInterface::name (  )  const [pure virtual]
void ControllerInterface::run ( const domain::StorableData data  )  [slot]

Executes a use case for a given object, including a user rights check.

Parameters:
data Data that has to be executed

Definition at line 28 of file controllerinterface.cpp.

Here is the call graph for this function:

void ControllerInterface::run (  )  [slot]

Executes a whole use case, including a user rights check.

Definition at line 22 of file controllerinterface.cpp.

Here is the call graph for this function:

const domain::User * control::ControllerInterface::user (  )  const

Returns the user that is set in the user interface. If no user is set, the select user use case will be executed

Exceptions:
StringException If there are no users in de database
Returns:
The current user of the interface if a user is set
0 otherwise

Definition at line 116 of file controllerinterface.cpp.

Here is the call graph for this function:

bool ControllerInterface::userCanExecute (  )  const [virtual]

Indicates whether the user should be able to execute this use case directly (ie wether it should show up in a menu).

Reimplemented in control::OverviewShower.

Definition at line 111 of file controllerinterface.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:06 2010 for MopTaskManager by  doxygen 1.6.3