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

Public Member Functions

 BPISelectionObserver (IPMUnknown *boss)
 
virtual ~BPISelectionObserver ()
 
- Public Member Functions inherited from ActiveSelectionObserver
 ActiveSelectionObserver (IPMUnknown *boss, PMIID observerIID=IID_IOBSERVER)
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
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 HandleSelectionChanged (const ISelectionMessage *message)
 
virtual void HandleSelectionAttributeChanged (const ISelectionMessage *message)
 
void UpdatePanel ()
 
- Protected Member Functions inherited from ActiveSelectionObserver
virtual void HandleFrequentSelectionChanged ()
 
virtual void AttachToSelectionSubject (ISubject *selectionSubject)
 
virtual void DetachFromSelectionSubject (ISubject *selectionSubject)
 
virtual void HandleActiveSelectionChanged ()
 
virtual void HandleSelectionUpdate (const ClassID &c, ISubject *s, const PMIID &p, void *v)
 
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 a selection observer, IObserver based on ActiveSelectionObserver, that updates the user interface when the selection changes by calling IBPISuite to access the IBPIData associated with the selection.

When the active selection changes (from text selection to layout selection for example), or when an object is added or removed from the selection or when an attribute of selected objects change this observer gets called. It then determines if it needs to update the data in its widgets to reflect the IBPIData associated with the selection.

Constructor & Destructor Documentation

BPISelectionObserver::BPISelectionObserver (IPMUnknownboss)

Constructor.

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

Destructor.

Member Function Documentation

void BPISelectionObserver::HandleSelectionAttributeChanged (const ISelectionMessagemessage)
protectedvirtual

If the selection's data changes this method gets called. We check that data we are interested in is affected before taking any action by calling ISelectionMessage::WasSuiteAffected and checking that a message from IBPISuite is present. If so we update the data in the panel's widgets to reflect that of the selection.

Parameters
messagefrom selection indicating the attribute(s) affected

Reimplemented from ActiveSelectionObserver.

void BPISelectionObserver::HandleSelectionChanged (const ISelectionMessagemessage)
protectedvirtual

When an object is added or removed from the selection or if the kind of selection changes (e.g. from a a layout selection to a text selection) this method is called which results in BPISelectionObserver::UpdatePanel being called.

Parameters
messagefrom selection describing change or nil if the active selection changed.

Reimplemented from ActiveSelectionObserver.

void BPISelectionObserver::UpdatePanel ()
protected

Update the panel to reflect selection's IBPISuite data.