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"
22 * @brief Status of a plugin at runtime
47 class ISmmPluginManager
51 * @brief Loads a plugin and returns its id
53 * @param file String containing file name
54 * @param source Specifies who loaded the plugin
55 * @param status Status of the plugin
56 * @param ismm Pointer to Smm API
57 * @param error String buffer for error messages
58 * @param maxlen Maximum length of buffer
59 * @return Id of plugin
61 virtual PluginId Load(const char *file, PluginId source, bool &already, char *error, size_t maxlen) =0;
64 * @brief Unloads a plugin
66 * @param id Id of plugin
67 * @param error String buffer for error messages
68 * @param maxlen Maximum length of buffer
69 * @return True on success, false otherwise
71 virtual bool Unload(PluginId id, bool force, char *error, size_t maxlen) =0;
74 * @brief Pauses a plugin
76 * @param id Id of plugin
77 * @param error String buffer for error messages
78 * @param maxlen Maximum length of buffer
79 * @return True on success, false otherwise
81 virtual bool Pause(PluginId id, char *error, size_t maxlen) =0;
84 * @brief Unpauses a plugin
86 * @param id Id of plugin
87 * @param force If true, forces the plugin to unload
88 * @param error String buffer for error messages
89 * @param maxlen Maximum length of buffer
90 * @return True on success, false otherwise
92 virtual bool Unpause(PluginId id, char *error, size_t maxlen) =0;
95 * @brief Unloads all plugins forcefully
97 * @return True on success, false otherwise
99 virtual bool UnloadAll() =0;
102 * @brief Returns information about a plugin
104 * @param id Id of plugin
105 * @param file Pointer to file string by reference
106 * @param list Pointer to factories by reference
107 * @param status By reference status of plugin
108 * @param source By reference source of plugin
109 * @return True on success, false if not found
111 virtual bool Query(PluginId id, const char *&file, factories *&list, Pl_Status &status, PluginId &source) =0;
114 #endif //_INCLUDE_PLUGINMANAGER_H