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

#include <IK2ServiceMgr.h>

Inheritance diagram for IK2ServiceMgr:
IPMUnknown

Public Types

enum  InstancePerX { kInstancePerSession, kInstancePerUse, kInstancePerSessionPreload }
 

Public Member Functions

virtual void Shutdown ()=0
 
virtual void RegisterServiceProvider (IK2ServiceProvider *provider, ClassID classID, InstancePerX instancePerX=kInstancePerSession, bool16 dontPurge=kFalse)=0
 
virtual bool16 ReleaseCachedServiceProviders ()=0
 
virtual void SetDefaultServiceProvider (ClassID classID)=0
 
virtual IK2ServiceProviderQueryDefaultServiceProvider ()=0
 
virtual ClassID GetDefaultServiceProviderID ()=0
 
virtual IK2ServiceProviderQueryServiceProviderByClassID (ClassID classID)=0
 
virtual int32 GetServiceProviderCount ()=0
 
virtual IK2ServiceProviderQueryNthServiceProvider (int32 n)=0
 
virtual ClassID GetNthServiceProviderID (int32 n)=0
 
virtual int32 GetServiceProviderIndex (IK2ServiceProvider *serviceProvider)=0
 
virtual int32 GetServiceProviderIndex (ClassID serviceProviderID)=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

Service manager interface. This interface maintains a list of providers for one kind of service(one ServiceID). The Service Registry maintains a list of service managers, one for each service it knows about.

See Also
IK2ServiceRegistry
IK2ServiceProvider

Member Enumeration Documentation

Instantiation enum. Determines how long this service manager will hold on to it's service provider bosses. Really only important if the service provider has state that you care about preserving from one access to the next.
Enumerator
kInstancePerSession 

kInstancePerSession - one instance per session. The first time (per application run) a service provider boss is requested, it will be constructed. After that it is cached and the cached boss is returned.

kInstancePerUse 

kInstancePerUse - one instance per use. Every time a service provider boss is requested, it will be constructed.

kInstancePerSessionPreload 

kInstancePerSessionPreload - one instance per session. A startup time, the service provider bosses will be constructed. After that they are cached and the cached boss is returned.

Member Function Documentation

virtual ClassID IK2ServiceMgr::GetDefaultServiceProviderID ()
pure virtual

Get the ClassID of the default service provider boss

virtual ClassID IK2ServiceMgr::GetNthServiceProviderID (int32 n)
pure virtual

Get the ClassID of the nth service provider boss

virtual int32 IK2ServiceMgr::GetServiceProviderCount ()
pure virtual

Count service providers for this service

virtual int32 IK2ServiceMgr::GetServiceProviderIndex (IK2ServiceProviderserviceProvider)
pure virtual

Get the index of the passed in service provider in the service provider list

Parameters
serviceProviderPointer to the service provider you'd like the index of.
Returns
index of service provider in list, or -1 if not found
virtual int32 IK2ServiceMgr::GetServiceProviderIndex (ClassID serviceProviderID)
pure virtual

Get the index of the passed in service provider ClassID in the service provider list

Parameters
serviceProviderIDThe ClassID of the service provider boss you'd like the index of.
Returns
index of service provider in list, or -1 if not found
virtual IK2ServiceProvider* IK2ServiceMgr::QueryDefaultServiceProvider ()
pure virtual

Query for the default service provider. Caller must Release the returned pointer

virtual IK2ServiceProvider* IK2ServiceMgr::QueryNthServiceProvider (int32 n)
pure virtual

Query the nth service provider for this service. Caller must Release the returned pointer

virtual IK2ServiceProvider* IK2ServiceMgr::QueryServiceProviderByClassID (ClassID classID)
pure virtual

Query the service provider with the requested ClassID. Caller must Release the returned pointer

virtual void IK2ServiceMgr::RegisterServiceProvider (IK2ServiceProviderprovider,
ClassID classID,
InstancePerX instancePerX = kInstancePerSession,
bool16 dontPurge = kFalse 
)
pure virtual

Internal use only. The service registry registers services that belong to this service manager. Just implement an IK2ServiceProvider and add it to your boss.

virtual bool16 IK2ServiceMgr::ReleaseCachedServiceProviders ()
pure virtual

Internal use only. true means ok to purge this. false means serviceMgr couldn't purge everything, so don't purge it.

virtual void IK2ServiceMgr::SetDefaultServiceProvider (ClassID classID)
pure virtual

Set the default service provider for this service

Parameters
classIDThe ClassID of the default service provider boss.
virtual void IK2ServiceMgr::Shutdown ()
pure virtual
Called when the Service Registry is shutdown, to force all service providers to be released. Not done in ~ServiceMgr because the call to the destructor is delayed until the database

is deleted because ServiceMgr is persistent and goes to the instance cache.