![]() | InDesign SDK 20.5 |
#include <IChangeManager.h>

Public Types | |
| enum | { kDefaultIID = IID_ICHANGEMANAGER } |
Public Member Functions | |
| virtual void | AddDependency (ISubject *subject, IObserver *observer, const PMIID &observerIID, const PMIID &interestedIn, bool lazy)=0 |
| virtual void | RemoveDependency (ISubject *subject, IObserver *observer, const PMIID &observerIID, const PMIID &interestedIn, bool lazy)=0 |
| virtual bool16 | HasDependency (ISubject *subject, IObserver *observer, const PMIID &observerIID, const PMIID &interestedIn, bool lazy)=0 |
| virtual void | RemoveSubject (ISubject *theSubject)=0 |
| virtual void | RemoveObserver (IObserver *theObserver, const PMIID &observerIID)=0 |
| virtual void | RemoveSubject (const UIDRef &theSubject)=0 |
| virtual void | RemoveObserver (const UIDRef &theObserver, const PMIID &observerIID)=0 |
| virtual void | SubjectChanged (ISubject *subject, ClassID theChange, const PMIID &interestedIn, void *changedBy)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
For Internal Use Only | |
| virtual void | SubjectChanged (ISubject *originalSubject, ISubject *subject, ClassID theChange, const PMIID &interestedIn, void *changedBy)=0 |
| virtual void | SubjectModelChanged (ISubject *subject, IDataBase *model, ClassID theChange, const PMIID &interestedIn, void *changedBy, LazyNotificationData *data)=0 |
| virtual void | SubjectModelChanged (ISubject *originalSubject, ISubject *subject, IDataBase *model, ClassID theChange, const PMIID &interestedIn, void *changedBy, LazyNotificationData *data)=0 |
| virtual void | LazySubjectChanged (ISubject *subject, const PMIID &interestedIn, const LazyNotificationData *data)=0 |
| virtual bool16 | CanSendMessage () const =0 |
| IChangeManager () | |
This is an interface to the change manager, which manages subject/observer relationships, and subject/observer notifications. You should not need to access this class directly unless you are implementing a new subject type (which is quite unusual). Normally, all interaction with the messaging system is either through ISubject or IObserver.
| pure virtual |
Register an observer as a dependent of the subject. Normally this is called for you from ISubject::AttachObserver.
| subject | the subject to attach the observer to |
| observer | the observer to attach |
| observerIID | the IID the change manager should use to access the observer |
| interestedIn | the type of change this observer wants to be notifed about |
| pure virtual |
Returns true if it's OK to send a message. Check this before doing anything that might cause a SubjectChanged() during a purge operation. If the purge originated from the change manager, it will cause a fatal error to send the message. In that case, you can prevent it by calling CanSendMessage, which will return false if the change manager is in the middle of handling an add or remove and cannot send a message.
| pure virtual |
Determine if a dependency already exists
| subject | the subject we're asking about |
| observer | the observer we're asking about |
| observerIID | which observer(in case the boss has multiple) to check for |
| interestedIn | the type of change this observer originally registered for |
| pure virtual |
Remove an observer as a dependent of the subject. Normally this is called for you from ISubject::DetachObserver. If an observer is attached in multiple ways to the same subject (e.g. for multiple protocols) this detaches only one attachment relationship and leaves the others unchanged.
| subject | the subject to detach the observer from |
| observer | the observer to attach |
| observerIID | which observer(in case the boss has multiple) to detach |
| interestedIn | the type of change this observer originally registered for |
| pure virtual |
Remove all dependencies that reference this observer
| observer | the observer we're asking about |
| observerIID | which observer(in case the boss has multiple) to remove |
| pure virtual |
Remove all dependencies that reference this observer
| theObserver | the observer we're asking about |
| observerIID | which observer(in case the boss has multiple) to remove |
| pure virtual |
Remove all dependencies that reference this subject
| pure virtual |
Remove all dependencies that reference the subject.
| pure virtual |
Notifies dependents of "notifier" that it has changed. This is normally called by ISubject::Change, and will iterate over the observers that are attached to the subject (if there are any) and call their Update functions.
| subject | that changed (specifies which observers to call) |
| theChange | type of the change, often a ClassID of a command |
| interestedIn | specifies the interface the change affected |
| changedBy | the change agent (may be nil; but often this is the command that initiated the broadcast) |