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

#include <IActiveContext.h>

Inheritance diagram for IActiveContext:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IACTIVECONTEXT }
 
typedef KeyValuePair< PMIID,
IPMUnknown * > 
ContextInfo
 
typedef K2Vector< ContextInfoContextTable
 

Public Member Functions

IDocumentGetContextDocument () const
 
ISelectionManagerGetContextSelection () const
 
IControlViewGetContextView () const
 
IWorkspaceGetContextWorkspace () const
 
virtual IPMUnknownGetContextInterface (const PMIID &id) const =0
 
virtual void GetContextInterfaces (ContextTable &table) const =0
 
virtual void SetContextInterfaces (const ContextTable &table)=0
 
virtual void ChangeContextInterfaces (const ContextTable &table)=0
 
virtual void SetContextDelegate (IActiveContext *newDelegate)=0
 
virtual bool16 IsContextDelegate (IActiveContext *am_I_your_delegate) const =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

An IActiveContext maintains a mapping between IIDs and pointers to implementations.

Member Function Documentation

virtual void IActiveContext::ChangeContextInterfaces (const ContextTabletable)
pure virtual

Add or replace one or more context interfaces. Existing interfaces that are not in the table are not affected. Notification is done after the entire table is changed for each affected PMIID.

IDocument* IActiveContext::GetContextDocument () const
inline

Most users will only need these utility methods which provide access to the standard interfaces in an active context.

virtual IPMUnknown* IActiveContext::GetContextInterface (const PMIIDid) const
pure virtual

Obtain a specific interface from the active context.

Parameters
idis the PMIID of the desired interface
Returns
the interface (NB: not AddRef'ed) or nil if not defined
virtual void IActiveContext::GetContextInterfaces (ContextTabletable) const
pure virtual

Obtain all of the currently defined context interfaces.

virtual bool16 IActiveContext::IsContextDelegate (IActiveContextam_I_your_delegate) const
pure virtual

Test whether a delegate is the current delegate.

virtual void IActiveContext::SetContextDelegate (IActiveContextnewDelegate)
pure virtual

SetContextDelegate(IActiveContext* delegate) in effect calls GetContextInterfaces to get the delegate's mapping and passes that table to SetContextInterfaces causing this context to synchronize its mapping with the delegate's and notifying observers of the change. In addition, any subsequent changes to this context get propagated to the delegate and any changes made directly to the delegate context are observed and realized in this context so that one may observe this context alone to be notified of changes to either context. SetContextDelegate also holds a reference to an externally specified delegate. Making a context its own delegate (e.g. ac->SetContextDelegate(ac)) means that the context should revert to the "default" mapping for its implementation. (For example, the session boss implementation installs the no-pub context consisting only of the app workspace and that workspace's associated selection.) Passing nil instructs the implementation to remove delegate and tear down any active interfaces because the context is shutting down.

virtual void IActiveContext::SetContextInterfaces (const ContextTabletable)
pure virtual

Replace the existing context interfaces with a new set. In contrast to ChangeContextInterfaces, this method operates as if the table parameter were padded out with a nil pointer value for every IID not explicitly in the table. That is, no existing unspecified interface values in the context's mapping survive. SetContextInterfaces notifies once for each changed IID.