InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SelectionHighlightObserver Class Referenceabstract

#include <SelectionObserver.h>

Inheritance diagram for SelectionHighlightObserver:
CObserverIObserverIPMUnknown

Public Member Functions

 SelectionHighlightObserver (IPMUnknown *boss, PMIID observerIID=IID_IOBSERVER)
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
virtual void Update (const ClassID &c, ISubject *s, const PMIID &p, void *v)
 
- 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
 
virtual void LazyUpdate (ISubject *theSubject, const PMIID &protocol, const LazyNotificationData *data)
 

Protected Member Functions

virtual void AttachToSelectionSubject (ISubject *selectionSubject)
 
virtual void DetachFromSelectionSubject (ISubject *selectionSubject)
 
IPMUnknownQueryAbstractSelection (const PMIID &p)
 
virtual IControlViewQueryControlView ()=0
 

Protected Attributes

PMIID fObserverIID
 
ISelectionManagerfCurrentSelection
 
- Protected Attributes inherited from CObserver
bool16 fDetachSubjectsOnDelete
 
PMIID fAttachIID
 
const UIDRef fThisRef
 
bool16 fEnabled
 

Additional Inherited Members

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

Detailed Description

Selection Highlight Observer observes a single selection object, specifed by each subclass. The QueryControlView() pure virtual is overridden by a subclass to indicate which view's selection to observe.

Member Function Documentation

virtual void SelectionHighlightObserver::AttachToSelectionSubject (ISubjectselectionSubject)
protectedvirtual

DESCR: Attach this observer to the active selection using protocol IID_SELECTION_HIGHLIGHT_MESSAGE.

Parameters
selectionSubjectthe Subject
virtual void SelectionHighlightObserver::AutoAttach ()
virtual

DESCR: Called when this observer should attach to the subject(s) that it observes (the selection owned by the view returned by QueryControlView()).

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

Reimplemented from CObserver.

virtual void SelectionHighlightObserver::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 CObserver.

virtual void SelectionHighlightObserver::DetachFromSelectionSubject (ISubjectselectionSubject)
protectedvirtual

DESCR: Detach this observer from the active selection using protocol IID_SELECTION_HIGHLIGHT_MESSAGE.

Parameters
selectionSubjectthe Subject
IPMUnknown* SelectionHighlightObserver::QueryAbstractSelection (const PMIIDp)
protected

DESCR: Query the abstract selection that this observer is attached to for an interface (or suite).

NOTE: The caller is responsible for calling Release() on the returned interface.

Parameters
pPMIID
Returns
IPMUnknown
virtual void SelectionHighlightObserver::Update (const ClassIDc,
ISubjects,
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 this method to process IID_SELECTION_HIGHLIGHT_MESSAGE messages.

Parameters
cthe Class
sthe Subject
pPMIID
vvoid star

Implements IObserver.