3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_PLUGINS_H
23 #define PURPLE_PLUGINS_H
26 * @section_id: libpurple-plugins
27 * @short_description: <filename>plugins.h</filename>
29 * @see_also: <link linkend="chapter-signals-plugin">Plugin signals</link>,
30 * <link linkend="chapter-plugin-ids">Plugin IDs</link>,
31 * <link linkend="chapter-plugin-i18n">Third Party Plugin Translation</link>
35 #include <gplugin-native.h>
39 #define PURPLE_PLUGINS_DOMAIN (g_quark_from_static_string("plugins"))
41 #define PURPLE_TYPE_PLUGIN GPLUGIN_TYPE_PLUGIN
42 #define PURPLE_PLUGIN(obj) GPLUGIN_PLUGIN(obj)
43 #define PURPLE_IS_PLUGIN(obj) GPLUGIN_IS_PLUGIN(obj)
44 #define PURPLE_PLUGIN_GET_IFACE(obj) GPLUGIN_PLUGIN_GET_IFACE(obj)
49 * Represents a plugin handle.
50 * This type is an alias for GPluginPlugin.
52 typedef GPluginPlugin PurplePlugin
;
54 typedef GPluginPluginInterface PurplePluginInterface
;
56 #define PURPLE_TYPE_PLUGIN_INFO (purple_plugin_info_get_type())
57 #define PURPLE_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_PLUGIN_INFO, PurplePluginInfo))
58 #define PURPLE_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_PLUGIN_INFO, PurplePluginInfoClass))
59 #define PURPLE_IS_PLUGIN_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_PLUGIN_INFO))
60 #define PURPLE_IS_PLUGIN_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_PLUGIN_INFO))
61 #define PURPLE_PLUGIN_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_PLUGIN_INFO, PurplePluginInfoClass))
63 typedef struct _PurplePluginInfo PurplePluginInfo
;
64 typedef struct _PurplePluginInfoClass PurplePluginInfoClass
;
66 #define PURPLE_TYPE_PLUGIN_ACTION (purple_plugin_action_get_type())
68 typedef struct _PurplePluginAction PurplePluginAction
;
70 #include "pluginpref.h"
73 * PurplePluginActionCb:
74 * @action: the action information.
76 * A function called when the related Action Menu is activated.
78 typedef void (*PurplePluginActionCb
)(PurplePluginAction
*action
);
81 * PurplePluginActionsCb:
82 * @plugin: the plugin associated with this callback.
84 * Returns a list of actions the plugin can perform.
86 * Returns: (transfer none): A list of actions the plugin can perform.
88 typedef GList
*(*PurplePluginActionsCb
)(PurplePlugin
*plugin
);
91 * PurplePluginExtraCb:
92 * @plugin: the plugin associated with this callback.
94 * Gives extra information about the plguin.
96 * Returns: a newly allocated string denoting extra information
99 typedef gchar
*(*PurplePluginExtraCb
)(PurplePlugin
*plugin
);
102 * PurplePluginPrefFrameCb:
103 * @plugin: the plugin associated with this callback.
105 * Returns the preferences frame for the plugin.
107 * Returns: Preference frame.
109 typedef PurplePluginPrefFrame
*(*PurplePluginPrefFrameCb
)(PurplePlugin
*plugin
);
112 * PurplePrefRequestCb:
114 * Returns the preferences request handle for a plugin.
116 * Returns: Preferences request handle.
118 typedef gpointer (*PurplePluginPrefRequestCb
)(PurplePlugin
*plugin
);
121 * PurplePluginInfoFlags:
122 * @PURPLE_PLUGIN_INFO_FLAGS_INTERNAL: Plugin is not shown in UI lists
123 * @PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD: Auto-load the plugin
125 * Flags that can be used to treat plugins differently.
127 typedef enum /*< flags >*/
129 PURPLE_PLUGIN_INFO_FLAGS_INTERNAL
= 1 << 1,
130 PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD
= 1 << 2,
132 } PurplePluginInfoFlags
;
136 * @ui_data: The UI data associated with the plugin. This is a convenience
137 * field provided to the UIs -- it is not used by the libpurple core.
139 * Holds information about a plugin.
141 struct _PurplePluginInfo
{
142 GPluginPluginInfo parent
;
148 struct _PurplePluginInfoClass
{
149 GPluginPluginInfoClass parent_class
;
152 void (*_purple_reserved1
)(void);
153 void (*_purple_reserved2
)(void);
154 void (*_purple_reserved3
)(void);
155 void (*_purple_reserved4
)(void);
159 * PurplePluginAction:
161 * Represents an action that the plugin can perform. This shows up in the Tools
162 * menu, under a submenu with the name of the plugin.
164 struct _PurplePluginAction
{
166 PurplePluginActionCb callback
;
167 PurplePlugin
*plugin
;
172 * PURPLE_PLUGIN_ABI_VERSION:
174 * Note: The lower six nibbles represent the ABI version for libpurple, the
175 * rest are required by GPlugin.
177 * Returns: An ABI version to set in plugins using major and minor versions.
179 #define PURPLE_PLUGIN_ABI_VERSION(major,minor) \
180 (0x01000000 | ((major) << 16) | (minor))
183 * PURPLE_PLUGIN_ABI_MAJOR_VERSION:
185 * Returns: The major version from an ABI version
187 #define PURPLE_PLUGIN_ABI_MAJOR_VERSION(abi) \
191 * PURPLE_PLUGIN_ABI_MINOR_VERSION:
193 * Returns: The minor version from an ABI version
195 #define PURPLE_PLUGIN_ABI_MINOR_VERSION(abi) \
199 * PURPLE_ABI_VERSION:
201 * A convenienceā macro that returns an ABI version using PURPLE_MAJOR_VERSION
202 * and PURPLE_MINOR_VERSION
204 #define PURPLE_ABI_VERSION PURPLE_PLUGIN_ABI_VERSION(PURPLE_MAJOR_VERSION, PURPLE_MINOR_VERSION)
207 * PURPLE_PLUGIN_INIT:
209 * Defines the plugin's entry points.
211 #define PURPLE_PLUGIN_INIT(pluginname,pluginquery,pluginload,pluginunload) \
212 G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **e); \
213 G_MODULE_EXPORT GPluginPluginInfo *gplugin_query(GError **e) { \
214 return GPLUGIN_PLUGIN_INFO(pluginquery(e)); \
216 G_MODULE_EXPORT gboolean gplugin_load(GPluginNativePlugin *p, GError **e); \
217 G_MODULE_EXPORT gboolean gplugin_load(GPluginNativePlugin *p, GError **e) { \
218 return pluginload(PURPLE_PLUGIN(p), e); \
220 G_MODULE_EXPORT gboolean gplugin_unload(GPluginNativePlugin *p, GError **e); \
221 G_MODULE_EXPORT gboolean gplugin_unload(GPluginNativePlugin *p, GError **e) { \
222 return pluginunload(PURPLE_PLUGIN(p), e); \
226 * PURPLE_DEFINE_TYPE:
227 * @TN: The name of the new type, in Camel case.
228 * @t_n: The name of the new type, in lowercase, words separated by '_'.
229 * @T_P: The #GType of the parent type.
231 * A convenience macro for type implementations, which defines a *_get_type()
232 * function; and a *_register_type() function for use in your plugin's load
233 * function. You must define an instance initialization function *_init()
234 * and a class initialization function *_class_init() for the type.
236 #define PURPLE_DEFINE_TYPE(TN, t_n, T_P) \
237 PURPLE_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P)
240 * PURPLE_DEFINE_TYPE_EXTENDED:
241 * @TN: The name of the new type, in Camel case.
242 * @t_n: The name of the new type, in lowercase, words separated by '_'.
243 * @T_P: The #GType of the parent type.
244 * @flags: #GTypeFlags to register the type with.
245 * @CODE: Custom code that gets inserted in *_get_type().
247 * A more general version of PURPLE_DEFINE_TYPE() which allows you to
248 * specify #GTypeFlags and custom code.
250 #define PURPLE_DEFINE_TYPE_EXTENDED \
251 PURPLE_DEFINE_DYNAMIC_TYPE_EXTENDED
254 * PURPLE_IMPLEMENT_INTERFACE_STATIC:
255 * @TYPE_IFACE: The #GType of the interface to add.
256 * @iface_init: The interface init function.
258 * A convenience macro to ease static interface addition in the CODE section
259 * of PURPLE_DEFINE_TYPE_EXTENDED(). You should use this macro if the
260 * interface is a part of the libpurple core.
262 #define PURPLE_IMPLEMENT_INTERFACE_STATIC(TYPE_IFACE, iface_init) { \
263 const GInterfaceInfo interface_info = { \
264 (GInterfaceInitFunc) iface_init, NULL, NULL \
266 g_type_add_interface_static(type_id, TYPE_IFACE, &interface_info); \
270 * PURPLE_IMPLEMENT_INTERFACE:
271 * @TYPE_IFACE: The #GType of the interface to add.
272 * @iface_init: The interface init function.
274 * A convenience macro to ease interface addition in the CODE section
275 * of PURPLE_DEFINE_TYPE_EXTENDED(). You should use this macro if the
276 * interface lives in the plugin.
278 #define PURPLE_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init) \
279 PURPLE_IMPLEMENT_INTERFACE_DYNAMIC(TYPE_IFACE, iface_init)
282 * PURPLE_DEFINE_DYNAMIC_TYPE:
284 * A convenience macro for dynamic type implementations.
286 #define PURPLE_DEFINE_DYNAMIC_TYPE(TN, t_n, T_P) \
287 PURPLE_DEFINE_DYNAMIC_TYPE_EXTENDED (TN, t_n, T_P, 0, {})
290 * PURPLE_DEFINE_DYNAMIC_TYPE_EXTENDED:
292 * A more general version of PURPLE_DEFINE_DYNAMIC_TYPE().
294 #define PURPLE_DEFINE_DYNAMIC_TYPE_EXTENDED(TypeName, type_name, TYPE_PARENT, flags, CODE) \
295 static GType type_name##_type_id = 0; \
296 G_MODULE_EXPORT GType type_name##_get_type(void) { \
297 return type_name##_type_id; \
299 void type_name##_register_type(PurplePlugin *); \
300 void type_name##_register_type(PurplePlugin *plugin) { \
302 const GTypeInfo type_info = { \
303 sizeof (TypeName##Class), \
304 (GBaseInitFunc) NULL, \
305 (GBaseFinalizeFunc) NULL, \
306 (GClassInitFunc) type_name##_class_init, \
307 (GClassFinalizeFunc) NULL, \
311 (GInstanceInitFunc) type_name##_init, \
314 type_id = purple_plugin_register_type(plugin, TYPE_PARENT, #TypeName, \
315 &type_info, (GTypeFlags) flags); \
316 type_name##_type_id = type_id; \
321 * PURPLE_IMPLEMENT_INTERFACE_DYNAMIC:
323 * A convenience macro to ease dynamic interface addition.
325 #define PURPLE_IMPLEMENT_INTERFACE_DYNAMIC(TYPE_IFACE, iface_init) { \
326 const GInterfaceInfo interface_info = { \
327 (GInterfaceInitFunc) iface_init, NULL, NULL \
329 purple_plugin_add_interface(plugin, type_id, TYPE_IFACE, &interface_info); \
334 /**************************************************************************/
336 /**************************************************************************/
339 * purple_plugin_load:
340 * @plugin: The plugin to load.
341 * @error: Return location for a #GError or %NULL. If provided, this
342 * will be set to the reason if the load fails.
344 * Attempts to load a plugin.
346 * Also see purple_plugin_unload().
348 * Returns: %TRUE if successful or already loaded, %FALSE otherwise.
350 gboolean
purple_plugin_load(PurplePlugin
*plugin
, GError
**error
);
353 * purple_plugin_unload:
354 * @plugin: The plugin handle.
355 * @error: Return location for a #GError or %NULL. If provided, this
356 * will be set to the reason if the unload fails.
358 * Unloads the specified plugin.
360 * Also see purple_plugin_load().
362 * Returns: %TRUE if successful or not loaded, %FALSE otherwise.
364 gboolean
purple_plugin_unload(PurplePlugin
*plugin
, GError
**error
);
367 * purple_plugin_is_loaded:
368 * @plugin: The plugin.
370 * Returns whether or not a plugin is currently loaded.
372 * Returns: %TRUE if loaded, or %FALSE otherwise.
374 gboolean
purple_plugin_is_loaded(PurplePlugin
*plugin
);
377 * purple_plugin_get_filename:
378 * @plugin: The plugin.
380 * Returns a plugin's filename, along with the path.
382 * Returns: The plugin's filename.
384 const gchar
*purple_plugin_get_filename(PurplePlugin
*plugin
);
387 * purple_plugin_get_info:
388 * @plugin: The plugin.
390 * Returns a plugin's #PurplePluginInfo instance.
392 * Returns: (transfer none): The plugin's #PurplePluginInfo instance.
393 * GPlugin refs the plugin info object before returning it. This workaround
394 * is to avoid managing the reference counts everywhere in our codebase
395 * where we use the plugin info. The plugin info instance is guaranteed to
396 * exist as long as the plugin exists.
398 PurplePluginInfo
*purple_plugin_get_info(PurplePlugin
*plugin
);
401 * purple_plugin_disable:
405 * This function adds the plugin to a list of plugins to "disable at the next
406 * startup" by excluding said plugins from the list of plugins to save. The
407 * UI needs to call purple_plugins_save_loaded() after calling this for it
408 * to have any effect.
410 void purple_plugin_disable(PurplePlugin
*plugin
);
413 * purple_plugin_register_type:
414 * @plugin: The plugin that is registering the type.
415 * @parent: Type from which this type will be derived.
416 * @name: Name of the new type.
417 * @info: Information to initialize and destroy a type's classes and
419 * @flags: Bitwise combination of values that determines the nature
420 * (e.g. abstract or not) of the type.
422 * Registers a new dynamic type.
424 * Returns: The new GType, or %G_TYPE_INVALID if registration failed.
426 GType
purple_plugin_register_type(PurplePlugin
*plugin
, GType parent
,
427 const gchar
*name
, const GTypeInfo
*info
,
431 * purple_plugin_add_interface:
432 * @plugin: The plugin that is adding the interface type.
433 * @instance_type: The GType of the instantiable type.
434 * @interface_type: The GType of the interface type.
435 * @interface_info: Information used to manage the interface type.
437 * Adds a dynamic interface type to an instantiable type.
439 void purple_plugin_add_interface(PurplePlugin
*plugin
, GType instance_type
,
440 GType interface_type
,
441 const GInterfaceInfo
*interface_info
);
444 * purple_plugin_is_internal:
445 * @plugin: The plugin.
447 * Returns whether a plugin is an internal plugin. Internal plugins provide
448 * required additional functionality to the libpurple core. These plugins must
449 * not be shown in plugin lists. Examples of such plugins are in-tree protocol
450 * plugins, loaders etc.
452 * Returns: %TRUE if the plugin is an internal plugin, %FALSE otherwise.
454 gboolean
purple_plugin_is_internal(PurplePlugin
*plugin
);
457 * purple_plugin_get_dependent_plugins:
458 * @plugin: The plugin whose dependent plugins are returned.
460 * Returns a list of plugins that depend on a particular plugin.
462 * Returns: (element-type PurplePlugin) (transfer none): The list of a plugins that depend on the specified
465 GSList
*purple_plugin_get_dependent_plugins(PurplePlugin
*plugin
);
467 /**************************************************************************/
469 /**************************************************************************/
472 * purple_plugin_info_get_type:
474 * Returns: The #GType for the #PurplePluginInfo object.
476 GType
purple_plugin_info_get_type(void);
479 * purple_plugin_info_new:
480 * @first_property: The first property name
481 * @...: The value of the first property, followed optionally by more
482 * name/value pairs, followed by %NULL
484 * Creates a new #PurplePluginInfo instance to be returned from
485 * #plugin_query of a plugin, using the provided name/value pairs.
487 * All properties except <literal>"id"</literal> and
488 * <literal>"purple-abi"</literal> are optional.
490 * Valid property names are:
491 * <informaltable frame='none'>
492 * <tgroup cols='2'><tbody>
493 * <row><entry><literal>"id"</literal></entry>
494 * <entry>(string) The ID of the plugin.</entry>
496 * <row><entry><literal>"abi-version"</literal></entry>
497 * <entry>(<type>guint32</type>) The ABI version required by the
500 * <row><entry><literal>"name"</literal></entry>
501 * <entry>(string) The translated name of the plugin.</entry>
503 * <row><entry><literal>"version"</literal></entry>
504 * <entry>(string) Version of the plugin.</entry>
506 * <row><entry><literal>"category"</literal></entry>
507 * <entry>(string) Primary category of the plugin.</entry>
509 * <row><entry><literal>"summary"</literal></entry>
510 * <entry>(string) Brief summary of the plugin.</entry>
512 * <row><entry><literal>"description"</literal></entry>
513 * <entry>(string) Full description of the plugin.</entry>
515 * <row><entry><literal>"authors"</literal></entry>
516 * <entry>(<type>const gchar * const *</type>) A %NULL-terminated list of
517 * plugin authors. format: First Last <user\@domain.com></entry>
519 * <row><entry><literal>"website"</literal></entry>
520 * <entry>(string) Website of the plugin.</entry>
522 * <row><entry><literal>"icon"</literal></entry>
523 * <entry>(string) Path to a plugin's icon.</entry>
525 * <row><entry><literal>"license-id"</literal></entry>
526 * <entry>(string) Short name of the plugin's license. This should
527 * either be an identifier of the license from
528 * <ulink url="http://dep.debian.net/deps/dep5/#license-specification">
529 * DEP5</ulink> or "Other" for custom licenses.</entry>
531 * <row><entry><literal>"license-text"</literal></entry>
532 * <entry>(string) The text of the plugin's license, if unlisted on
535 * <row><entry><literal>"license-url"</literal></entry>
536 * <entry>(string) The plugin's license URL, if unlisted on DEP5.</entry>
538 * <row><entry><literal>"dependencies"</literal></entry>
539 * <entry>(<type>const gchar * const *</type>) A %NULL-terminated list of
540 * plugin IDs required by the plugin.</entry>
542 * <row><entry><literal>"actions-cb"</literal></entry>
543 * <entry>(#PurplePluginActionsCb) Callback that returns a list of
544 * actions the plugin can perform.</entry>
546 * <row><entry><literal>"extra-cb"</literal></entry>
547 * <entry>(#PurplePluginExtraCb) Callback that returns a newly
548 * allocated string denoting extra information about a plugin.</entry>
550 * <row><entry><literal>"pref-frame-cb"</literal></entry>
551 * <entry>(#PurplePluginPrefFrameCb) Callback that returns a
552 * preferences frame for the plugin.</entry>
554 * <row><entry><literal>"pref-request-cb"</literal></entry>
555 * <entry>(#PurplePluginPrefRequestCb) Callback that returns a
556 * preferences request handle for the plugin.</entry>
558 * <row><entry><literal>"flags"</literal></entry>
559 * <entry>(#PurplePluginInfoFlags) The flags for a plugin.</entry>
564 * See #PURPLE_PLUGIN_ABI_VERSION,
565 * <link linkend="chapter-plugin-ids">Plugin IDs</link>.
567 * Returns: A new #PurplePluginInfo instance.
569 PurplePluginInfo
*purple_plugin_info_new(const char *first_property
, ...)
570 G_GNUC_NULL_TERMINATED
;
573 * purple_plugin_info_get_id:
574 * @info: The plugin's info instance.
576 * Returns a plugin's ID.
578 * Returns: The plugin's ID.
580 const gchar
*purple_plugin_info_get_id(const PurplePluginInfo
*info
);
583 * purple_plugin_info_get_name:
584 * @info: The plugin's info instance.
586 * Returns a plugin's translated name.
588 * Returns: The name of the plugin, or %NULL.
590 const gchar
*purple_plugin_info_get_name(const PurplePluginInfo
*info
);
593 * purple_plugin_info_get_version:
594 * @info: The plugin's info instance.
596 * Returns a plugin's version.
598 * Returns: The version of the plugin, or %NULL.
600 const gchar
*purple_plugin_info_get_version(const PurplePluginInfo
*info
);
603 * purple_plugin_info_get_category:
604 * @info: The plugin's info instance.
606 * Returns a plugin's primary category.
608 * Returns: The primary category of the plugin, or %NULL.
610 const gchar
*purple_plugin_info_get_category(const PurplePluginInfo
*info
);
613 * purple_plugin_info_get_summary:
614 * @info: The plugin's info instance.
616 * Returns a plugin's summary.
618 * Returns: The summary of the plugin, or %NULL.
620 const gchar
*purple_plugin_info_get_summary(const PurplePluginInfo
*info
);
623 * purple_plugin_info_get_description:
624 * @info: The plugin's info instance.
626 * Returns a plugin's description.
628 * Returns: The description of the plugin, or %NULL.
630 const gchar
*purple_plugin_info_get_description(const PurplePluginInfo
*info
);
633 * purple_plugin_info_get_authors:
634 * @info: The plugin's info instance.
636 * Returns a NULL-terminated list of the plugin's authors.
638 * Returns: The authors of the plugin, or %NULL.
640 const gchar
* const *
641 purple_plugin_info_get_authors(const PurplePluginInfo
*info
);
644 * purple_plugin_info_get_website:
645 * @info: The plugin's info instance.
647 * Returns a plugin's website.
649 * Returns: The website of the plugin, or %NULL.
651 const gchar
*purple_plugin_info_get_website(const PurplePluginInfo
*info
);
654 * purple_plugin_info_get_icon:
655 * @info: The plugin's info instance.
657 * Returns the path to a plugin's icon.
659 * Returns: The path to the plugin's icon, or %NULL.
661 const gchar
*purple_plugin_info_get_icon(const PurplePluginInfo
*info
);
664 * purple_plugin_info_get_license_id:
665 * @info: The plugin's info instance.
667 * Returns a short name of the plugin's license.
669 * Returns: The license name of the plugin, or %NULL.
671 const gchar
*purple_plugin_info_get_license_id(const PurplePluginInfo
*info
);
674 * purple_plugin_info_get_license_text:
675 * @info: The plugin's info instance.
677 * Returns the text of a plugin's license.
679 * Returns: The license text of the plugin, or %NULL.
681 const gchar
*purple_plugin_info_get_license_text(const PurplePluginInfo
*info
);
684 * purple_plugin_info_get_license_url:
685 * @info: The plugin's info instance.
687 * Returns the URL of a plugin's license.
689 * Returns: The license URL of the plugin, or %NULL.
691 const gchar
*purple_plugin_info_get_license_url(const PurplePluginInfo
*info
);
694 * purple_plugin_info_get_dependencies:
695 * @info: The plugin's info instance.
697 * Returns a NULL-terminated list of IDs of plugins required by a plugin.
699 * Returns: The dependencies of the plugin, or %NULL.
701 const gchar
* const *
702 purple_plugin_info_get_dependencies(const PurplePluginInfo
*info
);
705 * purple_plugin_info_get_abi_version:
706 * @info: The plugin's info instance.
708 * Returns the required purple ABI version for a plugin.
710 * Returns: The required purple ABI version for the plugin.
712 guint32
purple_plugin_info_get_abi_version(const PurplePluginInfo
*info
);
715 * purple_plugin_info_get_actions_cb:
716 * @info: The plugin info to get the callback from.
718 * Returns the callback that retrieves the list of actions a plugin can perform
721 * Returns: The callback that returns a list of #PurplePluginAction
722 * instances corresponding to the actions a plugin can perform.
724 PurplePluginActionsCb
725 purple_plugin_info_get_actions_cb(PurplePluginInfo
*info
);
728 * purple_plugin_info_get_extra_cb:
729 * @info: The plugin info to get extra information from.
731 * Returns a callback that gives extra information about a plugin. You must
732 * free the string returned by this callback.
734 * Returns: The callback that returns extra information about a plugin.
737 purple_plugin_info_get_extra_cb(PurplePluginInfo
*info
);
740 * purple_plugin_info_get_pref_frame_cb:
741 * @info: The plugin info to get the callback from.
743 * Returns the callback that retrieves the preferences frame for a plugin, set
744 * via the "pref-frame-cb" property of the plugin info.
746 * Returns: The callback that returns the preferences frame.
748 PurplePluginPrefFrameCb
749 purple_plugin_info_get_pref_frame_cb(PurplePluginInfo
*info
);
752 * purple_plugin_info_get_pref_request_cb:
753 * @info: The plugin info to get the callback from.
755 * Returns the callback that retrieves the preferences request handle for a
756 * plugin, set via the "pref-request-cb" property of the plugin info.
758 * Returns: The callback that returns the preferences request handle.
760 PurplePluginPrefRequestCb
761 purple_plugin_info_get_pref_request_cb(PurplePluginInfo
*info
);
764 * purple_plugin_info_get_flags:
765 * @info: The plugin's info instance.
767 * Returns the plugin's flags.
769 * Returns: The flags of the plugin.
771 PurplePluginInfoFlags
772 purple_plugin_info_get_flags(PurplePluginInfo
*info
);
775 * purple_plugin_info_get_error:
776 * @info: The plugin info.
778 * Returns an error in the plugin info that would prevent the plugin from being
781 * Returns: The plugin info error, or %NULL.
783 const gchar
*purple_plugin_info_get_error(PurplePluginInfo
*info
);
786 * purple_plugin_info_set_ui_data:
787 * @info: The plugin's info instance.
788 * @ui_data: A pointer to associate with this object.
790 * Set the UI data associated with a plugin.
792 void purple_plugin_info_set_ui_data(PurplePluginInfo
*info
, gpointer ui_data
);
795 * purple_plugin_info_get_ui_data:
796 * @info: The plugin's info instance.
798 * Returns the UI data associated with a plugin.
800 * Returns: The UI data associated with this plugin. This is a
801 * convenience field provided to the UIs--it is not
802 * used by the libpurple core.
804 gpointer
purple_plugin_info_get_ui_data(const PurplePluginInfo
*info
);
806 /**************************************************************************/
807 /* PluginAction API */
808 /**************************************************************************/
811 * purple_plugin_action_get_type:
813 * Returns: The #GType for the #PurplePluginAction boxed structure.
815 GType
purple_plugin_action_get_type(void);
818 * purple_plugin_action_new:
819 * @label: The description of the action to show to the user.
820 * @callback: (scope call): The callback to call when the user selects this
823 * Allocates and returns a new PurplePluginAction. Use this to add actions in a
824 * list in the "actions-cb" callback for your plugin.
826 PurplePluginAction
*purple_plugin_action_new(const char* label
,
827 PurplePluginActionCb callback
);
830 * purple_plugin_action_free:
831 * @action: The PurplePluginAction to free.
833 * Frees a PurplePluginAction
835 void purple_plugin_action_free(PurplePluginAction
*action
);
837 /**************************************************************************/
839 /**************************************************************************/
842 * purple_plugins_find_all:
844 * Returns a list of all plugins, whether loaded or not.
846 * Returns: (element-type PurplePlugin) (transfer full): A list of all plugins.
847 * The list is owned by the caller, and must be
848 * g_list_free()d to avoid leaking the nodes.
850 GList
*purple_plugins_find_all(void);
853 * purple_plugins_get_loaded:
855 * Returns a list of all loaded plugins.
857 * Returns: (element-type PurplePlugin) (transfer none): A list of all loaded plugins.
859 GList
*purple_plugins_get_loaded(void);
862 * purple_plugins_add_search_path:
863 * @path: The new search path.
865 * Add a new directory to search for plugins
867 void purple_plugins_add_search_path(const gchar
*path
);
870 * purple_plugins_refresh:
872 * Forces a refresh of all plugins found in the search paths, and loads plugins
873 * that are to be auto-loaded.
875 * See purple_plugins_add_search_path().
877 void purple_plugins_refresh(void);
880 * purple_plugins_find_plugin:
881 * @id: The plugin ID.
883 * Finds a plugin with the specified plugin ID.
885 * Returns: (transfer none): The plugin if found, or %NULL if not found.
887 PurplePlugin
*purple_plugins_find_plugin(const gchar
*id
);
890 * purple_plugins_find_by_filename:
891 * @filename: The plugin filename.
893 * Finds a plugin with the specified filename (filename with a path).
895 * Returns: (transfer none): The plugin if found, or %NULL if not found.
897 PurplePlugin
*purple_plugins_find_by_filename(const char *filename
);
900 * purple_plugins_save_loaded:
901 * @key: The preference key to save the list of plugins to.
903 * Saves the list of loaded plugins to the specified preference key.
904 * Plugins that are set to auto-load are not saved.
906 void purple_plugins_save_loaded(const char *key
);
909 * purple_plugins_load_saved:
910 * @key: The preference key containing the list of plugins.
912 * Attempts to load all the plugins in the specified preference key
913 * that were loaded when purple last quit.
915 void purple_plugins_load_saved(const char *key
);
917 /**************************************************************************/
918 /* Plugins Subsystem API */
919 /**************************************************************************/
922 * purple_plugins_get_handle:
924 * Returns the plugin subsystem handle.
926 * Returns: (transfer none): The plugin sybsystem handle.
928 void *purple_plugins_get_handle(void);
931 * purple_plugins_init:
933 * Initializes the plugin subsystem
935 void purple_plugins_init(void);
938 * purple_plugins_uninit:
940 * Uninitializes the plugin subsystem
942 void purple_plugins_uninit(void);
946 #endif /* PURPLE_PLUGINS_H */