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

Public Member Functions

 StrMutSelectionObserver (IPMUnknown *boss)
 
virtual ~StrMutSelectionObserver ()
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
- Public Member Functions inherited from ActiveSelectionObserver
 ActiveSelectionObserver (IPMUnknown *boss, PMIID observerIID=IID_IOBSERVER)
 
virtual void Update (const ClassID &c, ISubject *, 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 HandleSelectionUpdate (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)
 
virtual void HandleSelectionChanged (const ISelectionMessage *selectionMessage)
 
virtual void HandleSelectionAttributeChanged (const ISelectionMessage *selectionMessage)
 
- Protected Member Functions inherited from ActiveSelectionObserver
virtual void HandleFrequentSelectionChanged ()
 
virtual void AttachToSelectionSubject (ISubject *selectionSubject)
 
virtual void DetachFromSelectionSubject (ISubject *selectionSubject)
 
virtual void HandleActiveSelectionChanged ()
 
virtual IPMUnknownQueryAbstractSelection (const PMIID &p)
 
virtual void AttachToActiveSelection ()
 
virtual void DetachFromActiveSelection ()
 

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 
- Protected Attributes inherited from ActiveSelectionObserver
PMIID fObserverIID
 
ISelectionManagerfCurrentSelection
 

Detailed Description

Implements an observer, IObserver based on ActiveSelectionObserver, that updates the stroke weight displayed in the panel's widget when the stroke weight of the selected objects change, and updates the stroke weight of the selected objects when the user changes the value of the panel's stroke weight widget.

The panel's stroke weight widget is maintained in a way that mimics the value displayed in the Stroke Weight panel.

The implementation shows how to specialise ActiveSelectionObserver so that widgets can be observed in addition to the selection within within a single observer implementation.

IStrokeAttributeSuite is used to get and change the stroke weight which is maintained by a widget on the panel. IGraphicAttributeSuite is used to determine if the stroke is being actively drawn or not.

See Also
IStrokeAttributeSuite
IGraphicAttributeSuite

Constructor & Destructor Documentation

StrMutSelectionObserver::StrMutSelectionObserver (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.
StrMutSelectionObserver::~StrMutSelectionObserver ()
virtual

Destructor.

Member Function Documentation

void StrMutSelectionObserver::AutoAttach (void )
virtual

Attaches observer to the panel's widget and calls parent class to attach to the active selection.

Reimplemented from ActiveSelectionObserver.

void StrMutSelectionObserver::AutoDetach (void )
virtual

Detaches observer from the panel's widget and calls parent class to detach from the active selection.

Reimplemented from ActiveSelectionObserver.

void StrMutSelectionObserver::HandleSelectionAttributeChanged (const ISelectionMessageselectionMessage)
protectedvirtual

Called when a property of the selection changes, stroke weight or color for example. Note: It is important that client code examine the message parameter and only update when data that the client needs has changed. The client can be called when data that it is not interested in changes and it is important for performance reasons that these calls are filtered so that unnecessary updates don't take place.

Parameters
selectionMessageclient code must examine the message and only update when a message is received from the suite that manages the properties that are being displayed.

Reimplemented from ActiveSelectionObserver.

void StrMutSelectionObserver::HandleSelectionChanged (const ISelectionMessageselectionMessage)
protectedvirtual

Called when there is a new active selection or when objects are added or removed from the selection.

Parameters
selectionMessageIN message from the selection about the change, if the pointer is nil then widgets must be updated to synchronise with the new selection, otherwise the client can examine the message to see if the change that has taken place requires them to update.

Reimplemented from ActiveSelectionObserver.

void StrMutSelectionObserver::HandleSelectionUpdate (const ClassIDtheChange,
ISubjecttheSubject,
const PMIIDprotocol,
void * changedBy 
)
protectedvirtual

Called when the observed subjects change, in this case when the panel's widget is changed or when the active selection changes. Events resulting from widget clicks are handled here, selection events are passed to the parent class.

Parameters
theChangespecifies the class ID of the change to the subject. Frequently this is a command ID.
theSubjectpoints to the ISubject interface for the subject that has changed.
protocolspecifies the ID of the changed interface on the subject boss.
changedBypoints to additional data about the change. Often this pointer indicates the class ID of the command that has caused the change.

Reimplemented from ActiveSelectionObserver.