libpurple/plugins.h

branch
soc.2013.gobjectification.plugins
changeset 36653
4084c34c051d
parent 36642
b8ba53daa445
child 36696
b9b2b5697680
equal deleted inserted replaced
36652:26e1983c5788 36653:4084c34c051d
69 #define PURPLE_PLUGIN_CLASS(klass) G_OBJECT_CLASS(klass) 69 #define PURPLE_PLUGIN_CLASS(klass) G_OBJECT_CLASS(klass)
70 #define PURPLE_IS_PLUGIN(obj) G_IS_OBJECT(obj) 70 #define PURPLE_IS_PLUGIN(obj) G_IS_OBJECT(obj)
71 #define PURPLE_IS_PLUGIN_CLASS(klass) G_IS_OBJECT_CLASS(klass) 71 #define PURPLE_IS_PLUGIN_CLASS(klass) G_IS_OBJECT_CLASS(klass)
72 #define PURPLE_PLUGIN_GET_CLASS(obj) G_OBJECT_GET_CLASS(obj) 72 #define PURPLE_PLUGIN_GET_CLASS(obj) G_OBJECT_GET_CLASS(obj)
73 73
74 #define GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY 0
75 #define GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL 0
76
77 typedef GObject PurplePlugin; 74 typedef GObject PurplePlugin;
78 typedef GObjectClass PurplePluginClass; 75 typedef GObjectClass PurplePluginClass;
79 76
80 #endif /* PURPLE_PLUGINS */ 77 #endif /* PURPLE_PLUGINS */
81 78
99 #include "pluginpref.h" 96 #include "pluginpref.h"
100 97
101 typedef void (*PurplePluginActionCallback)(PurplePluginAction *); 98 typedef void (*PurplePluginActionCallback)(PurplePluginAction *);
102 typedef GList *(*PurplePluginGetActionsCallback)(PurplePlugin *); 99 typedef GList *(*PurplePluginGetActionsCallback)(PurplePlugin *);
103 typedef PurplePluginPrefFrame *(*PurplePluginPrefFrameCallback)(PurplePlugin *); 100 typedef PurplePluginPrefFrame *(*PurplePluginPrefFrameCallback)(PurplePlugin *);
101
102 /**
103 * Flags that can be used to treat plugins differently.
104 */
105 typedef enum /*< flags >*/
106 {
107 PURPLE_PLUGIN_INFO_FLAGS_INTERNAL = 1 << 1, /**< Plugin is not shown in UI lists */
108 PURPLE_PLUGIN_INFO_FLAGS_AUTO_LOAD = 1 << 2, /**< Auto-load the plugin */
109 } PurplePluginInfoFlags;
104 110
105 /** 111 /**
106 * Holds information about a plugin. 112 * Holds information about a plugin.
107 */ 113 */
108 struct _PurplePluginInfo { 114 struct _PurplePluginInfo {
399 * "get-actions" (PurplePluginGetActionsCallback) Callback that 405 * "get-actions" (PurplePluginGetActionsCallback) Callback that
400 * returns a list of actions the plugin can 406 * returns a list of actions the plugin can
401 * perform. \n 407 * perform. \n
402 * "preferences-frame" (PurplePluginPrefFrameCallback) Callback that returns 408 * "preferences-frame" (PurplePluginPrefFrameCallback) Callback that returns
403 * a preferences frame for the plugin. 409 * a preferences frame for the plugin.
404 * 410 * "flags" (PurplePluginInfoFlags) The flags for a plugin. \n
405 * Additionally, you can provide a "flags" property if the plugin is to be
406 * distributed with libpurple, the value for which should be a bitwise
407 * combination of: \n
408 * GPLUGIN_PLUGIN_INFO_FLAGS_INTERNAL: Internal plugin, not shown in lists. \n
409 * GPLUGIN_PLUGIN_INFO_FLAGS_LOAD_ON_QUERY: Auto-load on query. \n
410 * 411 *
411 * @param first_property The first property name 412 * @param first_property The first property name
412 * @param ... The value of the first property, followed optionally by more 413 * @param ... The value of the first property, followed optionally by more
413 * name/value pairs, followed by @c NULL 414 * name/value pairs, followed by @c NULL
414 * 415 *
569 */ 570 */
570 PurplePluginPrefFrameCallback 571 PurplePluginPrefFrameCallback
571 purple_plugin_info_get_pref_frame_callback(const PurplePluginInfo *info); 572 purple_plugin_info_get_pref_frame_callback(const PurplePluginInfo *info);
572 573
573 /** 574 /**
575 * Returns the plugin's flags.
576 *
577 * @param info The plugin's info instance.
578 *
579 * @return The flags of the plugin.
580 */
581 PurplePluginInfoFlags
582 purple_plugin_info_get_flags(const PurplePluginInfo *info);
583
584 /**
574 * Returns an error in the plugin info that would prevent the plugin from being 585 * Returns an error in the plugin info that would prevent the plugin from being
575 * loaded. 586 * loaded.
576 * 587 *
577 * @param info The plugin info. 588 * @param info The plugin info.
578 * 589 *

mercurial