Mercurial > pidgin.yaz
comparison libpurple/pluginpref.h @ 15823:32c366eeeb99
sed -ie 's/gaim/purple/g'
| author | Sean Egan <seanegan@gmail.com> |
|---|---|
| date | Mon, 19 Mar 2007 07:01:17 +0000 |
| parents | 5fe8042783c1 |
| children | 44b4e8bd759b |
comparison
equal
deleted
inserted
replaced
| 15822:84b0f9b23ede | 15823:32c366eeeb99 |
|---|---|
| 1 /** | 1 /** |
| 2 * @file pluginpref.h Plugin Preferences API | 2 * @file pluginpref.h Plugin Preferences API |
| 3 * @ingroup core | 3 * @ingroup core |
| 4 * | 4 * |
| 5 * gaim | 5 * purple |
| 6 * | 6 * |
| 7 * Gaim is the legal property of its developers, whose names are too numerous | 7 * Purple is the legal property of its developers, whose names are too numerous |
| 8 * to list here. Please refer to the COPYRIGHT file distributed with this | 8 * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 * source distribution. | 9 * source distribution. |
| 10 * | 10 * |
| 11 * This program is free software; you can redistribute it and/or modify | 11 * This program is free software; you can redistribute it and/or modify |
| 12 * it under the terms of the GNU General Public License as published by | 12 * it under the terms of the GNU General Public License as published by |
| 21 * You should have received a copy of the GNU General Public License | 21 * You should have received a copy of the GNU General Public License |
| 22 * along with this program; if not, write to the Free Software | 22 * along with this program; if not, write to the Free Software |
| 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 #ifndef _GAIM_PLUGINPREF_H_ | 26 #ifndef _PURPLE_PLUGINPREF_H_ |
| 27 #define _GAIM_PLUGINPREF_H_ | 27 #define _PURPLE_PLUGINPREF_H_ |
| 28 | 28 |
| 29 typedef struct _GaimPluginPrefFrame GaimPluginPrefFrame; | 29 typedef struct _PurplePluginPrefFrame PurplePluginPrefFrame; |
| 30 typedef struct _GaimPluginPref GaimPluginPref; | 30 typedef struct _PurplePluginPref PurplePluginPref; |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * String format for preferences. | 33 * String format for preferences. |
| 34 */ | 34 */ |
| 35 typedef enum | 35 typedef enum |
| 36 { | 36 { |
| 37 GAIM_STRING_FORMAT_TYPE_NONE = 0, | 37 PURPLE_STRING_FORMAT_TYPE_NONE = 0, |
| 38 GAIM_STRING_FORMAT_TYPE_MULTILINE = 1 << 0, | 38 PURPLE_STRING_FORMAT_TYPE_MULTILINE = 1 << 0, |
| 39 GAIM_STRING_FORMAT_TYPE_HTML = 1 << 1 | 39 PURPLE_STRING_FORMAT_TYPE_HTML = 1 << 1 |
| 40 } GaimStringFormatType; | 40 } PurpleStringFormatType; |
| 41 | 41 |
| 42 typedef enum { | 42 typedef enum { |
| 43 GAIM_PLUGIN_PREF_NONE, | 43 PURPLE_PLUGIN_PREF_NONE, |
| 44 GAIM_PLUGIN_PREF_CHOICE, | 44 PURPLE_PLUGIN_PREF_CHOICE, |
| 45 GAIM_PLUGIN_PREF_INFO, /**< no-value label */ | 45 PURPLE_PLUGIN_PREF_INFO, /**< no-value label */ |
| 46 GAIM_PLUGIN_PREF_STRING_FORMAT | 46 PURPLE_PLUGIN_PREF_STRING_FORMAT |
| 47 } GaimPluginPrefType; | 47 } PurplePluginPrefType; |
| 48 | 48 |
| 49 #include <glib.h> | 49 #include <glib.h> |
| 50 #include "prefs.h" | 50 #include "prefs.h" |
| 51 | 51 |
| 52 #ifdef __cplusplus | 52 #ifdef __cplusplus |
| 59 /*@{*/ | 59 /*@{*/ |
| 60 | 60 |
| 61 /** | 61 /** |
| 62 * Create a new plugin preference frame | 62 * Create a new plugin preference frame |
| 63 * | 63 * |
| 64 * @return a new GaimPluginPrefFrame | 64 * @return a new PurplePluginPrefFrame |
| 65 */ | 65 */ |
| 66 GaimPluginPrefFrame *gaim_plugin_pref_frame_new(void); | 66 PurplePluginPrefFrame *purple_plugin_pref_frame_new(void); |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * Destroy a plugin preference frame | 69 * Destroy a plugin preference frame |
| 70 * | 70 * |
| 71 * @param frame The plugin frame to destroy | 71 * @param frame The plugin frame to destroy |
| 72 */ | 72 */ |
| 73 void gaim_plugin_pref_frame_destroy(GaimPluginPrefFrame *frame); | 73 void purple_plugin_pref_frame_destroy(PurplePluginPrefFrame *frame); |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * Adds a plugin preference to a plugin preference frame | 76 * Adds a plugin preference to a plugin preference frame |
| 77 * | 77 * |
| 78 * @param frame The plugin frame to add the preference to | 78 * @param frame The plugin frame to add the preference to |
| 79 * @param pref The preference to add to the frame | 79 * @param pref The preference to add to the frame |
| 80 */ | 80 */ |
| 81 void gaim_plugin_pref_frame_add(GaimPluginPrefFrame *frame, GaimPluginPref *pref); | 81 void purple_plugin_pref_frame_add(PurplePluginPrefFrame *frame, PurplePluginPref *pref); |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * Get the plugin preferences from a plugin preference frame | 84 * Get the plugin preferences from a plugin preference frame |
| 85 * | 85 * |
| 86 * @param frame The plugin frame to get the plugin preferences from | 86 * @param frame The plugin frame to get the plugin preferences from |
| 87 * @return a GList of plugin preferences | 87 * @return a GList of plugin preferences |
| 88 */ | 88 */ |
| 89 GList *gaim_plugin_pref_frame_get_prefs(GaimPluginPrefFrame *frame); | 89 GList *purple_plugin_pref_frame_get_prefs(PurplePluginPrefFrame *frame); |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * Create a new plugin preference | 92 * Create a new plugin preference |
| 93 * | 93 * |
| 94 * @return a new GaimPluginPref | 94 * @return a new PurplePluginPref |
| 95 */ | 95 */ |
| 96 GaimPluginPref *gaim_plugin_pref_new(void); | 96 PurplePluginPref *purple_plugin_pref_new(void); |
| 97 | 97 |
| 98 /** | 98 /** |
| 99 * Create a new plugin preference with name | 99 * Create a new plugin preference with name |
| 100 * | 100 * |
| 101 * @param name The name of the pref | 101 * @param name The name of the pref |
| 102 * @return a new GaimPluginPref | 102 * @return a new PurplePluginPref |
| 103 */ | 103 */ |
| 104 GaimPluginPref *gaim_plugin_pref_new_with_name(const char *name); | 104 PurplePluginPref *purple_plugin_pref_new_with_name(const char *name); |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * Create a new plugin preference with label | 107 * Create a new plugin preference with label |
| 108 * | 108 * |
| 109 * @param label The label to be displayed | 109 * @param label The label to be displayed |
| 110 * @return a new GaimPluginPref | 110 * @return a new PurplePluginPref |
| 111 */ | 111 */ |
| 112 GaimPluginPref *gaim_plugin_pref_new_with_label(const char *label); | 112 PurplePluginPref *purple_plugin_pref_new_with_label(const char *label); |
| 113 | 113 |
| 114 /** | 114 /** |
| 115 * Create a new plugin preference with name and label | 115 * Create a new plugin preference with name and label |
| 116 * | 116 * |
| 117 * @param name The name of the pref | 117 * @param name The name of the pref |
| 118 * @param label The label to be displayed | 118 * @param label The label to be displayed |
| 119 * @return a new GaimPluginPref | 119 * @return a new PurplePluginPref |
| 120 */ | 120 */ |
| 121 GaimPluginPref *gaim_plugin_pref_new_with_name_and_label(const char *name, const char *label); | 121 PurplePluginPref *purple_plugin_pref_new_with_name_and_label(const char *name, const char *label); |
| 122 | 122 |
| 123 /** | 123 /** |
| 124 * Destroy a plugin preference | 124 * Destroy a plugin preference |
| 125 * | 125 * |
| 126 * @param pref The preference to destroy | 126 * @param pref The preference to destroy |
| 127 */ | 127 */ |
| 128 void gaim_plugin_pref_destroy(GaimPluginPref *pref); | 128 void purple_plugin_pref_destroy(PurplePluginPref *pref); |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * Set a plugin pref name | 131 * Set a plugin pref name |
| 132 * | 132 * |
| 133 * @param pref The plugin pref | 133 * @param pref The plugin pref |
| 134 * @param name The name of the pref | 134 * @param name The name of the pref |
| 135 */ | 135 */ |
| 136 void gaim_plugin_pref_set_name(GaimPluginPref *pref, const char *name); | 136 void purple_plugin_pref_set_name(PurplePluginPref *pref, const char *name); |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * Get a plugin pref name | 139 * Get a plugin pref name |
| 140 * | 140 * |
| 141 * @param pref The plugin pref | 141 * @param pref The plugin pref |
| 142 * @return The name of the pref | 142 * @return The name of the pref |
| 143 */ | 143 */ |
| 144 const char *gaim_plugin_pref_get_name(GaimPluginPref *pref); | 144 const char *purple_plugin_pref_get_name(PurplePluginPref *pref); |
| 145 | 145 |
| 146 /** | 146 /** |
| 147 * Set a plugin pref label | 147 * Set a plugin pref label |
| 148 * | 148 * |
| 149 * @param pref The plugin pref | 149 * @param pref The plugin pref |
| 150 * @param label The label for the plugin pref | 150 * @param label The label for the plugin pref |
| 151 */ | 151 */ |
| 152 void gaim_plugin_pref_set_label(GaimPluginPref *pref, const char *label); | 152 void purple_plugin_pref_set_label(PurplePluginPref *pref, const char *label); |
| 153 | 153 |
| 154 /** | 154 /** |
| 155 * Get a plugin pref label | 155 * Get a plugin pref label |
| 156 * | 156 * |
| 157 * @param pref The plugin pref | 157 * @param pref The plugin pref |
| 158 * @return The label for the plugin pref | 158 * @return The label for the plugin pref |
| 159 */ | 159 */ |
| 160 const char *gaim_plugin_pref_get_label(GaimPluginPref *pref); | 160 const char *purple_plugin_pref_get_label(PurplePluginPref *pref); |
| 161 | 161 |
| 162 /** | 162 /** |
| 163 * Set the bounds for an integer pref | 163 * Set the bounds for an integer pref |
| 164 * | 164 * |
| 165 * @param pref The plugin pref | 165 * @param pref The plugin pref |
| 166 * @param min The min value | 166 * @param min The min value |
| 167 * @param max The max value | 167 * @param max The max value |
| 168 */ | 168 */ |
| 169 void gaim_plugin_pref_set_bounds(GaimPluginPref *pref, int min, int max); | 169 void purple_plugin_pref_set_bounds(PurplePluginPref *pref, int min, int max); |
| 170 | 170 |
| 171 /** | 171 /** |
| 172 * Get the bounds for an integer pref | 172 * Get the bounds for an integer pref |
| 173 * | 173 * |
| 174 * @param pref The plugin pref | 174 * @param pref The plugin pref |
| 175 * @param min The min value | 175 * @param min The min value |
| 176 * @param max The max value | 176 * @param max The max value |
| 177 */ | 177 */ |
| 178 void gaim_plugin_pref_get_bounds(GaimPluginPref *pref, int *min, int *max); | 178 void purple_plugin_pref_get_bounds(PurplePluginPref *pref, int *min, int *max); |
| 179 | 179 |
| 180 /** | 180 /** |
| 181 * Set the type of a plugin pref | 181 * Set the type of a plugin pref |
| 182 * | 182 * |
| 183 * @param pref The plugin pref | 183 * @param pref The plugin pref |
| 184 * @param type The type | 184 * @param type The type |
| 185 */ | 185 */ |
| 186 void gaim_plugin_pref_set_type(GaimPluginPref *pref, GaimPluginPrefType type); | 186 void purple_plugin_pref_set_type(PurplePluginPref *pref, PurplePluginPrefType type); |
| 187 | 187 |
| 188 /** | 188 /** |
| 189 * Get the type of a plugin pref | 189 * Get the type of a plugin pref |
| 190 * | 190 * |
| 191 * @param pref The plugin pref | 191 * @param pref The plugin pref |
| 192 * @return The type | 192 * @return The type |
| 193 */ | 193 */ |
| 194 GaimPluginPrefType gaim_plugin_pref_get_type(GaimPluginPref *pref); | 194 PurplePluginPrefType purple_plugin_pref_get_type(PurplePluginPref *pref); |
| 195 | 195 |
| 196 /** | 196 /** |
| 197 * Set the choices for a choices plugin pref | 197 * Set the choices for a choices plugin pref |
| 198 * | 198 * |
| 199 * @param pref The plugin pref | 199 * @param pref The plugin pref |
| 200 * @param label The label for the choice | 200 * @param label The label for the choice |
| 201 * @param choice A gpointer of the choice | 201 * @param choice A gpointer of the choice |
| 202 */ | 202 */ |
| 203 void gaim_plugin_pref_add_choice(GaimPluginPref *pref, const char *label, gpointer choice); | 203 void purple_plugin_pref_add_choice(PurplePluginPref *pref, const char *label, gpointer choice); |
| 204 | 204 |
| 205 /** | 205 /** |
| 206 * Get the choices for a choices plugin pref | 206 * Get the choices for a choices plugin pref |
| 207 * | 207 * |
| 208 * @param pref The plugin pref | 208 * @param pref The plugin pref |
| 209 * @return GList of the choices | 209 * @return GList of the choices |
| 210 */ | 210 */ |
| 211 GList *gaim_plugin_pref_get_choices(GaimPluginPref *pref); | 211 GList *purple_plugin_pref_get_choices(PurplePluginPref *pref); |
| 212 | 212 |
| 213 /** | 213 /** |
| 214 * Set the max length for a string plugin pref | 214 * Set the max length for a string plugin pref |
| 215 * | 215 * |
| 216 * @param pref The plugin pref | 216 * @param pref The plugin pref |
| 217 * @param max_length The max length of the string | 217 * @param max_length The max length of the string |
| 218 */ | 218 */ |
| 219 void gaim_plugin_pref_set_max_length(GaimPluginPref *pref, unsigned int max_length); | 219 void purple_plugin_pref_set_max_length(PurplePluginPref *pref, unsigned int max_length); |
| 220 | 220 |
| 221 /** | 221 /** |
| 222 * Get the max length for a string plugin pref | 222 * Get the max length for a string plugin pref |
| 223 * | 223 * |
| 224 * @param pref The plugin pref | 224 * @param pref The plugin pref |
| 225 * @return the max length | 225 * @return the max length |
| 226 */ | 226 */ |
| 227 unsigned int gaim_plugin_pref_get_max_length(GaimPluginPref *pref); | 227 unsigned int purple_plugin_pref_get_max_length(PurplePluginPref *pref); |
| 228 | 228 |
| 229 /** | 229 /** |
| 230 * Sets the masking of a string plugin pref | 230 * Sets the masking of a string plugin pref |
| 231 * | 231 * |
| 232 * @param pref The plugin pref | 232 * @param pref The plugin pref |
| 233 * @param mask The value to set | 233 * @param mask The value to set |
| 234 */ | 234 */ |
| 235 void gaim_plugin_pref_set_masked(GaimPluginPref *pref, gboolean mask); | 235 void purple_plugin_pref_set_masked(PurplePluginPref *pref, gboolean mask); |
| 236 | 236 |
| 237 /** | 237 /** |
| 238 * Gets the masking of a string plugin pref | 238 * Gets the masking of a string plugin pref |
| 239 * | 239 * |
| 240 * @param pref The plugin pref | 240 * @param pref The plugin pref |
| 241 * @return The masking | 241 * @return The masking |
| 242 */ | 242 */ |
| 243 gboolean gaim_plugin_pref_get_masked(GaimPluginPref *pref); | 243 gboolean purple_plugin_pref_get_masked(PurplePluginPref *pref); |
| 244 | 244 |
| 245 /** | 245 /** |
| 246 * Sets the format type for a formattable-string plugin pref. You need to set the | 246 * Sets the format type for a formattable-string plugin pref. You need to set the |
| 247 * pref type to GAIM_PLUGIN_PREF_STRING_FORMAT first before setting the format. | 247 * pref type to PURPLE_PLUGIN_PREF_STRING_FORMAT first before setting the format. |
| 248 * | 248 * |
| 249 * @param pref The plugin pref | 249 * @param pref The plugin pref |
| 250 * @param format The format of the string | 250 * @param format The format of the string |
| 251 */ | 251 */ |
| 252 void gaim_plugin_pref_set_format_type(GaimPluginPref *pref, GaimStringFormatType format); | 252 void purple_plugin_pref_set_format_type(PurplePluginPref *pref, PurpleStringFormatType format); |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * Gets the format type of the formattable-string plugin pref. | 255 * Gets the format type of the formattable-string plugin pref. |
| 256 * | 256 * |
| 257 * @param pref The plugin pref | 257 * @param pref The plugin pref |
| 258 * @return The format of the pref | 258 * @return The format of the pref |
| 259 */ | 259 */ |
| 260 GaimStringFormatType gaim_plugin_pref_get_format_type(GaimPluginPref *pref); | 260 PurpleStringFormatType purple_plugin_pref_get_format_type(PurplePluginPref *pref); |
| 261 | 261 |
| 262 /*@}*/ | 262 /*@}*/ |
| 263 | 263 |
| 264 #ifdef __cplusplus | 264 #ifdef __cplusplus |
| 265 } | 265 } |
| 266 #endif | 266 #endif |
| 267 | 267 |
| 268 #endif /* _GAIM_PLUGINPREF_H_ */ | 268 #endif /* _PURPLE_PLUGINPREF_H_ */ |
