32 #ifndef _INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_
33 #define _INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_
42 #include <sp_vm_api.h>
44 #define SMINTERFACE_PLUGINSYSTEM_NAME "IPluginManager"
45 #define SMINTERFACE_PLUGINSYSTEM_VERSION 5
48 #define SM_CONTEXTVAR_USER 3
91 PluginType_MapUpdated,
96 class IPhraseCollection;
112 virtual PluginType
GetType() =0;
183 virtual bool SetProperty(
const char *prop,
void *ptr) =0;
194 virtual bool GetProperty(
const char *prop,
void **ptr,
bool remove=
false) =0;
201 virtual SourcePawn::IPluginRuntime *
GetRuntime() =0;
304 return SMINTERFACE_PLUGINSYSTEM_NAME;
309 return SMINTERFACE_PLUGINSYSTEM_VERSION;
385 #endif //_INCLUDE_SOURCEMOD_PLUGINMNGR_INTERFACE_H_
virtual IPluginIterator * GetPluginIterator()=0
Returns a pointer that can be used to iterate through plugins. Note: This pointer must be freed using...
virtual IPlugin * GetPlugin()=0
Returns the plugin at the current iterator position.
virtual unsigned int GetSerial()=0
Returns the unique serial number of a plugin.
virtual unsigned int GetPluginCount()=0
Returns the number of plugins (both failed and loaded).
Defines the interface for creating, reading, and removing Handles.
virtual const char * GetFilename()=0
Returns the plugin filename (relative to plugins dir).
const char * name
Definition: IPluginSys.h:59
virtual IPhraseCollection * GetPhrases()=0
Returns the plugin's phrase collection.
virtual void OnPluginLoaded(IPlugin *plugin)
Called when a plugin is fully loaded successfully.
Definition: IPluginSys.h:268
virtual PluginStatus GetStatus()=0
Returns the plugin status.
Defines the Share System, responsible for shared resources and dependencies.
virtual unsigned int GetInterfaceVersion()
Must return an integer defining the interface's version.
Definition: IPluginSys.h:307
virtual SourcePawn::IPluginRuntime * GetRuntime()=0
Returns the runtime representing this plugin.
virtual ~IPlugin()
Definition: IPluginSys.h:105
virtual bool SetProperty(const char *prop, void *ptr)=0
Sets a property on this plugin. This is used for per-plugin data from extensions or other parts of co...
virtual void * GetPluginStructure()=0
Deprecated, returns NULL.
virtual IPlugin * FindPluginByContext(const sp_context_t *ctx)=0
Finds a plugin by its context. Note: This function should be considered O(1).
Defines the base functionality required by a shared interface.
Definition: IShareSys.h:92
virtual bool UnloadPlugin(IPlugin *plugin)=0
Attempts to unload a plugin.
virtual void OnPluginCreated(IPlugin *plugin)
Called when a plugin is created/mapped into memory.
Definition: IPluginSys.h:261
Iterates over a list of plugins.
Definition: IPluginSys.h:222
virtual void OnPluginPauseChange(IPlugin *plugin, bool paused)
Called when a plugin is paused or unpaused.
Definition: IPluginSys.h:275
const char * author
Definition: IPluginSys.h:60
virtual IdentityToken_t * GetIdentity()=0
Returns a plugin's identity token.
virtual IPlugin * PluginFromHandle(Handle_t handle, HandleError *err)=0
Converts a Handle to an IPlugin if possible.
virtual bool MorePlugins()=0
Returns true if there are more plugins in the iterator.
virtual void AddPluginsListener(IPluginsListener *listener)=0
Adds a plugin manager listener.
virtual const char * GetInterfaceName()
Must return a string defining the interface's unique name.
Definition: IPluginSys.h:302
Manages the runtime loading and unloading of plugins.
Definition: IPluginSys.h:299
virtual void OnPluginDestroyed(IPlugin *plugin)
Called when a plugin is destroyed. NOTE: Always called if Created, even if load failed.
Definition: IPluginSys.h:290
virtual const sm_plugininfo_t * GetPublicInfo()=0
Returns information about the plugin by reference.
Encapsulates a run-time plugin as maintained by SourceMod.
Definition: IPluginSys.h:101
Definition: ITranslator.h:121
virtual IPlugin * LoadPlugin(const char *path, bool debug, PluginType type, char error[], size_t maxlength, bool *wasloaded)=0
Attempts to load a plugin.
virtual sp_context_t * GetContext()=0
Deprecated, returns NULL.
virtual void Release()=0
Destroys the iterator object. Note: You may use 'delete' in lieu of this function.
const char * url
Definition: IPluginSys.h:63
virtual bool GetProperty(const char *prop, void **ptr, bool remove=false)=0
Gets a property from a plugin.
virtual SourcePawn::IPluginContext * GetBaseContext()=0
Returns the IPluginRuntime::GetDefaultContext() value.
virtual void RemovePluginsListener(IPluginsListener *listener)=0
Removes a plugin listener.
Listens for plugin-oriented events.
Definition: IPluginSys.h:255
Definition: IAdminSystem.h:63
const char * description
Definition: IPluginSys.h:61
Encapsulates plugin public information exposed through "myinfo.".
Definition: IPluginSys.h:57
const char * version
Definition: IPluginSys.h:62
virtual PluginType GetType()=0
Returns the lifetime of a plugin.
virtual void OnPluginUnloaded(IPlugin *plugin)
Called when a plugin is unloaded (only if fully loaded).
Definition: IPluginSys.h:282
virtual void NextPlugin()=0
Advances to the next plugin in the iterator.
virtual Handle_t GetMyHandle()=0
Returns a plugin's handle.
virtual bool IsDebugging()=0
Returns true if a plugin is in debug mode, false otherwise.
virtual bool SetPauseState(bool paused)=0
Sets whether the plugin is paused or not.
virtual ~IPluginIterator()
Definition: IPluginSys.h:226