1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/Frameworks/libpurple.framework/Versions/0.6.2/Headers/plugin.h Fri Aug 21 13:25:11 2009 -0700
1.3 @@ -0,0 +1,740 @@
1.4 +/**
1.5 + * @file plugin.h Plugin API
1.6 + * @ingroup core
1.7 + * @see @ref plugin-signals
1.8 + * @see @ref plugin-ids
1.9 + * @see @ref plugin-i18n
1.10 + */
1.11 +
1.12 +/* purple
1.13 + *
1.14 + * Purple is the legal property of its developers, whose names are too numerous
1.15 + * to list here. Please refer to the COPYRIGHT file distributed with this
1.16 + * source distribution.
1.17 + *
1.18 + * This program is free software; you can redistribute it and/or modify
1.19 + * it under the terms of the GNU General Public License as published by
1.20 + * the Free Software Foundation; either version 2 of the License, or
1.21 + * (at your option) any later version.
1.22 + *
1.23 + * This program is distributed in the hope that it will be useful,
1.24 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.25 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.26 + * GNU General Public License for more details.
1.27 + *
1.28 + * You should have received a copy of the GNU General Public License
1.29 + * along with this program; if not, write to the Free Software
1.30 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
1.31 + */
1.32 +#ifndef _PURPLE_PLUGIN_H_
1.33 +#define _PURPLE_PLUGIN_H_
1.34 +
1.35 +#include <glib.h>
1.36 +#include <gmodule.h>
1.37 +#include "signals.h"
1.38 +#include "value.h"
1.39 +
1.40 +/** @copydoc _PurplePlugin */
1.41 +typedef struct _PurplePlugin PurplePlugin;
1.42 +/** @copydoc _PurplePluginInfo */
1.43 +typedef struct _PurplePluginInfo PurplePluginInfo;
1.44 +/** @copydoc _PurplePluginUiInfo */
1.45 +typedef struct _PurplePluginUiInfo PurplePluginUiInfo;
1.46 +/** @copydoc _PurplePluginLoaderInfo */
1.47 +typedef struct _PurplePluginLoaderInfo PurplePluginLoaderInfo;
1.48 +
1.49 +/** @copydoc _PurplePluginAction */
1.50 +typedef struct _PurplePluginAction PurplePluginAction;
1.51 +
1.52 +typedef int PurplePluginPriority; /**< Plugin priority. */
1.53 +
1.54 +#include "pluginpref.h"
1.55 +
1.56 +/**
1.57 + * Plugin types.
1.58 + */
1.59 +typedef enum
1.60 +{
1.61 + PURPLE_PLUGIN_UNKNOWN = -1, /**< Unknown type. */
1.62 + PURPLE_PLUGIN_STANDARD = 0, /**< Standard plugin. */
1.63 + PURPLE_PLUGIN_LOADER, /**< Loader plugin. */
1.64 + PURPLE_PLUGIN_PROTOCOL /**< Protocol plugin. */
1.65 +
1.66 +} PurplePluginType;
1.67 +
1.68 +#define PURPLE_PRIORITY_DEFAULT 0
1.69 +#define PURPLE_PRIORITY_HIGHEST 9999
1.70 +#define PURPLE_PRIORITY_LOWEST -9999
1.71 +
1.72 +#define PURPLE_PLUGIN_FLAG_INVISIBLE 0x01
1.73 +
1.74 +#define PURPLE_PLUGIN_MAGIC 5 /* once we hit 6.0.0 I think we can remove this */
1.75 +
1.76 +/**
1.77 + * Detailed information about a plugin.
1.78 + *
1.79 + * This is used in the version 2.0 API and up.
1.80 + */
1.81 +struct _PurplePluginInfo
1.82 +{
1.83 + unsigned int magic;
1.84 + unsigned int major_version;
1.85 + unsigned int minor_version;
1.86 + PurplePluginType type;
1.87 + char *ui_requirement;
1.88 + unsigned long flags;
1.89 + GList *dependencies;
1.90 + PurplePluginPriority priority;
1.91 +
1.92 + char *id;
1.93 + char *name;
1.94 + char *version;
1.95 + char *summary;
1.96 + char *description;
1.97 + char *author;
1.98 + char *homepage;
1.99 +
1.100 + /**
1.101 + * If a plugin defines a 'load' function, and it returns FALSE,
1.102 + * then the plugin will not be loaded.
1.103 + */
1.104 + gboolean (*load)(PurplePlugin *plugin);
1.105 + gboolean (*unload)(PurplePlugin *plugin);
1.106 + void (*destroy)(PurplePlugin *plugin);
1.107 +
1.108 + void *ui_info; /**< Used only by UI-specific plugins to build a preference screen with a custom UI */
1.109 + void *extra_info;
1.110 + PurplePluginUiInfo *prefs_info; /**< Used by any plugin to display preferences. If #ui_info has been specified, this will be ignored. */
1.111 +
1.112 + /**
1.113 + * This callback has a different use depending on whether this
1.114 + * plugin type is PURPLE_PLUGIN_STANDARD or PURPLE_PLUGIN_PROTOCOL.
1.115 + *
1.116 + * If PURPLE_PLUGIN_STANDARD then the list of actions will show up
1.117 + * in the Tools menu, under a submenu with the name of the plugin.
1.118 + * context will be NULL.
1.119 + *
1.120 + * If PURPLE_PLUGIN_PROTOCOL then the list of actions will show up
1.121 + * in the Accounts menu, under a submenu with the name of the
1.122 + * account. context will be set to the PurpleConnection for that
1.123 + * account. This callback will only be called for online accounts.
1.124 + */
1.125 + GList *(*actions)(PurplePlugin *plugin, gpointer context);
1.126 +
1.127 + void (*_purple_reserved1)(void);
1.128 + void (*_purple_reserved2)(void);
1.129 + void (*_purple_reserved3)(void);
1.130 + void (*_purple_reserved4)(void);
1.131 +};
1.132 +
1.133 +/**
1.134 + * Extra information for loader plugins.
1.135 + */
1.136 +struct _PurplePluginLoaderInfo
1.137 +{
1.138 + GList *exts;
1.139 +
1.140 + gboolean (*probe)(PurplePlugin *plugin);
1.141 + gboolean (*load)(PurplePlugin *plugin);
1.142 + gboolean (*unload)(PurplePlugin *plugin);
1.143 + void (*destroy)(PurplePlugin *plugin);
1.144 +
1.145 + void (*_purple_reserved1)(void);
1.146 + void (*_purple_reserved2)(void);
1.147 + void (*_purple_reserved3)(void);
1.148 + void (*_purple_reserved4)(void);
1.149 +};
1.150 +
1.151 +/**
1.152 + * A plugin handle.
1.153 + */
1.154 +struct _PurplePlugin
1.155 +{
1.156 + gboolean native_plugin; /**< Native C plugin. */
1.157 + gboolean loaded; /**< The loaded state. */
1.158 + void *handle; /**< The module handle. */
1.159 + char *path; /**< The path to the plugin. */
1.160 + PurplePluginInfo *info; /**< The plugin information. */
1.161 + char *error;
1.162 + void *ipc_data; /**< IPC data. */
1.163 + void *extra; /**< Plugin-specific data. */
1.164 + gboolean unloadable; /**< Unloadable */
1.165 + GList *dependent_plugins; /**< Plugins depending on this */
1.166 +
1.167 + void (*_purple_reserved1)(void);
1.168 + void (*_purple_reserved2)(void);
1.169 + void (*_purple_reserved3)(void);
1.170 + void (*_purple_reserved4)(void);
1.171 +};
1.172 +
1.173 +#define PURPLE_PLUGIN_LOADER_INFO(plugin) \
1.174 + ((PurplePluginLoaderInfo *)(plugin)->info->extra_info)
1.175 +
1.176 +struct _PurplePluginUiInfo {
1.177 + PurplePluginPrefFrame *(*get_plugin_pref_frame)(PurplePlugin *plugin);
1.178 +
1.179 + int page_num; /**< Reserved */
1.180 + PurplePluginPrefFrame *frame; /**< Reserved */
1.181 +
1.182 + void (*_purple_reserved1)(void);
1.183 + void (*_purple_reserved2)(void);
1.184 + void (*_purple_reserved3)(void);
1.185 + void (*_purple_reserved4)(void);
1.186 +};
1.187 +
1.188 +#define PURPLE_PLUGIN_HAS_PREF_FRAME(plugin) \
1.189 + ((plugin)->info != NULL && (plugin)->info->prefs_info != NULL)
1.190 +
1.191 +#define PURPLE_PLUGIN_UI_INFO(plugin) \
1.192 + ((PurplePluginUiInfo*)(plugin)->info->prefs_info)
1.193 +
1.194 +
1.195 +/**
1.196 + * The structure used in the actions member of PurplePluginInfo
1.197 + */
1.198 +struct _PurplePluginAction {
1.199 + char *label;
1.200 + void (*callback)(PurplePluginAction *);
1.201 +
1.202 + /** set to the owning plugin */
1.203 + PurplePlugin *plugin;
1.204 +
1.205 + /** NULL for plugin actions menu, set to the PurpleConnection for
1.206 + account actions menu */
1.207 + gpointer context;
1.208 +
1.209 + gpointer user_data;
1.210 +};
1.211 +
1.212 +#define PURPLE_PLUGIN_HAS_ACTIONS(plugin) \
1.213 + ((plugin)->info != NULL && (plugin)->info->actions != NULL)
1.214 +
1.215 +#define PURPLE_PLUGIN_ACTIONS(plugin, context) \
1.216 + (PURPLE_PLUGIN_HAS_ACTIONS(plugin)? \
1.217 + (plugin)->info->actions(plugin, context): NULL)
1.218 +
1.219 +
1.220 +/**
1.221 + * Handles the initialization of modules.
1.222 + */
1.223 +#if !defined(PURPLE_PLUGINS) || defined(PURPLE_STATIC_PRPL)
1.224 +# define _FUNC_NAME(x) purple_init_##x##_plugin
1.225 +# define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \
1.226 + gboolean _FUNC_NAME(pluginname)(void);\
1.227 + gboolean _FUNC_NAME(pluginname)(void) { \
1.228 + PurplePlugin *plugin = purple_plugin_new(TRUE, NULL); \
1.229 + plugin->info = &(plugininfo); \
1.230 + initfunc((plugin)); \
1.231 + purple_plugin_load((plugin)); \
1.232 + return purple_plugin_register(plugin); \
1.233 + }
1.234 +#else /* PURPLE_PLUGINS && !PURPLE_STATIC_PRPL */
1.235 +# define PURPLE_INIT_PLUGIN(pluginname, initfunc, plugininfo) \
1.236 + G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin); \
1.237 + G_MODULE_EXPORT gboolean purple_init_plugin(PurplePlugin *plugin) { \
1.238 + plugin->info = &(plugininfo); \
1.239 + initfunc((plugin)); \
1.240 + return purple_plugin_register(plugin); \
1.241 + }
1.242 +#endif
1.243 +
1.244 +
1.245 +#ifdef __cplusplus
1.246 +extern "C" {
1.247 +#endif
1.248 +
1.249 +/**************************************************************************/
1.250 +/** @name Plugin API */
1.251 +/**************************************************************************/
1.252 +/*@{*/
1.253 +
1.254 +/**
1.255 + * Creates a new plugin structure.
1.256 + *
1.257 + * @param native Whether or not the plugin is native.
1.258 + * @param path The path to the plugin, or @c NULL if statically compiled.
1.259 + *
1.260 + * @return A new PurplePlugin structure.
1.261 + */
1.262 +PurplePlugin *purple_plugin_new(gboolean native, const char *path);
1.263 +
1.264 +/**
1.265 + * Probes a plugin, retrieving the information on it and adding it to the
1.266 + * list of available plugins.
1.267 + *
1.268 + * @param filename The plugin's filename.
1.269 + *
1.270 + * @return The plugin handle.
1.271 + *
1.272 + * @see purple_plugin_load()
1.273 + * @see purple_plugin_destroy()
1.274 + */
1.275 +PurplePlugin *purple_plugin_probe(const char *filename);
1.276 +
1.277 +/**
1.278 + * Registers a plugin and prepares it for loading.
1.279 + *
1.280 + * This shouldn't be called by anything but the internal module code.
1.281 + * Plugins should use the PURPLE_INIT_PLUGIN() macro to register themselves
1.282 + * with the core.
1.283 + *
1.284 + * @param plugin The plugin to register.
1.285 + *
1.286 + * @return @c TRUE if the plugin was registered successfully. Otherwise
1.287 + * @c FALSE is returned (this happens if the plugin does not contain
1.288 + * the necessary information).
1.289 + */
1.290 +gboolean purple_plugin_register(PurplePlugin *plugin);
1.291 +
1.292 +/**
1.293 + * Attempts to load a previously probed plugin.
1.294 + *
1.295 + * @param plugin The plugin to load.
1.296 + *
1.297 + * @return @c TRUE if successful, or @c FALSE otherwise.
1.298 + *
1.299 + * @see purple_plugin_reload()
1.300 + * @see purple_plugin_unload()
1.301 + */
1.302 +gboolean purple_plugin_load(PurplePlugin *plugin);
1.303 +
1.304 +/**
1.305 + * Unloads the specified plugin.
1.306 + *
1.307 + * @param plugin The plugin handle.
1.308 + *
1.309 + * @return @c TRUE if successful, or @c FALSE otherwise.
1.310 + *
1.311 + * @see purple_plugin_load()
1.312 + * @see purple_plugin_reload()
1.313 + */
1.314 +gboolean purple_plugin_unload(PurplePlugin *plugin);
1.315 +
1.316 +/**
1.317 + * Disable a plugin.
1.318 + *
1.319 + * This function adds the plugin to a list of plugins to "disable at the next
1.320 + * startup" by excluding said plugins from the list of plugins to save. The
1.321 + * UI needs to call purple_plugins_save_loaded() after calling this for it
1.322 + * to have any effect.
1.323 + *
1.324 + * @since 2.3.0
1.325 + */
1.326 +void purple_plugin_disable(PurplePlugin *plugin);
1.327 +
1.328 +/**
1.329 + * Reloads a plugin.
1.330 + *
1.331 + * @param plugin The old plugin handle.
1.332 + *
1.333 + * @return @c TRUE if successful, or @c FALSE otherwise.
1.334 + *
1.335 + * @see purple_plugin_load()
1.336 + * @see purple_plugin_unload()
1.337 + */
1.338 +gboolean purple_plugin_reload(PurplePlugin *plugin);
1.339 +
1.340 +/**
1.341 + * Unloads a plugin and destroys the structure from memory.
1.342 + *
1.343 + * @param plugin The plugin handle.
1.344 + */
1.345 +void purple_plugin_destroy(PurplePlugin *plugin);
1.346 +
1.347 +/**
1.348 + * Returns whether or not a plugin is currently loaded.
1.349 + *
1.350 + * @param plugin The plugin.
1.351 + *
1.352 + * @return @c TRUE if loaded, or @c FALSE otherwise.
1.353 + */
1.354 +gboolean purple_plugin_is_loaded(const PurplePlugin *plugin);
1.355 +
1.356 +/**
1.357 + * Returns whether or not a plugin is unloadable.
1.358 + *
1.359 + * If this returns @c TRUE, the plugin is guaranteed to not
1.360 + * be loadable. However, a return value of @c FALSE does not
1.361 + * guarantee the plugin is loadable.
1.362 + *
1.363 + * @param plugin The plugin.
1.364 + *
1.365 + * @return @c TRUE if the plugin is known to be unloadable,\
1.366 + * @c FALSE otherwise
1.367 + */
1.368 +gboolean purple_plugin_is_unloadable(const PurplePlugin *plugin);
1.369 +
1.370 +/**
1.371 + * Returns a plugin's id.
1.372 + *
1.373 + * @param plugin The plugin.
1.374 + *
1.375 + * @return The plugin's id.
1.376 + */
1.377 +const gchar *purple_plugin_get_id(const PurplePlugin *plugin);
1.378 +
1.379 +/**
1.380 + * Returns a plugin's name.
1.381 + *
1.382 + * @param plugin The plugin.
1.383 + *
1.384 + * @return THe name of the plugin, or @c NULL.
1.385 + */
1.386 +const gchar *purple_plugin_get_name(const PurplePlugin *plugin);
1.387 +
1.388 +/**
1.389 + * Returns a plugin's version.
1.390 + *
1.391 + * @param plugin The plugin.
1.392 + *
1.393 + * @return The plugin's version or @c NULL.
1.394 + */
1.395 +const gchar *purple_plugin_get_version(const PurplePlugin *plugin);
1.396 +
1.397 +/**
1.398 + * Returns a plugin's summary.
1.399 + *
1.400 + * @param plugin The plugin.
1.401 + *
1.402 + * @return The plugin's summary.
1.403 + */
1.404 +const gchar *purple_plugin_get_summary(const PurplePlugin *plugin);
1.405 +
1.406 +/**
1.407 + * Returns a plugin's description.
1.408 + *
1.409 + * @param plugin The plugin.
1.410 + *
1.411 + * @return The plugin's description.
1.412 + */
1.413 +const gchar *purple_plugin_get_description(const PurplePlugin *plugin);
1.414 +
1.415 +/**
1.416 + * Returns a plugin's author.
1.417 + *
1.418 + * @param plugin The plugin.
1.419 + *
1.420 + * @return The plugin's author.
1.421 + */
1.422 +const gchar *purple_plugin_get_author(const PurplePlugin *plugin);
1.423 +
1.424 +/**
1.425 + * Returns a plugin's homepage.
1.426 + *
1.427 + * @param plugin The plugin.
1.428 + *
1.429 + * @return The plugin's homepage.
1.430 + */
1.431 +const gchar *purple_plugin_get_homepage(const PurplePlugin *plugin);
1.432 +
1.433 +/*@}*/
1.434 +
1.435 +/**************************************************************************/
1.436 +/** @name Plugin IPC API */
1.437 +/**************************************************************************/
1.438 +/*@{*/
1.439 +
1.440 +/**
1.441 + * Registers an IPC command in a plugin.
1.442 + *
1.443 + * @param plugin The plugin to register the command with.
1.444 + * @param command The name of the command.
1.445 + * @param func The function to execute.
1.446 + * @param marshal The marshalling function.
1.447 + * @param ret_value The return value type.
1.448 + * @param num_params The number of parameters.
1.449 + * @param ... The parameter types.
1.450 + *
1.451 + * @return TRUE if the function was registered successfully, or
1.452 + * FALSE otherwise.
1.453 + */
1.454 +gboolean purple_plugin_ipc_register(PurplePlugin *plugin, const char *command,
1.455 + PurpleCallback func,
1.456 + PurpleSignalMarshalFunc marshal,
1.457 + PurpleValue *ret_value, int num_params, ...);
1.458 +
1.459 +/**
1.460 + * Unregisters an IPC command in a plugin.
1.461 + *
1.462 + * @param plugin The plugin to unregister the command from.
1.463 + * @param command The name of the command.
1.464 + */
1.465 +void purple_plugin_ipc_unregister(PurplePlugin *plugin, const char *command);
1.466 +
1.467 +/**
1.468 + * Unregisters all IPC commands in a plugin.
1.469 + *
1.470 + * @param plugin The plugin to unregister the commands from.
1.471 + */
1.472 +void purple_plugin_ipc_unregister_all(PurplePlugin *plugin);
1.473 +
1.474 +/**
1.475 + * Returns a list of value types used for an IPC command.
1.476 + *
1.477 + * @param plugin The plugin.
1.478 + * @param command The name of the command.
1.479 + * @param ret_value The returned return value.
1.480 + * @param num_params The returned number of parameters.
1.481 + * @param params The returned list of parameters.
1.482 + *
1.483 + * @return TRUE if the command was found, or FALSE otherwise.
1.484 + */
1.485 +gboolean purple_plugin_ipc_get_params(PurplePlugin *plugin, const char *command,
1.486 + PurpleValue **ret_value, int *num_params,
1.487 + PurpleValue ***params);
1.488 +
1.489 +/**
1.490 + * Executes an IPC command.
1.491 + *
1.492 + * @param plugin The plugin to execute the command on.
1.493 + * @param command The name of the command.
1.494 + * @param ok TRUE if the call was successful, or FALSE otherwise.
1.495 + * @param ... The parameters to pass.
1.496 + *
1.497 + * @return The return value, which will be NULL if the command doesn't
1.498 + * return a value.
1.499 + */
1.500 +void *purple_plugin_ipc_call(PurplePlugin *plugin, const char *command,
1.501 + gboolean *ok, ...);
1.502 +
1.503 +/*@}*/
1.504 +
1.505 +/**************************************************************************/
1.506 +/** @name Plugins API */
1.507 +/**************************************************************************/
1.508 +/*@{*/
1.509 +
1.510 +/**
1.511 + * Add a new directory to search for plugins
1.512 + *
1.513 + * @param path The new search path.
1.514 + */
1.515 +void purple_plugins_add_search_path(const char *path);
1.516 +
1.517 +/**
1.518 + * Returns a list of plugin search paths.
1.519 + *
1.520 + * @constreturn A list of searched paths.
1.521 + *
1.522 + * @since 2.6.0
1.523 + */
1.524 +GList *purple_plugins_get_search_paths(void);
1.525 +
1.526 +/**
1.527 + * Unloads all loaded plugins.
1.528 + */
1.529 +void purple_plugins_unload_all(void);
1.530 +
1.531 +/**
1.532 + * Unloads all plugins of a specific type.
1.533 + */
1.534 +void purple_plugins_unload(PurplePluginType type);
1.535 +
1.536 +/**
1.537 + * Destroys all registered plugins.
1.538 + */
1.539 +void purple_plugins_destroy_all(void);
1.540 +
1.541 +/**
1.542 + * Saves the list of loaded plugins to the specified preference key
1.543 + *
1.544 + * @param key The preference key to save the list of plugins to.
1.545 + */
1.546 +void purple_plugins_save_loaded(const char *key);
1.547 +
1.548 +/**
1.549 + * Attempts to load all the plugins in the specified preference key
1.550 + * that were loaded when purple last quit.
1.551 + *
1.552 + * @param key The preference key containing the list of plugins.
1.553 + */
1.554 +void purple_plugins_load_saved(const char *key);
1.555 +
1.556 +/**
1.557 + * Probes for plugins in the registered module paths.
1.558 + *
1.559 + * @param ext The extension type to probe for, or @c NULL for all.
1.560 + *
1.561 + * @see purple_plugin_set_probe_path()
1.562 + */
1.563 +void purple_plugins_probe(const char *ext);
1.564 +
1.565 +/**
1.566 + * Returns whether or not plugin support is enabled.
1.567 + *
1.568 + * @return TRUE if plugin support is enabled, or FALSE otherwise.
1.569 + */
1.570 +gboolean purple_plugins_enabled(void);
1.571 +
1.572 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.573 +/**
1.574 + * Registers a function that will be called when probing is finished.
1.575 + *
1.576 + * @param func The callback function.
1.577 + * @param data Data to pass to the callback.
1.578 + * @deprecated If you need this, ask for a plugin-probe signal to be added.
1.579 + */
1.580 +void purple_plugins_register_probe_notify_cb(void (*func)(void *), void *data);
1.581 +#endif
1.582 +
1.583 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.584 +/**
1.585 + * Unregisters a function that would be called when probing is finished.
1.586 + *
1.587 + * @param func The callback function.
1.588 + * @deprecated If you need this, ask for a plugin-probe signal to be added.
1.589 + */
1.590 +void purple_plugins_unregister_probe_notify_cb(void (*func)(void *));
1.591 +#endif
1.592 +
1.593 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.594 +/**
1.595 + * Registers a function that will be called when a plugin is loaded.
1.596 + *
1.597 + * @param func The callback function.
1.598 + * @param data Data to pass to the callback.
1.599 + * @deprecated Use the plugin-load signal instead.
1.600 + */
1.601 +void purple_plugins_register_load_notify_cb(void (*func)(PurplePlugin *, void *),
1.602 + void *data);
1.603 +#endif
1.604 +
1.605 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.606 +/**
1.607 + * Unregisters a function that would be called when a plugin is loaded.
1.608 + *
1.609 + * @param func The callback function.
1.610 + * @deprecated Use the plugin-load signal instead.
1.611 + */
1.612 +void purple_plugins_unregister_load_notify_cb(void (*func)(PurplePlugin *, void *));
1.613 +#endif
1.614 +
1.615 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.616 +/**
1.617 + * Registers a function that will be called when a plugin is unloaded.
1.618 + *
1.619 + * @param func The callback function.
1.620 + * @param data Data to pass to the callback.
1.621 + * @deprecated Use the plugin-unload signal instead.
1.622 + */
1.623 +void purple_plugins_register_unload_notify_cb(void (*func)(PurplePlugin *, void *),
1.624 + void *data);
1.625 +#endif
1.626 +
1.627 +#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_PLUGIN_C_)
1.628 +/**
1.629 + * Unregisters a function that would be called when a plugin is unloaded.
1.630 + *
1.631 + * @param func The callback function.
1.632 + * @deprecated Use the plugin-unload signal instead.
1.633 + */
1.634 +void purple_plugins_unregister_unload_notify_cb(void (*func)(PurplePlugin *,
1.635 + void *));
1.636 +#endif
1.637 +
1.638 +/**
1.639 + * Finds a plugin with the specified name.
1.640 + *
1.641 + * @param name The plugin name.
1.642 + *
1.643 + * @return The plugin if found, or @c NULL if not found.
1.644 + */
1.645 +PurplePlugin *purple_plugins_find_with_name(const char *name);
1.646 +
1.647 +/**
1.648 + * Finds a plugin with the specified filename (filename with a path).
1.649 + *
1.650 + * @param filename The plugin filename.
1.651 + *
1.652 + * @return The plugin if found, or @c NULL if not found.
1.653 + */
1.654 +PurplePlugin *purple_plugins_find_with_filename(const char *filename);
1.655 +
1.656 +/**
1.657 + * Finds a plugin with the specified basename (filename without a path).
1.658 + *
1.659 + * @param basename The plugin basename.
1.660 + *
1.661 + * @return The plugin if found, or @c NULL if not found.
1.662 + */
1.663 +PurplePlugin *purple_plugins_find_with_basename(const char *basename);
1.664 +
1.665 +/**
1.666 + * Finds a plugin with the specified plugin ID.
1.667 + *
1.668 + * @param id The plugin ID.
1.669 + *
1.670 + * @return The plugin if found, or @c NULL if not found.
1.671 + */
1.672 +PurplePlugin *purple_plugins_find_with_id(const char *id);
1.673 +
1.674 +/**
1.675 + * Returns a list of all loaded plugins.
1.676 + *
1.677 + * @constreturn A list of all loaded plugins.
1.678 + */
1.679 +GList *purple_plugins_get_loaded(void);
1.680 +
1.681 +/**
1.682 + * Returns a list of all valid protocol plugins. A protocol
1.683 + * plugin is considered invalid if it does not contain the call
1.684 + * to the PURPLE_INIT_PLUGIN() macro, or if it was compiled
1.685 + * against an incompatable API version.
1.686 + *
1.687 + * @constreturn A list of all protocol plugins.
1.688 + */
1.689 +GList *purple_plugins_get_protocols(void);
1.690 +
1.691 +/**
1.692 + * Returns a list of all plugins, whether loaded or not.
1.693 + *
1.694 + * @constreturn A list of all plugins.
1.695 + */
1.696 +GList *purple_plugins_get_all(void);
1.697 +
1.698 +/*@}*/
1.699 +
1.700 +/**************************************************************************/
1.701 +/** @name Plugins SubSytem API */
1.702 +/**************************************************************************/
1.703 +/*@{*/
1.704 +
1.705 +/**
1.706 + * Returns the plugin subsystem handle.
1.707 + *
1.708 + * @return The plugin sybsystem handle.
1.709 + */
1.710 +void *purple_plugins_get_handle(void);
1.711 +
1.712 +/**
1.713 + * Initializes the plugin subsystem
1.714 + */
1.715 +void purple_plugins_init(void);
1.716 +
1.717 +/**
1.718 + * Uninitializes the plugin subsystem
1.719 + */
1.720 +void purple_plugins_uninit(void);
1.721 +
1.722 +/*@}*/
1.723 +
1.724 +/**
1.725 + * Allocates and returns a new PurplePluginAction.
1.726 + *
1.727 + * @param label The description of the action to show to the user.
1.728 + * @param callback The callback to call when the user selects this action.
1.729 + */
1.730 +PurplePluginAction *purple_plugin_action_new(const char* label, void (*callback)(PurplePluginAction *));
1.731 +
1.732 +/**
1.733 + * Frees a PurplePluginAction
1.734 + *
1.735 + * @param action The PurplePluginAction to free.
1.736 + */
1.737 +void purple_plugin_action_free(PurplePluginAction *action);
1.738 +
1.739 +#ifdef __cplusplus
1.740 +}
1.741 +#endif
1.742 +
1.743 +#endif /* _PURPLE_PLUGIN_H_ */