Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

UpdateManager Class Reference

#include <updatemanager.h>

List of all members.

Public Member Functions

 UpdateManager ()
virtual ~UpdateManager ()
void setUpdatesEnabled (bool val=true)
void setUpdatesDisabled ()
bool updatesEnabled ()
bool requestUpdate (UpdateManaged *observable, UpdateMemento *what)

Private Attributes

int m_updatesDisabled
QSet< QPair< UpdateManaged *,
UpdateMemento * > > 
m_pending


Detailed Description

An UpdateManager controls if and when updates will be propagated to the Observers. Usually each document has one UpdateManager. They are used this way:

When many changes are about to happen, the application calls "setUpdatesDisabled()" before it begins the changes and calls "setUpdatesEnabled()" when it's done.

An Observable calls "requestUpdate(this)". If the result is positive, the Observable calls "updateNow()" directly. Otherwise the UpdateManager stores a reference to the Observable and will call its "updateNow()" method once updates are enabled again.

If "requestUpdate()" is called multiple times before updates are enabled again, each observable will only get one notification with "updateNow()" when the updates are enabled again.

Definition at line 66 of file updatemanager.h.


Constructor & Destructor Documentation

UpdateManager::UpdateManager (  )  [inline]

Definition at line 72 of file updatemanager.h.

UpdateManager::~UpdateManager (  )  [virtual]

Definition at line 15 of file updatemanager.cpp.

References m_pending.


Member Function Documentation

void UpdateManager::setUpdatesEnabled ( bool  val = true  ) 

void UpdateManager::setUpdatesDisabled (  )  [inline]

bool UpdateManager::updatesEnabled (  )  [inline]

Definition at line 77 of file updatemanager.h.

bool UpdateManager::requestUpdate ( UpdateManaged observable,
UpdateMemento what 
)

Returns true if updates are enabled, otherwise stores 'observable' for notification when updates get enabled again.

Definition at line 44 of file updatemanager.cpp.

References m_pending, and m_updatesDisabled.

Referenced by MassObservable< OBSERVED >::update().


Member Data Documentation

Definition at line 68 of file updatemanager.h.

Referenced by requestUpdate(), and setUpdatesEnabled().

Definition at line 69 of file updatemanager.h.

Referenced by requestUpdate(), setUpdatesEnabled(), and ~UpdateManager().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.