Scribus
Open source desktop publishing at your fingertips
|
#include <observable.h>
Public Member Functions | |
MassObservable (UpdateManager *um=NULL) | |
void | setUpdateManager (UpdateManager *um) |
virtual void | update (OBSERVED what) |
virtual void | updateLayout (OBSERVED what) |
void | connectObserver (Observer< OBSERVED > *o) |
void | disconnectObserver (Observer< OBSERVED > *o) |
bool | connectObserver (QObject *o, const char *slot) |
bool | disconnectObserver (QObject *o, const char *slot=0) |
Protected Member Functions | |
virtual void | updateNow (UpdateMemento *what) |
Protected Attributes | |
QSet< Observer< OBSERVED > * > | m_observers |
Private_Signal * | changedSignal |
UpdateManager * | m_um |
Friends | |
class | UpdateManager |
An MassObservable is basically just the source of a changed() signal. Observers can register via the Qt signal/slot mechanism or via the above interface.
The difference to Observable (below) is that a MassObservable doesnt report changes to itself but to a bunch of SingleObservables. When you call update() on the SingleObservable, it will tell the associated MassObservable to notify all observers with the "changed" signal, providing a pointer to the single Observable.
The class parameter OBSERVED is usually a pointer to a subclass of SingleObservable.
MassObservable does not inherit QObject since that makes it difficult to use it as a mixin class.
|
inline |
Used if the UpdateManager is not available when the constructor is called
|
inlinevirtual |
This method will be called by the SingleObservable. If updates are enabled, it calls updateNow() directly, otherwise the undomanager will take care of that.
|
inlinevirtual |
Same as update, except layout will be update immediately
|
inlineprotectedvirtual |
This method will be called by the updatemanager or by update()
Implements UpdateManaged.