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

#include <iresponder.h>

Inheritance diagram for IResponder:
IPMUnknownCResponderBPIDefaultResponderBscTADocResponderCusCondTxtResponderCusDtLnkDocResponderCusDtLnkLinkResponderCusDtLnkPhase2ConversionDocWchResponderFrmlLblResponderGTTxtEdtResponderIDHAResponderLnkWtchDocResponderPstLstDocResponderPstLstPhase2ConversionTranFxResponder

Public Types

enum  { kDefaultIID = IID_IRESPONDER }
 

Public Member Functions

virtual ServiceID GetResponderService ()=0
 
virtual void Respond (ISignalMgr *signalMgr)=0
 
virtual void SignalFailed (ISignalMgr *signalMgr)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

IResponder is used to recieve a Signal.

The Signal/Responder protocol is used particularly for broadcasting model changes, but is used anytime the listener doesn't care what object changed, but is intererested in finding out about all changes of a certain class. IResponder is implemented in order to receive a message. The IReponder implementation can be added to any boss, but since the SignalMgr uses the ServiceID to locate the responder, the responder's boss will have to also have an

See Also
IK2ServiceProvider implementation that uses the serviceID of the message type. Typically a responder that handles a single type of message can use kResponderServiceProviderImpl for the IK2ServiceProvider. Note that the threading policy for a responder is dictated by the threading policy of the service provider it is associated with (
IK2ServiceProvider::GetThreadingPolicy comments). All implementations of IResponder should inherit from CResponder.
CResponder
ISignalMgr

Member Function Documentation

virtual ServiceID IResponder::GetResponderService ()
pure virtual

Returns the ServiceID that this responder should get notified on. This is used to allow the default responder to service to work. If you have a responder that handles multiple message types, leave this returning kInvalidService, but supply your own implementation of IK2ServiceProvider that can handle the multiple services.

Returns
ServiceID identifies what type of message the responder is interested in

Implemented in CResponder.

virtual void IResponder::Respond (ISignalMgrsignalMgr)
pure virtual

Respond to the signal. If there's an error, set the global error state to cancel the associated action. If you have one responder that depends on another responder having already been signalled, use the SignalMgr::SignalResponder to signal the other responder. The SignalMgr will call the other responder immediately, and will know later on that that responder has already been called. The responder may find it handy to query the signalMgr for a data interface that contains more information about the action.

Parameters
signalMgrthe signalMgr that sent the signal

Implemented in GTTxtEdtResponder, PstLstPhase2Conversion, LnkWtchDocResponder, CusCondTxtResponder, PstLstDocResponder, BscTADocResponder, FrmlLblResponder, CusDtLnkDocResponder, BPIDefaultResponder, IDHAResponder, DocWchResponder, TranFxResponder, CusDtLnkLinkResponder, CusDtLnkPhase2Conversion, and CResponder.

virtual void IResponder::SignalFailed (ISignalMgrsignalMgr)
pure virtual

Handle errors that come up during signalling. If the action has been cancelled, and the reponder has already been called, the SignalMgr will call the reponder again, to let it know that the action is cancelled. For instance, suppose that there are 14 observers, and 10 have been called when the eleventh sets the error state. Then the remaining three are not called, and the first 10's SignalError get called. If the responder has attached observers, these should be detached here.

Parameters
signalMgrthe signalMgr that sent the signal

Implemented in CResponder.