InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CObserver Class Reference

#include <CObserver.h>

Inheritance diagram for CObserver:
IObserverIPMUnknownAbstractDialogObserverActiveSelectionObserverCdlChtUIWidgetObserverCelPnlEditBoxObserverCusCondTxtTreeViewObserverCusDtLnkDocObserverCusDtLnkUITreeNodeObserverCusDtLnkUITreeObserverCustomHttpLinkUIObserverCustomHttpLinkUIPlaceButtonObserverCWidgetObserverDCLSizListBoxObserverGTTxtEdtGoToTextButtonObserverGTTxtEdtNewDeleteStoryObserverGTTxtEdtStoryObserverLnkWtchActiveContextObserverLnkWtchCacheManagerPicIcoRollOverButtonObserverPnlTrvNodeObserverPnlTrvTreeObserverPreflightCheckBoxObserverPreviewableColorListObserverPstLstDocObserverSelectionHighlightObserverSnipRunGoButtonObserverSnipRunPanelWidgetObserverSwatchesObserverTableCellObserverTblAttWidgetObserverTKIPanelWidgetObserverTKITreeWidgetObserverWLBCmpEyeballObserverWLBCmpListBoxObserverWLBCmpPenObserverXDocBkUIDialogObserver

Public Member Functions

 CObserver (IPMUnknown *boss, PMIID interfaceID=IID_IOBSERVER)
 
IChangeManagerGetChangeManager () const
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
virtual void SetAttachIID (PMIID iid)
 
virtual PMIID GetAttachIID () const
 
virtual void SetEnabled (bool16 state)
 
virtual bool16 IsEnabled () const
 
virtual void LazyUpdate (ISubject *theSubject, const PMIID &protocol, const LazyNotificationData *data)
 
- Public Member Functions inherited from IObserver
virtual void Update (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Protected Attributes

bool16 fDetachSubjectsOnDelete
 
PMIID fAttachIID
 
const UIDRef fThisRef
 
bool16 fEnabled
 

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 

Detailed Description

Base class for implementing IObserver. If you are defining a new observer, please inherit from CObserver instead of directly from IObserver.

See IObserver for information about what the methods do.

See Also
ISubject
IObserver

Member Function Documentation

virtual PMIID CObserver::GetAttachIID () const
virtual

Get the interface ID of this observer.

Returns
the interface ID of this observer

Implements IObserver.

virtual bool16 CObserver::IsEnabled () const
virtual

Returns kTrue if this observer is enabled, kFalse otherwise

Implements IObserver.

virtual void CObserver::LazyUpdate (ISubjecttheSubject,
const PMIIDprotocol,
const LazyNotificationDatadata 
)
virtual

Lazy notification of a change in an observed subject; this method is called after the transaction in which the change was performed completes and after undo or redo.

Parameters
theSubjectis the subject that changed
protocolis the interface of the subject's boss that changed
datalazy notification data or nil. Observers must be able to handle a call that has nil data. In certain low memory conditions the lazy notification data passed to ISubject::ModelChange may not be passed on to observers. The observer must be able to work without data in which case the observer would usually refresh its entire state by re-examining all objects of interest. See LazyNotificationData for documentation.
See Also
ISubject::AttachObserver(IObserver*, const PMIID&, AttachmentType) to receive lazy notification attach to the subject by calling this method specifying an attachment type of lazy, or, both if you also want regular notification.
IObserver::Update for regular notification

Implements IObserver.

Reimplemented in LnkWtchActiveContextObserver, CusDtLnkUITreeObserver, PnlTrvTreeObserver, IDHAObserver, LnkWtchCacheManager, CustSEObserver, CusDtLnkDocObserver, and CusCondTxtTreeViewObserver.

virtual void CObserver::SetAttachIID (PMIID iid)
virtual

Set the interface ID of this observer; normally this is IID_IOBSERVER but if there are several observers on a boss they each need to have a different interface ID.

Parameters
iidis the interface ID of this observer

Implements IObserver.

virtual void CObserver::SetEnabled (bool16 state)
virtual

Enable or disable the observer; a disabled observer will not receive an update for a change.

Parameters
statekTrue to enable, kFalse to disable

Implements IObserver.