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

#include <IInitializer.h>

Inheritance diagram for IInitializer:
IPMUnknown

Public Types

enum  InitializerType { kEarly, kLate }
 

Public Member Functions

virtual InitializerType GetType (void) const =0
 
virtual void Open (const PMLocaleId &localeId)=0
 
virtual void Close (const PMLocaleId &localeId)=0
 
virtual void Register (PluginID plugin, const PMLocaleId &localeId)=0
 
virtual PMReal Priority () 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 IInitializer interface is used for registering resources of a particular type that may appear in multiple plug-ins. Each Initializer handles a single resource type. The application loops through all the plug-ins, calling all the initializers on each plug-in. Each Initializer finds the resources that it cares about, and does whatever processing is necessary. For instance, panels are added using a PanelInitializer, and menus are added using a MenuInitializer.

Member Enumeration Documentation

There are two times when Initializers may be called, either early in 

startup, or later. Each Initializer needs to declare when it wants to be called.

Member Function Documentation

virtual void IInitializer::Close (const PMLocaleIdlocaleId)
pure virtual
Close is called before plug-ins are initialized to allow

the initializer to set up and tear down state that is reused across multiple calls to Register. The server will call Open, followed by zero or more Register calls, followed by a Close.

Parameters
localeIdThe locale we're registering
virtual InitializerType IInitializer::GetType (void ) const
pure virtual
        Return wheter this initializer is an early or late initializer. That is,

is it called before of after the service registry.

virtual void IInitializer::Open (const PMLocaleIdlocaleId)
pure virtual
Open is called before plug-ins are initialized to allow

the initializer to set up state that is reused across multiple calls to Register. The server will call Open, followed by zero or more Register calls, followed by a Close.

Parameters
localeIdThe locale we're registering
virtual PMReal IInitializer::Priority () const
pure virtual
Each initializer is called once for each plug-in, and the priority

controls the order in which the initializers are called for each 

plug-in. Lower numbers means this initializer is run first; higher 

numbers move initializer to later in the startup sequence. 

Returns
The initializer's priority: specifies whether it is called after or before other initializers.
virtual void IInitializer::Register (PluginID plugin,
const PMLocaleIdlocaleId 
)
pure virtual
Called by application once for each plug-in, to register the resources

supplied by the plug-in. Resource file will already be open. 

Parameters
pluginThe plug-in we're registering
localeIdThe locale we're registering