Scribus
Open source desktop publishing at your fingertips
MassObservable< OBSERVED > Class Template Reference

#include <observable.h>

Inheritance diagram for MassObservable< OBSERVED >:
Collaboration diagram for MassObservable< OBSERVED >:

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_SignalchangedSignal
 
UpdateManagerm_um
 

Friends

class UpdateManager
 

Detailed Description

template<class OBSERVED>
class MassObservable< OBSERVED >

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.

Member Function Documentation

template<class OBSERVED >
void MassObservable< OBSERVED >::setUpdateManager ( UpdateManager um)
inline

Used if the UpdateManager is not available when the constructor is called

template<class OBSERVED>
void MassObservable< OBSERVED >::update ( OBSERVED  what)
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.

template<class OBSERVED>
void MassObservable< OBSERVED >::updateLayout ( OBSERVED  what)
inlinevirtual

Same as update, except layout will be update immediately

template<class OBSERVED >
void MassObservable< OBSERVED >::updateNow ( UpdateMemento what)
inlineprotectedvirtual

This method will be called by the updatemanager or by update()

Implements UpdateManaged.


The documentation for this class was generated from the following file: