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

Public Member Functions

 SnipRunGoButtonObserver (IPMUnknown *boss)
 
virtual ~SnipRunGoButtonObserver ()
 
virtual void AutoAttach ()
 
virtual void AutoDetach ()
 
virtual void Update (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy)
 
- 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)
 

Additional Inherited Members

- Public Types inherited from IObserver
enum  { kDefaultIID = IID_IOBSERVER }
 
- Protected Attributes inherited from CObserver
bool16 fDetachSubjectsOnDelete
 
PMIID fAttachIID
 
const UIDRef fThisRef
 
bool16 fEnabled
 

Detailed Description

Runs the snippet when the go button is clicked, also when the name of the snippet to be run is changed this observer uses ISnipRunSuite::CanRun to determine if the snippet can run and enables or disables the button accordingly.

The name of the snippet this implementation works with is given by the IStringData interface aggregated onto this control's boss class as IID_ISNIPRUNSNIPPETNAMESTRINGDATA. To get this observer to recognise a change to this data client code should call this button's ISubject as shown:


ISubject::Change(kTextChangeStateMessage, IID_ISNIPRUNSNIPPETNAMESTRINGDATA);

Implements IObserver based on the partial implementation CObserver.

Constructor & Destructor Documentation

SnipRunGoButtonObserver::SnipRunGoButtonObserver (IPMUnknownboss)

Constructor.

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

Destructor

Member Function Documentation

void SnipRunGoButtonObserver::AutoAttach (void )
virtual

Attaches observed subjects. Observes the button's ITriStateControlData to catch clicks and the IID_ISNIPRUNSNIPPETNAMESTRINGDATA to catch when the name of the snippet to be run changes.

Reimplemented from CObserver.

void SnipRunGoButtonObserver::AutoDetach (void )
virtual

Detaches observed subjects.

Reimplemented from CObserver.

void SnipRunGoButtonObserver::Update (const ClassIDtheChange,
ISubjecttheSubject,
const PMIIDprotocol,
void * changedBy 
)
virtual

An observed subject has changed.

Implements IObserver.