Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

ScPersistentPlugin Class Reference

A plug-in that is resident for the lifetime of the app. More...

#include <scplugin.h>

Inheritance diagram for ScPersistentPlugin:

Inheritance graph
[legend]
Collaboration diagram for ScPersistentPlugin:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScPersistentPlugin ()
 ctor
virtual ~ScPersistentPlugin ()=0
 Pure virtual dtor for abstract class.
virtual bool initPlugin ()=0
 Initialize the plugin.
virtual bool cleanupPlugin ()=0
 Deactivates the plugin for unloading / program quit.


Detailed Description

A plug-in that is resident for the lifetime of the app.

ScPersistentPlugin describes a plugin that is to be kept resident for the lifetime of the app (or until unloaded by a request to the plug-in manager). Persistent plugins are useful where the plugin author needs to retain state, needs more control of how they integrate with the Scribus user interface, and/or wants to perform tasks in the background.

Such plug-ins have an init method and a cleanup method; they have no "run" method as such. It is up to the plugin to determine how best to interfact with the user.

Definition at line 410 of file scplugin.h.


Constructor & Destructor Documentation

ScPersistentPlugin::ScPersistentPlugin (  ) 

ctor

See also:
ScPlugin::ScPlugin()

Definition at line 126 of file scplugin.cpp.

ScPersistentPlugin::~ScPersistentPlugin (  )  [pure virtual]

Pure virtual dtor for abstract class.

Definition at line 131 of file scplugin.cpp.


Member Function Documentation

virtual bool ScPersistentPlugin::initPlugin (  )  [pure virtual]

Initialize the plugin.

This method must initialize the plugin. It is called at plug-in load time. This method will never be called twice without an intervening cleanupPlugin call, but there is no guarantee the plugin will actually be unloaded between initPlugin() and cleanupPlugin().

It will usually instantiate a class and store a pointer to the instance in a static variable of the plugin or a member of its ScPersistentPlugin subclass, letting that class do the work of setup and integration into the app.

Note that this is NOT the same as the init function of the plugin. That is always simple and lightweight, intended to just get an instance of this class back to the core app. This function is where any time-consuming or memory expensive init should be triggered, generally by the instantiation of the class that does the real work for the plugin.

If this method returns failure, the plugin will be treated as dead and cleanupPlug() will not be called.

Returns:
bool True for success.

Implemented in ScriptPlugin.

Referenced by PluginManager::enablePlugin().

virtual bool ScPersistentPlugin::cleanupPlugin (  )  [pure virtual]

Deactivates the plugin for unloading / program quit.

This method will be called when the plug-in is about to be unloaded, or if the plug-in manager has been asked to disable the plug-in. This method will never be called unless initPlugin has been called first, but there is no guarantee the plugin will actually be unloaded after this is called, or before initPlugin is called again.

Returns:
bool True for success.

Implemented in ScriptPlugin.

Referenced by PluginManager::disablePlugin().


The documentation for this class was generated from the following files:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.