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

#include <BPISuiteCSB.h>

Inheritance diagram for BPISuiteCSB:
CPMUnknown< IBPISuite >IBPISuiteIPMUnknownBPISuiteDefaultCSBBPISuiteLayoutCSBBPISuiteTextCSB

Public Member Functions

 BPISuiteCSB (IPMUnknown *boss)
 
virtual ~BPISuiteCSB (void)
 
virtual bool16 CanApplyBPIData (void)
 
virtual ErrorCode ApplyBPIData (const WideString &value)
 
virtual bool16 CanGetBPIData (void)
 
virtual void GetBPIData (K2Vector< WideString > &values)
 
virtual void Startup (void)
 
virtual void Shutdown (void)
 
virtual void SelectionChanged (SuiteBroadcastData *, const PMIID &, void *)
 
virtual void SelectionAttributeChanged (SuiteBroadcastData *, const PMIID &, void *)
 
virtual void HandleIntegratorSuiteMessage (void *, const ClassID &, ISubject *, const PMIID &, void *)
 
virtual ProtocolCollectionCreateObserverProtocolCollection (void)
 
- Public Member Functions inherited from CPMUnknown< IBPISuite >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Member Functions

virtual UIDList GetTarget (void)=0
 
- Protected Member Functions inherited from CPMUnknown< IBPISuite >
 CPMUnknown (IPMUnknown *boss)
 

Additional Inherited Members

- Public Types inherited from IBPISuite
enum  { kDefaultIID = IID_IBPISUITE }
 
- Protected Attributes inherited from CPMUnknown< IBPISuite >
HelperInterface fHelperInterface
 

Detailed Description

Base class for CSB (concrete selection boss) suite implementations of IBPISuite; the CSB suites are responsible for doing all of the model specific work involved in accessing and manipulating IBPIData. 99% of the CSB suite implementation of IBPISuite is provided here in this base class.

Sub-classes implement BPISuiteCSB::GetTarget to examine the selection target for their CSB and determine the UID's of selected objects that have an IBPIData interface. For example BPISuiteLayoutCSB uses ILayoutTarget to get a UIDList of selected objects and BPISuiteTextCSB uses ITextTarget to get the range of text and the story that underlies the selection and it then figures out the UIDList of frame page items touched by the text selection that have IBPIData.

Note that the client does not interact with the CSB suite directly, the client interacts with the ASB only. The implementation of a CSB suite deals with the selection format of its CSB.

The CSB suite implementations are advanced i.e. they implement a selection extension. A selection extension is needed to support notification when the selection changes or a selection attribute (in this case IBPIData) changes. Please refer to the Selection fundamentals chapter in Programming Guide for more information on selection extensions.

See Also
Selection fundamentals chapter in Programming Guide

Constructor & Destructor Documentation

BPISuiteCSB::BPISuiteCSB (IPMUnknownboss)

Constructor.

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

Destructor.

Member Function Documentation

ErrorCode BPISuiteCSB::ApplyBPIData (const WideStringvalue)
virtual
bool16 BPISuiteCSB::CanApplyBPIData (void )
virtual
bool16 BPISuiteCSB::CanGetBPIData (void )
virtual
ProtocolCollection * BPISuiteCSB::CreateObserverProtocolCollection (void )
virtual

Each suite must define the protocols that contain the attributes that they care about. The Layout CSB's selection attribute observer asks each suite with a selection extension for a list of protocols to observer on the document. Thereby, allowing all suites to share a single observer. When a document broadcast occurs with the specified protocol, the suite must first determine if the command affects the selection by comparing the commands target to the LayoutTarget (This is necessary because all commands don't use the UIDList for page items.).

void BPISuiteCSB::GetBPIData (K2Vector< WideString > & values)
virtual
virtual UIDList BPISuiteCSB::GetTarget (void )
protectedpure virtual

Each CSB suite examines its target interface (ILayoutTarget, ITextTarget etc.) and returns the list of objects that are selected and might have IBPIData.

Returns
a list of the objects that are selected.

Implemented in BPISuiteTextCSB, BPISuiteDefaultCSB, and BPISuiteLayoutCSB.

void BPISuiteCSB::HandleIntegratorSuiteMessage (void * message,
const ClassID,
ISubject,
const PMIID,
void *  
)
virtual

This is only supported on the ASB and is rarely used.

void BPISuiteCSB::SelectionAttributeChanged (SuiteBroadcastDatabroadcastData,
const PMIIDmessageID,
void * message 
)
virtual

This function is called when an attribute of the selection has changed. It is only called on the CSB whose selection attribute has changed. For the layout CSB an ProtocolCollection must be supplied first.

void BPISuiteCSB::SelectionChanged (SuiteBroadcastDatabroadcastData,
const PMIIDmessageID,
void * message 
)
virtual

This function is called when an item is added to or removed from the selection. Suites on the changing CSB and the ASB are called.

void BPISuiteCSB::Shutdown (void )
virtual

This function is called when the selection sub-system shuts down. Any suite termination code can be placed in this funciton. Called for suites on the ASB and CSBs.

void BPISuiteCSB::Startup (void )
virtual

This function is called when the selection sub-system starts up. Any suite initialization code can be placed in this funciton. Called for suites on the ASB and CSBs.