Wed, 13 May 2009 20:29:03 +0000
Support custom smileys in MUCs (when all participants support BoB and a maximum
of 10 participants are in the chat).
Always announce support for BoB, since disable custom smileys will still turn
off fetching them, and BoB can be used for other purposes further on.
| 8713 | 1 | /** |
| 2 | * @file pluginpref.h Plugin Preferences API | |
| 3 | * @ingroup core | |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* purple |
| 8713 | 7 | * |
| 15884 | 8 | * Purple is the legal property of its developers, whose names are too numerous |
| 8713 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
| 11 | * | |
| 12 | * This program is free software; you can redistribute it and/or modify | |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
15884
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8713 | 25 | * |
| 26 | */ | |
| 15884 | 27 | #ifndef _PURPLE_PLUGINPREF_H_ |
| 28 | #define _PURPLE_PLUGINPREF_H_ | |
| 8713 | 29 | |
| 15884 | 30 | typedef struct _PurplePluginPrefFrame PurplePluginPrefFrame; |
| 31 | typedef struct _PurplePluginPref PurplePluginPref; | |
| 8713 | 32 | |
| 14782 | 33 | /** |
| 34 | * String format for preferences. | |
| 35 | */ | |
| 36 | typedef enum | |
| 37 | { | |
|
20940
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
38 | PURPLE_STRING_FORMAT_TYPE_NONE = 0, /**< The string is plain text. */ |
|
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
39 | PURPLE_STRING_FORMAT_TYPE_MULTILINE = 1 << 0, /**< The string can have newlines. */ |
|
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
40 | PURPLE_STRING_FORMAT_TYPE_HTML = 1 << 1 /**< The string can be in HTML. */ |
| 15884 | 41 | } PurpleStringFormatType; |
| 14782 | 42 | |
| 8713 | 43 | typedef enum { |
| 15884 | 44 | PURPLE_PLUGIN_PREF_NONE, |
| 45 | PURPLE_PLUGIN_PREF_CHOICE, | |
|
20940
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
46 | PURPLE_PLUGIN_PREF_INFO, /**< no-value label */ |
|
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20147
diff
changeset
|
47 | PURPLE_PLUGIN_PREF_STRING_FORMAT /**< The preference has a string value. */ |
| 15884 | 48 | } PurplePluginPrefType; |
| 8713 | 49 | |
| 50 | #include <glib.h> | |
| 51 | #include "prefs.h" | |
| 52 | ||
| 53 | #ifdef __cplusplus | |
| 54 | extern "C" { | |
| 55 | #endif | |
| 56 | ||
| 57 | /**************************************************************************/ | |
| 58 | /** @name Plugin Preference API */ | |
| 59 | /**************************************************************************/ | |
| 60 | /*@{*/ | |
| 61 | ||
| 62 | /** | |
| 63 | * Create a new plugin preference frame | |
| 64 | * | |
| 15884 | 65 | * @return a new PurplePluginPrefFrame |
| 8713 | 66 | */ |
| 15884 | 67 | PurplePluginPrefFrame *purple_plugin_pref_frame_new(void); |
| 8713 | 68 | |
| 69 | /** | |
| 70 | * Destroy a plugin preference frame | |
| 71 | * | |
| 72 | * @param frame The plugin frame to destroy | |
| 73 | */ | |
| 15884 | 74 | void purple_plugin_pref_frame_destroy(PurplePluginPrefFrame *frame); |
| 8713 | 75 | |
| 76 | /** | |
| 77 | * Adds a plugin preference to a plugin preference frame | |
| 78 | * | |
| 79 | * @param frame The plugin frame to add the preference to | |
| 80 | * @param pref The preference to add to the frame | |
| 81 | */ | |
| 15884 | 82 | void purple_plugin_pref_frame_add(PurplePluginPrefFrame *frame, PurplePluginPref *pref); |
| 8713 | 83 | |
| 84 | /** | |
| 85 | * Get the plugin preferences from a plugin preference frame | |
| 86 | * | |
| 87 | * @param frame The plugin frame to get the plugin preferences from | |
|
20971
b5e1eb080f33
Replace a bunch of @return markers with @constreturn markers. I believe these
Etan Reisner <deryni@pidgin.im>
parents:
20940
diff
changeset
|
88 | * @constreturn a GList of plugin preferences |
| 8713 | 89 | */ |
| 15884 | 90 | GList *purple_plugin_pref_frame_get_prefs(PurplePluginPrefFrame *frame); |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
9939
diff
changeset
|
91 | |
| 8713 | 92 | /** |
| 93 | * Create a new plugin preference | |
| 94 | * | |
| 15884 | 95 | * @return a new PurplePluginPref |
| 8713 | 96 | */ |
| 15884 | 97 | PurplePluginPref *purple_plugin_pref_new(void); |
| 8713 | 98 | |
| 99 | /** | |
| 100 | * Create a new plugin preference with name | |
| 101 | * | |
| 102 | * @param name The name of the pref | |
| 15884 | 103 | * @return a new PurplePluginPref |
| 8713 | 104 | */ |
| 15884 | 105 | PurplePluginPref *purple_plugin_pref_new_with_name(const char *name); |
| 8713 | 106 | |
| 107 | /** | |
| 108 | * Create a new plugin preference with label | |
| 109 | * | |
| 110 | * @param label The label to be displayed | |
| 15884 | 111 | * @return a new PurplePluginPref |
| 8713 | 112 | */ |
| 15884 | 113 | PurplePluginPref *purple_plugin_pref_new_with_label(const char *label); |
| 8713 | 114 | |
| 115 | /** | |
| 116 | * Create a new plugin preference with name and label | |
| 117 | * | |
| 118 | * @param name The name of the pref | |
| 119 | * @param label The label to be displayed | |
| 15884 | 120 | * @return a new PurplePluginPref |
| 8713 | 121 | */ |
| 15884 | 122 | PurplePluginPref *purple_plugin_pref_new_with_name_and_label(const char *name, const char *label); |
| 8713 | 123 | |
| 124 | /** | |
| 125 | * Destroy a plugin preference | |
| 126 | * | |
| 127 | * @param pref The preference to destroy | |
| 128 | */ | |
| 15884 | 129 | void purple_plugin_pref_destroy(PurplePluginPref *pref); |
| 8713 | 130 | |
| 131 | /** | |
| 132 | * Set a plugin pref name | |
| 133 | * | |
| 134 | * @param pref The plugin pref | |
| 135 | * @param name The name of the pref | |
| 136 | */ | |
| 15884 | 137 | void purple_plugin_pref_set_name(PurplePluginPref *pref, const char *name); |
| 8713 | 138 | |
| 139 | /** | |
| 140 | * Get a plugin pref name | |
| 141 | * | |
| 142 | * @param pref The plugin pref | |
| 143 | * @return The name of the pref | |
| 144 | */ | |
| 15884 | 145 | const char *purple_plugin_pref_get_name(PurplePluginPref *pref); |
| 8713 | 146 | |
| 147 | /** | |
| 148 | * Set a plugin pref label | |
| 149 | * | |
| 150 | * @param pref The plugin pref | |
| 151 | * @param label The label for the plugin pref | |
| 152 | */ | |
| 15884 | 153 | void purple_plugin_pref_set_label(PurplePluginPref *pref, const char *label); |
| 8713 | 154 | |
| 155 | /** | |
| 156 | * Get a plugin pref label | |
| 157 | * | |
| 158 | * @param pref The plugin pref | |
| 159 | * @return The label for the plugin pref | |
| 160 | */ | |
| 15884 | 161 | const char *purple_plugin_pref_get_label(PurplePluginPref *pref); |
| 8713 | 162 | |
| 163 | /** | |
| 164 | * Set the bounds for an integer pref | |
| 165 | * | |
| 166 | * @param pref The plugin pref | |
| 167 | * @param min The min value | |
| 168 | * @param max The max value | |
| 169 | */ | |
| 15884 | 170 | void purple_plugin_pref_set_bounds(PurplePluginPref *pref, int min, int max); |
| 8713 | 171 | |
| 172 | /** | |
| 173 | * Get the bounds for an integer pref | |
| 174 | * | |
| 175 | * @param pref The plugin pref | |
| 176 | * @param min The min value | |
| 177 | * @param max The max value | |
| 178 | */ | |
| 15884 | 179 | void purple_plugin_pref_get_bounds(PurplePluginPref *pref, int *min, int *max); |
| 8713 | 180 | |
| 181 | /** | |
| 182 | * Set the type of a plugin pref | |
| 183 | * | |
| 184 | * @param pref The plugin pref | |
| 185 | * @param type The type | |
| 186 | */ | |
| 15884 | 187 | void purple_plugin_pref_set_type(PurplePluginPref *pref, PurplePluginPrefType type); |
| 8713 | 188 | |
| 189 | /** | |
| 190 | * Get the type of a plugin pref | |
| 191 | * | |
| 192 | * @param pref The plugin pref | |
| 193 | * @return The type | |
| 194 | */ | |
| 15884 | 195 | PurplePluginPrefType purple_plugin_pref_get_type(PurplePluginPref *pref); |
| 8713 | 196 | |
| 197 | /** | |
| 198 | * Set the choices for a choices plugin pref | |
| 199 | * | |
| 200 | * @param pref The plugin pref | |
| 201 | * @param label The label for the choice | |
| 202 | * @param choice A gpointer of the choice | |
| 203 | */ | |
| 15884 | 204 | void purple_plugin_pref_add_choice(PurplePluginPref *pref, const char *label, gpointer choice); |
| 8713 | 205 | |
| 206 | /** | |
| 207 | * Get the choices for a choices plugin pref | |
| 208 | * | |
| 209 | * @param pref The plugin pref | |
|
20971
b5e1eb080f33
Replace a bunch of @return markers with @constreturn markers. I believe these
Etan Reisner <deryni@pidgin.im>
parents:
20940
diff
changeset
|
210 | * @constreturn GList of the choices |
| 8713 | 211 | */ |
| 15884 | 212 | GList *purple_plugin_pref_get_choices(PurplePluginPref *pref); |
| 8713 | 213 | |
| 214 | /** | |
| 215 | * Set the max length for a string plugin pref | |
| 216 | * | |
| 9000 | 217 | * @param pref The plugin pref |
| 218 | * @param max_length The max length of the string | |
| 8713 | 219 | */ |
| 15884 | 220 | void purple_plugin_pref_set_max_length(PurplePluginPref *pref, unsigned int max_length); |
| 8713 | 221 | |
| 222 | /** | |
| 223 | * Get the max length for a string plugin pref | |
| 224 | * | |
| 225 | * @param pref The plugin pref | |
| 226 | * @return the max length | |
| 227 | */ | |
| 15884 | 228 | unsigned int purple_plugin_pref_get_max_length(PurplePluginPref *pref); |
| 8713 | 229 | |
| 9841 | 230 | /** |
| 231 | * Sets the masking of a string plugin pref | |
| 232 | * | |
| 9939 | 233 | * @param pref The plugin pref |
| 234 | * @param mask The value to set | |
| 9841 | 235 | */ |
| 15884 | 236 | void purple_plugin_pref_set_masked(PurplePluginPref *pref, gboolean mask); |
| 9841 | 237 | |
| 238 | /** | |
| 239 | * Gets the masking of a string plugin pref | |
| 240 | * | |
| 241 | * @param pref The plugin pref | |
| 242 | * @return The masking | |
| 243 | */ | |
| 15884 | 244 | gboolean purple_plugin_pref_get_masked(PurplePluginPref *pref); |
| 9841 | 245 | |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
246 | /** |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
247 | * Sets the format type for a formattable-string plugin pref. You need to set the |
| 15884 | 248 | * pref type to PURPLE_PLUGIN_PREF_STRING_FORMAT first before setting the format. |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
249 | * |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
250 | * @param pref The plugin pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
251 | * @param format The format of the string |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
252 | */ |
| 15884 | 253 | void purple_plugin_pref_set_format_type(PurplePluginPref *pref, PurpleStringFormatType format); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
254 | |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
255 | /** |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
256 | * Gets the format type of the formattable-string plugin pref. |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
257 | * |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
258 | * @param pref The plugin pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
259 | * @return The format of the pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
260 | */ |
| 15884 | 261 | PurpleStringFormatType purple_plugin_pref_get_format_type(PurplePluginPref *pref); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
262 | |
| 8713 | 263 | /*@}*/ |
| 264 | ||
| 265 | #ifdef __cplusplus | |
| 266 | } | |
| 267 | #endif | |
| 268 | ||
| 15884 | 269 | #endif /* _PURPLE_PLUGINPREF_H_ */ |