InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PlugIn Class Reference

#include <PlugIn.h>

Inheritance diagram for PlugIn:
IPlugInPstLstPlugIn

Public Member Functions

virtual PluginID GetPluginID () const
 
virtual IDFile GetResourceFile () const
 
virtual bool16 Load (ISession *theSession)
 
virtual bool16 Unload ()
 
virtual void LoadFactories (PluginID ownerComponent, ISession *theSession)
 
virtual bool16 LoadAtStartup ()
 
virtual bool16 CanUnload () const
 
virtual void FixUpData (IDocument *doc)
 
virtual void SetPluginID (PluginID pluginID)
 

Additional Inherited Members

- Public Types inherited from IPlugIn
enum  ThreadingPolicy { kUnknownThreadingPolicy =0, kMainThreadOnly =1, kMultipleThreads =2 }
 

Detailed Description

PlugIn supplies the default implementation of IPlugIn. Unless your plug-in has special needs, you can reuse the PlugIn directly. Otherwise, you may need to override it.

To reuse PlugIn, just make your GetPlugIn function return a PlugIn. Here's an example of how that works:


static PlugIn gPlugIn;

IPlugIn *GetPlugIn()

{

    return 

}

To override, just make your own class that inherits from PlugIn, and return that instead:


class MyPlugIn : public PlugIn

{

    void FixUpData(IDocument *doc);

};

static MyPlugIn gPlugIn;

IPlugIn *GetPlugIn()

{

    return 

}

See Also
IPlugIn

Member Function Documentation

virtual bool16 PlugIn::CanUnload () const
virtual

Default implementation returns kTrue.

Implements IPlugIn.

virtual void PlugIn::FixUpData (IDocumentdoc)
virtual

Default implementation does nothing. Override this if your plug-in needs to fix up data in the document

See Also
IPlugIn.

Implements IPlugIn.

Reimplemented in PstLstPlugIn.

virtual PluginID PlugIn::GetPluginID () const
inlinevirtual

Returns the pluginID that corresponds to your plug-in. It's set up by the application at the time the plug-in is loaded. Please use this instead of GetResourceFile() whenever possible. Don't override this.

Implements IPlugIn.

virtual IDFile PlugIn::GetResourceFile () const
virtual

Returns the resource file that corresponds to your plug-in. It's set up by the application at the time the plug-in is loaded. Don't override this.

Implements IPlugIn.

virtual bool16 PlugIn::Load (ISessiontheSession)
virtual

Sets up the session pointer, and returns kTrue.

Implements IPlugIn.

virtual bool16 PlugIn::LoadAtStartup ()
virtual

Default implementation returns kFalse.

Implements IPlugIn.

virtual void PlugIn::LoadFactories (PluginID ownerComponent,
ISessiontheSession 
)
virtual

Load all the factory functions (e.g., implementations) associated with your plug-in. Do not override this. For internal use only.

Implements IPlugIn.

virtual void PlugIn::SetPluginID (PluginID pluginID)
virtual

Called by the ObjectModel at the time the plug-in is loaded. Don't override this.

Implements IPlugIn.

virtual bool16 PlugIn::Unload ()
virtual

Unload nils out the session pointer. You shouldn't need to override this.

Implements IPlugIn.