Scribus
Open source desktop publishing at your fingertips
UpdateManager Class Reference

#include <updatemanager.h>

Public Member Functions

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

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.

Member Function Documentation

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

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


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