InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
CHLServiceProvider Class Reference
Inheritance diagram for CHLServiceProvider:
CServiceProviderIK2ServiceProviderIPMUnknown

Public Member Functions

 CHLServiceProvider (IPMUnknown *boss)
 
virtual
IK2ServiceProvider::InstancePerX 
GetInstantiationPolicy ()
 
virtual bool16 IsDefaultServiceProvider ()
 
virtual void GetName (PMString *pName)
 
virtual ServiceID GetServiceID ()
 
- Public Member Functions inherited from CServiceProvider
 CServiceProvider (IPMUnknown *boss)
 
virtual bool16 HasMultipleIDs () const
 
virtual void GetServiceIDs (K2Vector< ServiceID > &serviceIDs)
 

Protected Member Functions

virtual void Install ()
 
virtual IPlugIn::ThreadingPolicy GetThreadingPolicy () const
 
- Protected Member Functions inherited from CServiceProvider
void InitThreadingPolicy (PMIID whichIID=IID_IK2SERVICEPROVIDER)
 

Additional Inherited Members

- Public Types inherited from IK2ServiceProvider
enum  { kDefaultIID = IID_IK2SERVICEPROVIDER }
 
enum  InstancePerX { kInstancePerSession, kInstancePerUse, kInstancePerSessionPreload, kInstancePerSessionNoPurge }
 
- Protected Attributes inherited from CServiceProvider
IPlugIn::ThreadingPolicy fThreadingPolicy
 

Detailed Description

Implements a linguistic service provider. When your IK2ServiceProvider:Install() method is called you should populate interface IID_ILINGUISTICDATA with appropriate data.

Constructor & Destructor Documentation

Binds the C implementation class onto its ImplementationID making the C code callable by the application * CHLServiceProvider::CHLServiceProvider (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.

Member Function Documentation

IK2ServiceProvider::InstancePerX CHLServiceProvider::GetInstantiationPolicy (void )
virtual

A service provider can choose to have one instance that is shared by all requests for that service providers (this is the most common case - kInstancePerSession), or a service provider may choose to have a unique instance created on each request for the service provider (kInstancePerUse). "Instance Per Session" service providers are created when first requested and cached by the service registry as long as available memory allows. kInstancePerSessionPreload will cause a service provider to be constructed and cached at application startup. Furthermore, a "preload" service provider will not be unloaded until application shutdown.

Note: Since "preload" service providers are never unloaded, they incur the memory overhead for the service and cause the plug-in that contains the service to not be unloaded. Therefore "preload" service providers should be avoided, when possible. If you need to be called at startup and/or shutdown, use a kStartupShutdownServiceID.

Returns
IK2ServiceProvider::kInstancePerSession

Reimplemented from CServiceProvider.

void CHLServiceProvider::GetName (PMStringpName)
virtual

A service may optionally have a name. But the service registry does not use this name in any way.

Parameters
pNameOUT Optionally service name.

Reimplemented from CServiceProvider.

ServiceID CHLServiceProvider::GetServiceID (void )
virtual

The ServiceID the boss this interface is aggregated into supports.

Returns
kLinguisticService

Implements IK2ServiceProvider.

virtual IPlugIn::ThreadingPolicy CHLServiceProvider::GetThreadingPolicy () const
inlineprotectedvirtual

By default the base class will return the threading policy of the plugin where the service provider is defined. Service providers can override this if they reside in a model plugin but want to operate only in the main thread.

Reimplemented from CServiceProvider.

void CHLServiceProvider::Install ()
protectedvirtual

We post the name of our service and the absolute path to the folder that we expect to contain the files that support our linguistic service in interface IID_ILINGUISTICDATA.

bool16 CHLServiceProvider::IsDefaultServiceProvider (void )
virtual

For the majority of service providers this method should return kFalse. However, if a specific service provider should always be the default for its service this can be set to kTrue.

Returns
kFalse

Reimplemented from CServiceProvider.