An interface for all the controllers. More...
#include <controllerinterface.h>
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::User * | user () 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::TaskManagerData * | data |
ui::UiInterface * | ui |
Private Member Functions | |
virtual void | execute ()=0 |
virtual void | execute (const domain::StorableData *data) |
virtual bool | userIsValid () const =0 |
bool | checkUser () const |
An interface for all the controllers.
Definition at line 24 of file controllerinterface.h.
virtual ActionType control::ControllerInterface::actionType | ( | ) | const [pure virtual] |
Returns the action type of the controller
Implemented in control::ClockAdjuster, control::DataLoader, control::DataSaver, control::InvitationManager, control::InvitationReplier, control::OverviewShower, control::ProjectAssigner, control::ProjectCreator, control::ProjectRemover, control::ResourceCreator, control::ResourceReservationMaker, control::SelectUser, control::TaskCreator, control::TaskDetailsShower, control::TaskModifier, control::TaskRemover, control::TaskUpdater, control::TaskWorker, control::ThemeLoader, and control::UserCreator.
QString control::ControllerInterface::actionTypeString | ( | ) | const |
Returns a string for the action type of the controller
Definition at line 79 of file controllerinterface.cpp.
virtual DataType control::ControllerInterface::dataType | ( | ) | const [pure virtual] |
Returns the data type on which the controller acts
Implemented in control::ClockAdjuster, control::DataLoader, control::DataSaver, control::InvitationManager, control::InvitationReplier, control::OverviewShower, control::ProjectAssigner, control::ProjectCreator, control::ProjectRemover, control::ResourceCreator, control::ResourceReservationMaker, control::SelectUser, control::TaskCreator, control::TaskDetailsShower, control::TaskModifier, control::TaskRemover, control::TaskUpdater, control::TaskWorker, control::ThemeLoader, and control::UserCreator.
QString control::ControllerInterface::dataTypeString | ( | ) | const |
Returns a string for the data type of the controller
Definition at line 74 of file controllerinterface.cpp.
virtual QString control::ControllerInterface::description | ( | ) | const [pure virtual] |
Returns the description of the controller
Implemented in control::ClockAdjuster, control::DataLoader, control::DataSaver, control::InvitationManager, control::InvitationReplier, control::OverviewShower, control::ProjectAssigner, control::ProjectCreator, control::ProjectRemover, control::ResourceCreator, control::ResourceReservationMaker, control::SelectUser, control::TaskCreator, control::TaskDetailsShower, control::TaskModifier, control::TaskRemover, control::TaskUpdater, control::TaskWorker, control::ThemeLoader, and control::UserCreator.
void ControllerInterface::execute | ( | const domain::StorableData * | data | ) | [private, virtual] |
Executes a use case for a given object
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] |
Executes a whole use case
Implemented in control::ClockAdjuster, control::DataLoader, control::DataSaver, control::InvitationManager, control::InvitationReplier, control::OverviewShower, control::ProjectAssigner, control::ProjectCreator, control::ProjectRemover, control::ResourceCreator, control::ResourceReservationMaker, control::SelectUser, control::TaskCreator, control::TaskDetailsShower, control::TaskModifier, control::TaskRemover, control::TaskUpdater, control::TaskWorker, control::ThemeLoader, and control::UserCreator.
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
data | Pointer to TaskManagerData object | |
ui | Pointer to a user interface | |
factory | Pointer to a controller factory |
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] |
Returns the name of the controller
Implemented in control::ClockAdjuster, control::DataLoader, control::DataSaver, control::InvitationManager, control::InvitationReplier, control::OverviewShower, control::ProjectAssigner, control::ProjectCreator, control::ProjectRemover, control::ResourceCreator, control::ResourceReservationMaker, control::SelectUser, control::TaskCreator, control::TaskDetailsShower, control::TaskModifier, control::TaskRemover, control::TaskUpdater, control::TaskWorker, control::ThemeLoader, and control::UserCreator.
void ControllerInterface::run | ( | const domain::StorableData * | data | ) | [slot] |
Executes a use case for a given object, including a user rights check.
data | Data that has to be executed |
Definition at line 28 of file controllerinterface.cpp.
void ControllerInterface::run | ( | ) | [slot] |
Executes a whole use case, including a user rights check.
Definition at line 22 of file controllerinterface.cpp.
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
StringException | If there are no users in de database |
Definition at line 116 of file controllerinterface.cpp.
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.