InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDHAObserver Class Reference
Inheritance diagram for IDHAObserver:
ActiveSelectionObserverCObserverIObserverIPMUnknown

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 
- Protected Member Functions inherited from ActiveSelectionObserver
virtual void HandleSelectionChanged (const ISelectionMessage *)
 
virtual void HandleFrequentSelectionChanged ()
 
virtual void HandleSelectionAttributeChanged (const ISelectionMessage *)
 
virtual void AttachToSelectionSubject (ISubject *selectionSubject)
 
virtual void DetachFromSelectionSubject (ISubject *selectionSubject)
 
virtual void HandleActiveSelectionChanged ()
 
virtual IPMUnknownQueryAbstractSelection (const PMIID &p)
 
virtual void AttachToActiveSelection ()
 
virtual void DetachFromActiveSelection ()
 
- Protected Attributes inherited from ActiveSelectionObserver
PMIID fObserverIID
 
ISelectionManagerfCurrentSelection
 

Detailed Description

Observes document and workspace for necessary events, and dispatches them to the scripting layer so CSAW can use them

Member Function Documentation

void IDHAObserver::AutoAttach ()
virtual

Called when this observer should attach to the subject(s) that it observes (Active Context and Active Abstract Selection).

NOTE: Subclasses should override AttachToSelectionSubject() to attach to the the active selection using their own protocol(s). Subclasses which override this method should call the inherited method prior to attaching to their own specific protocols.

Reimplemented from ActiveSelectionObserver.

void IDHAObserver::AutoDetach ()
virtual

DESCR: Called when this observer should automatically detach from the subject(s) that it observes.

NOTE: Subclasses should override DetachFromSelectionSubject() to detach from the the active selection using their own protocol(s). Subclasses which override this method should call the inherited method after detaching from their own specific protocols.

Reimplemented from ActiveSelectionObserver.

void IDHAObserver::HandleSelectionUpdate (const ClassIDc,
ISubjects,
const PMIIDp,
void * v 
)
virtual

DESCR: Called when the observer receives a broadcast other than those from the active context. i.e. a message from the active selection boss itself, which a subclass attached to using a protocol of its choice. All of the broadcast information is passed through.

        Processes IID_SELECTION_MESSAGE messages, calling HandleSelectionChanged(),

HandleFrequentSelectionChanged() or HandleSelectionAttributeChanged() as appropriate.

NOTE: Subclasses should override this member function only if they attach to additional protocols. If overridden, the subclass should call the inherited method prior to handling the message. Do NOT override Update w/o a very good reason.

Parameters
cthe Class
sthe Subject
pPMIID
vvoid star

Reimplemented from ActiveSelectionObserver.

void IDHAObserver::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

Reimplemented from CObserver.

void IDHAObserver::Update (const ClassIDc,
ISubject,
const PMIIDp,
void * v 
)
virtual

DESCR: Handle updates to the observer. When the active abstract selection boss changes, detach from the old and attach to the new. Other broadcasts (i.e. those from the selection boss) are passed to HandleSelectionUpdate().

NOTE: Subclasses should override HandleSelectionUpdate() rather than this method.

Parameters
cClassID
pPMIID
vvoid star

Reimplemented from ActiveSelectionObserver.