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

#include <IK2ServiceRegistry.h>

Inheritance diagram for IK2ServiceRegistry:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IK2SERVICEREGISTRY }
 

Public Member Functions

virtual IK2ServiceProviderQueryServiceProviderByClassID (ServiceID serviceID, ClassID providerClassID) const =0
 
virtual IK2ServiceProviderQueryDefaultServiceProvider (ServiceID serviceID) const =0
 
virtual ClassID GetDefaultServiceProviderID (ServiceID serviceID) const =0
 
virtual void SetDefaultServiceProviderID (ServiceID serviceID, ClassID classID)=0
 
Functions for iterating a particular serviceID
virtual int32 GetServiceProviderCount (ServiceID serviceID) const =0
 
virtual IK2ServiceProviderQueryNthServiceProvider (ServiceID serviceID, int32 n) const =0
 
virtual ClassID GetNthServiceProviderID (ServiceID serviceID, int32 n) const =0
 
virtual int32 GetServiceProviderIndex (ServiceID serviceID, ClassID serviceProviderID) const =0
 
virtual int32 GetServiceProviderIndex (const IK2ServiceProvider *serviceProvider) const =0
 
For Internal Use Only
virtual void Startup ()=0
 
virtual void Shutdown ()=0
 
virtual void ReleaseCachedServiceProviders ()=0
 
virtual void RegisterServiceProvider (ClassID classID)=0
 
virtual void PerformStartupServices ()=0
 
virtual void GetRegisteredServiceIDs (K2Vector< ServiceID > &services) 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

The service registry manages all the services in all the plug-ins. It maintains an internal list, sorted by the service's ServiceID. A service is a generic concept, identified by a ServiceID. For instance, kScriptProviderServiceID is the service used by objects that want to add new functionality to scripting. There may be many different script providers, each one sharing the same kScriptProviderServiceID.

See Also
IK2ServiceProvider.

Member Function Documentation

virtual ClassID IK2ServiceRegistry::GetDefaultServiceProviderID (ServiceID serviceID) const
pure virtual

Returns the ClassID of the default service provider, or if no default has been set the ClassID of the first service provider found for the given ServiceID.

Parameters
serviceIDwhat service
Returns
ClassID the class of the default provider
virtual ClassID IK2ServiceRegistry::GetNthServiceProviderID (ServiceID serviceID,
int32 n 
) const
pure virtual

Return the classID of the n'th provider for the service.

Parameters
serviceIDthe service we're interested in
nthe index of the provider
Returns
ClassID of the n'th service provider
virtual void IK2ServiceRegistry::GetRegisteredServiceIDs (K2Vector< ServiceID > & services) const
pure virtual

Retrieves a list of all the registered service IDs with this instance of service registry.

virtual int32 IK2ServiceRegistry::GetServiceProviderCount (ServiceID serviceID) const
pure virtual

Get the number of providers for the service.

Parameters
serviceIDthe service we're interested in Return the number of providers for a specific service.
virtual int32 IK2ServiceRegistry::GetServiceProviderIndex (ServiceID serviceID,
ClassID serviceProviderID 
) const
pure virtual

Given a service provider, return its index.

Parameters
serviceIDthe service we're interested in
serviceProviderIDthe provider we're interested in
Returns
int32 the index of the provider
virtual int32 IK2ServiceRegistry::GetServiceProviderIndex (const IK2ServiceProviderserviceProvider) const
pure virtual

Given a service provider, return its index.

Parameters
IK2ServiceProvider*the service provider we're interested in
Returns
int32 the index where the provider is found
virtual void IK2ServiceRegistry::PerformStartupServices ()
pure virtual

The IStartupShutdownService::Startup() method of all service providers that support the kStartupShutdownServiceID is called.

virtual IK2ServiceProvider* IK2ServiceRegistry::QueryDefaultServiceProvider (ServiceID serviceID) const
pure virtual

Returns the default service provider, or if no default has been set the first service provider found for the given ServiceID.

Parameters
serviceIDwhat service
Returns
IK2ServiceProvider the default provider
virtual IK2ServiceProvider* IK2ServiceRegistry::QueryNthServiceProvider (ServiceID serviceID,
int32 n 
) const
pure virtual

Return the n'th provider for the service.

Parameters
serviceIDthe service we're interested in
nthe index of the provider
Returns
IK2ServiceProvider* the n'th service provider
virtual IK2ServiceProvider* IK2ServiceRegistry::QueryServiceProviderByClassID (ServiceID serviceID,
ClassID providerClassID 
) const
pure virtual

Provides access to a specific service. In many cases a service is provided by a single instance of a boss object that is used by multiple callers. This method returns the existing instance of a service, if one has already been created.

Parameters
serviceIDwhat service to look in
providerClassthe classID of the service provider
virtual void IK2ServiceRegistry::RegisterServiceProvider (ClassID classID)
pure virtual

This method of registration is only for use in very obscure cases (like the error string table service, where we need the service provider to be available before all the plug-ins are installed into the object model, and therefore before Startup() has been called).

virtual void IK2ServiceRegistry::ReleaseCachedServiceProviders ()
pure virtual

Releases all cached service providers, thus freeing up memory. This is only called by the memory management code.

virtual void IK2ServiceRegistry::SetDefaultServiceProviderID (ServiceID serviceID,
ClassID classID 
)
pure virtual

Sets the given classID as the default service provider for the given ServiceID.

Parameters
serviceIDwhat service
providerClassthe classID of the service provider
virtual void IK2ServiceRegistry::Shutdown ()
pure virtual

Called by the application during application shutdown. The IStartupShutdownService::Shutdown() method of all service providers that support the kStartupShutdownServiceID is called.

virtual void IK2ServiceRegistry::Startup ()
pure virtual

Called by the application during application startup. Every boss class description that includes an IK2ServiceProvider interface is registered as a service provider.