1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2005 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): David "BAILOPAN" Anderson
8 * ============================
11 #ifndef _INCLUDE_PLUGINMANAGER_H
12 #define _INCLUDE_PLUGINMANAGER_H
15 * @brief Plugin Manager interface
16 * @file IPluginManager.h
19 #include "ISmmPlugin.h"
33 * @brief Status of a plugin at runtime
47 class ISmmPluginManager
51 * @brief Loads a plugin and returns its id. If this is called before DLLInit(),
52 * then the plugin is considered to be "hot" - it might refuse its own load later!
53 * Also, a hot plugin might not have an error message.
55 * @param file String containing file name
56 * @param source Specifies who loaded the plugin
57 * @param status Status of the plugin
58 * @param ismm Pointer to Smm API
59 * @param error String buffer for error messages
60 * @param maxlen Maximum length of buffer
61 * @return Id of plugin
63 virtual PluginId Load(const char *file, PluginId source, bool &already, char *error, size_t maxlen) =0;
66 * @brief Unloads a plugin
68 * @param id Id of plugin
69 * @param error String buffer for error messages
70 * @param maxlen Maximum length of buffer
71 * @return True on success, false otherwise
73 virtual bool Unload(PluginId id, bool force, char *error, size_t maxlen) =0;
76 * @brief Pauses a plugin
78 * @param id Id of plugin
79 * @param error String buffer for error messages
80 * @param maxlen Maximum length of buffer
81 * @return True on success, false otherwise
83 virtual bool Pause(PluginId id, char *error, size_t maxlen) =0;
86 * @brief Unpauses a plugin
88 * @param id Id of plugin
89 * @param force If true, forces the plugin to unload
90 * @param error String buffer for error messages
91 * @param maxlen Maximum length of buffer
92 * @return True on success, false otherwise
94 virtual bool Unpause(PluginId id, char *error, size_t maxlen) =0;
97 * @brief Unloads all plugins forcefully
99 * @return True on success, false otherwise
101 virtual bool UnloadAll() =0;
104 * @brief Returns information about a plugin
106 * @param id Id of plugin
107 * @param file Pointer to file string by reference
108 * @param list Pointer to factories by reference
109 * @param status By reference status of plugin
110 * @param source By reference source of plugin
111 * @return True on success, false if not found
113 virtual bool Query(PluginId id, const char *&file, factories *&list, Pl_Status &status, PluginId &source) =0;
116 * @brief Checks another plugin's QueryRunning() status.
118 * @param id Id of plugin
119 * @param error Message buffer
120 * @param maxlen Size of error buffer
121 * @return Status value
123 virtual bool QueryRunning(PluginId id, char *error, size_t maxlength) =0;
126 #endif //_INCLUDE_PLUGINMANAGER_H