#include <abstractcontroller.h>
Inheritance diagram for AbstractController:

Public Member Functions | |
| AbstractController (QObject *objectPtr) | |
| virtual | ~AbstractController () |
| AbstractModel * | model () const |
| void | setModel (AbstractModel *model) |
| const AbstractViewSet & | views () const |
| void | attachView (AbstractView *view) |
| void | detachView (AbstractView *view) |
Protected Member Functions | |
| virtual void | dispatchEvent (CEvent *) |
| virtual void | changeModelEvent (CChangeModelEvent *) |
| virtual void | viewAttachEvent (CViewAttachEvent *) |
| virtual void | viewDetachEvent (CViewDetachEvent *) |
| virtual void | detachAllViewsEvent (CEvent *) |
| AbstractController::AbstractController | ( | QObject * | objectPtr | ) |
Constructs an abstract controller.
| AbstractController::~AbstractController | ( | ) | [virtual] |
Destroys the abstract controller.
If the model() is non-null, then a MChangeControllerEvent will be posted to it with null (0) as the parameter. Likewise, a VChangeControllerEvent will be posted with null (0) as the parameter to each of the attached views().
| AbstractModel * AbstractController::model | ( | ) | const |
| void AbstractController::setModel | ( | AbstractModel * | model | ) |
Convenience method.
Posts a CChangeModelEvent to itself with the given model.
| const AbstractViewSet& AbstractController::views | ( | ) | const [inline] |
| void AbstractController::attachView | ( | AbstractView * | view | ) |
Convenience method.
Posts a CViewAttachEvent to itself with the given view.
| void AbstractController::detachView | ( | AbstractView * | view | ) |
Convenience method.
Posts a CViewDetachEvent to itself with the given view.
| void AbstractController::dispatchEvent | ( | CEvent * | event | ) | [protected, virtual] |
The controller's event dispatcher.
Asserts that the event is non-null.
Warning! It is assumed that the events have their correct type set (as it uses static casts).
Reimplemented in AttributeDocController, DocController, ElementDocController, DiagramController, DigestDbController, and SettingsController.
| void AbstractController::changeModelEvent | ( | CChangeModelEvent * | event | ) | [protected, virtual] |
Changes the model that the controller is to operate on.
If the model() is non-null, this will post a MChangeControllerEvent to it and a VModelChangedEvent to all attached views().
Asserts that the event is non-null.
Reimplemented in AttributeDocController, DocController, ElementDocController, DiagramController, DigestDbController, and SettingsController.
| void AbstractController::viewAttachEvent | ( | CViewAttachEvent * | event | ) | [protected, virtual] |
Attaches a view to the controller.
Posts a VChangeControllerEvent to the view. However, a VModelChangedEvent is not sent. After receiving the former, the view should post the latter to itself.
Duplicates will be implicitly ignored, as the AbstractView pointers are stored in a QSet.
Asserts that both the event and the view event->view() are non-null.
| void AbstractController::viewDetachEvent | ( | CViewDetachEvent * | event | ) | [protected, virtual] |
Detaches a view from the controller.
Asserts that the event is non-null.
| void AbstractController::detachAllViewsEvent | ( | CEvent * | ) | [protected, virtual] |
Detaches all views from the controller.
1.5.2