Mon, 19 Mar 2007 07:01:17 +0000
sed -ie 's/gaim/purple/g'
| 8713 | 1 | /** |
| 2 | * @file pluginpref.h Plugin Preferences API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 15884 | 5 | * purple |
| 8713 | 6 | * |
| 15884 | 7 | * Purple is the legal property of its developers, whose names are too numerous |
| 8713 | 8 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 9 | * source distribution. | |
| 10 | * | |
| 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 | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 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 | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | * | |
| 25 | */ | |
| 15884 | 26 | #ifndef _PURPLE_PLUGINPREF_H_ |
| 27 | #define _PURPLE_PLUGINPREF_H_ | |
| 8713 | 28 | |
| 15884 | 29 | typedef struct _PurplePluginPrefFrame PurplePluginPrefFrame; |
| 30 | typedef struct _PurplePluginPref PurplePluginPref; | |
| 8713 | 31 | |
| 14782 | 32 | /** |
| 33 | * String format for preferences. | |
| 34 | */ | |
| 35 | typedef enum | |
| 36 | { | |
| 15884 | 37 | PURPLE_STRING_FORMAT_TYPE_NONE = 0, |
| 38 | PURPLE_STRING_FORMAT_TYPE_MULTILINE = 1 << 0, | |
| 39 | PURPLE_STRING_FORMAT_TYPE_HTML = 1 << 1 | |
| 40 | } PurpleStringFormatType; | |
| 14782 | 41 | |
| 8713 | 42 | typedef enum { |
| 15884 | 43 | PURPLE_PLUGIN_PREF_NONE, |
| 44 | PURPLE_PLUGIN_PREF_CHOICE, | |
| 45 | PURPLE_PLUGIN_PREF_INFO, /**< no-value label */ | |
| 46 | PURPLE_PLUGIN_PREF_STRING_FORMAT | |
| 47 | } PurplePluginPrefType; | |
| 8713 | 48 | |
| 49 | #include <glib.h> | |
| 50 | #include "prefs.h" | |
| 51 | ||
| 52 | #ifdef __cplusplus | |
| 53 | extern "C" { | |
| 54 | #endif | |
| 55 | ||
| 56 | /**************************************************************************/ | |
| 57 | /** @name Plugin Preference API */ | |
| 58 | /**************************************************************************/ | |
| 59 | /*@{*/ | |
| 60 | ||
| 61 | /** | |
| 62 | * Create a new plugin preference frame | |
| 63 | * | |
| 15884 | 64 | * @return a new PurplePluginPrefFrame |
| 8713 | 65 | */ |
| 15884 | 66 | PurplePluginPrefFrame *purple_plugin_pref_frame_new(void); |
| 8713 | 67 | |
| 68 | /** | |
| 69 | * Destroy a plugin preference frame | |
| 70 | * | |
| 71 | * @param frame The plugin frame to destroy | |
| 72 | */ | |
| 15884 | 73 | void purple_plugin_pref_frame_destroy(PurplePluginPrefFrame *frame); |
| 8713 | 74 | |
| 75 | /** | |
| 76 | * Adds a plugin preference to a plugin preference frame | |
| 77 | * | |
| 78 | * @param frame The plugin frame to add the preference to | |
| 79 | * @param pref The preference to add to the frame | |
| 80 | */ | |
| 15884 | 81 | void purple_plugin_pref_frame_add(PurplePluginPrefFrame *frame, PurplePluginPref *pref); |
| 8713 | 82 | |
| 83 | /** | |
| 84 | * Get the plugin preferences from a plugin preference frame | |
| 85 | * | |
| 86 | * @param frame The plugin frame to get the plugin preferences from | |
| 87 | * @return a GList of plugin preferences | |
| 88 | */ | |
| 15884 | 89 | GList *purple_plugin_pref_frame_get_prefs(PurplePluginPrefFrame *frame); |
|
10414
6b10b76933e1
[gaim-migrate @ 11664]
Mark Doliner <markdoliner@pidgin.im>
parents:
9939
diff
changeset
|
90 | |
| 8713 | 91 | /** |
| 92 | * Create a new plugin preference | |
| 93 | * | |
| 15884 | 94 | * @return a new PurplePluginPref |
| 8713 | 95 | */ |
| 15884 | 96 | PurplePluginPref *purple_plugin_pref_new(void); |
| 8713 | 97 | |
| 98 | /** | |
| 99 | * Create a new plugin preference with name | |
| 100 | * | |
| 101 | * @param name The name of the pref | |
| 15884 | 102 | * @return a new PurplePluginPref |
| 8713 | 103 | */ |
| 15884 | 104 | PurplePluginPref *purple_plugin_pref_new_with_name(const char *name); |
| 8713 | 105 | |
| 106 | /** | |
| 107 | * Create a new plugin preference with label | |
| 108 | * | |
| 109 | * @param label The label to be displayed | |
| 15884 | 110 | * @return a new PurplePluginPref |
| 8713 | 111 | */ |
| 15884 | 112 | PurplePluginPref *purple_plugin_pref_new_with_label(const char *label); |
| 8713 | 113 | |
| 114 | /** | |
| 115 | * Create a new plugin preference with name and label | |
| 116 | * | |
| 117 | * @param name The name of the pref | |
| 118 | * @param label The label to be displayed | |
| 15884 | 119 | * @return a new PurplePluginPref |
| 8713 | 120 | */ |
| 15884 | 121 | PurplePluginPref *purple_plugin_pref_new_with_name_and_label(const char *name, const char *label); |
| 8713 | 122 | |
| 123 | /** | |
| 124 | * Destroy a plugin preference | |
| 125 | * | |
| 126 | * @param pref The preference to destroy | |
| 127 | */ | |
| 15884 | 128 | void purple_plugin_pref_destroy(PurplePluginPref *pref); |
| 8713 | 129 | |
| 130 | /** | |
| 131 | * Set a plugin pref name | |
| 132 | * | |
| 133 | * @param pref The plugin pref | |
| 134 | * @param name The name of the pref | |
| 135 | */ | |
| 15884 | 136 | void purple_plugin_pref_set_name(PurplePluginPref *pref, const char *name); |
| 8713 | 137 | |
| 138 | /** | |
| 139 | * Get a plugin pref name | |
| 140 | * | |
| 141 | * @param pref The plugin pref | |
| 142 | * @return The name of the pref | |
| 143 | */ | |
| 15884 | 144 | const char *purple_plugin_pref_get_name(PurplePluginPref *pref); |
| 8713 | 145 | |
| 146 | /** | |
| 147 | * Set a plugin pref label | |
| 148 | * | |
| 149 | * @param pref The plugin pref | |
| 150 | * @param label The label for the plugin pref | |
| 151 | */ | |
| 15884 | 152 | void purple_plugin_pref_set_label(PurplePluginPref *pref, const char *label); |
| 8713 | 153 | |
| 154 | /** | |
| 155 | * Get a plugin pref label | |
| 156 | * | |
| 157 | * @param pref The plugin pref | |
| 158 | * @return The label for the plugin pref | |
| 159 | */ | |
| 15884 | 160 | const char *purple_plugin_pref_get_label(PurplePluginPref *pref); |
| 8713 | 161 | |
| 162 | /** | |
| 163 | * Set the bounds for an integer pref | |
| 164 | * | |
| 165 | * @param pref The plugin pref | |
| 166 | * @param min The min value | |
| 167 | * @param max The max value | |
| 168 | */ | |
| 15884 | 169 | void purple_plugin_pref_set_bounds(PurplePluginPref *pref, int min, int max); |
| 8713 | 170 | |
| 171 | /** | |
| 172 | * Get the bounds for an integer pref | |
| 173 | * | |
| 174 | * @param pref The plugin pref | |
| 175 | * @param min The min value | |
| 176 | * @param max The max value | |
| 177 | */ | |
| 15884 | 178 | void purple_plugin_pref_get_bounds(PurplePluginPref *pref, int *min, int *max); |
| 8713 | 179 | |
| 180 | /** | |
| 181 | * Set the type of a plugin pref | |
| 182 | * | |
| 183 | * @param pref The plugin pref | |
| 184 | * @param type The type | |
| 185 | */ | |
| 15884 | 186 | void purple_plugin_pref_set_type(PurplePluginPref *pref, PurplePluginPrefType type); |
| 8713 | 187 | |
| 188 | /** | |
| 189 | * Get the type of a plugin pref | |
| 190 | * | |
| 191 | * @param pref The plugin pref | |
| 192 | * @return The type | |
| 193 | */ | |
| 15884 | 194 | PurplePluginPrefType purple_plugin_pref_get_type(PurplePluginPref *pref); |
| 8713 | 195 | |
| 196 | /** | |
| 197 | * Set the choices for a choices plugin pref | |
| 198 | * | |
| 199 | * @param pref The plugin pref | |
| 200 | * @param label The label for the choice | |
| 201 | * @param choice A gpointer of the choice | |
| 202 | */ | |
| 15884 | 203 | void purple_plugin_pref_add_choice(PurplePluginPref *pref, const char *label, gpointer choice); |
| 8713 | 204 | |
| 205 | /** | |
| 206 | * Get the choices for a choices plugin pref | |
| 207 | * | |
| 208 | * @param pref The plugin pref | |
| 209 | * @return GList of the choices | |
| 210 | */ | |
| 15884 | 211 | GList *purple_plugin_pref_get_choices(PurplePluginPref *pref); |
| 8713 | 212 | |
| 213 | /** | |
| 214 | * Set the max length for a string plugin pref | |
| 215 | * | |
| 9000 | 216 | * @param pref The plugin pref |
| 217 | * @param max_length The max length of the string | |
| 8713 | 218 | */ |
| 15884 | 219 | void purple_plugin_pref_set_max_length(PurplePluginPref *pref, unsigned int max_length); |
| 8713 | 220 | |
| 221 | /** | |
| 222 | * Get the max length for a string plugin pref | |
| 223 | * | |
| 224 | * @param pref The plugin pref | |
| 225 | * @return the max length | |
| 226 | */ | |
| 15884 | 227 | unsigned int purple_plugin_pref_get_max_length(PurplePluginPref *pref); |
| 8713 | 228 | |
| 9841 | 229 | /** |
| 230 | * Sets the masking of a string plugin pref | |
| 231 | * | |
| 9939 | 232 | * @param pref The plugin pref |
| 233 | * @param mask The value to set | |
| 9841 | 234 | */ |
| 15884 | 235 | void purple_plugin_pref_set_masked(PurplePluginPref *pref, gboolean mask); |
| 9841 | 236 | |
| 237 | /** | |
| 238 | * Gets the masking of a string plugin pref | |
| 239 | * | |
| 240 | * @param pref The plugin pref | |
| 241 | * @return The masking | |
| 242 | */ | |
| 15884 | 243 | gboolean purple_plugin_pref_get_masked(PurplePluginPref *pref); |
| 9841 | 244 | |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
245 | /** |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
246 | * Sets the format type for a formattable-string plugin pref. You need to set the |
| 15884 | 247 | * 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
|
248 | * |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
249 | * @param pref The plugin pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
250 | * @param format The format of the string |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
251 | */ |
| 15884 | 252 | 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
|
253 | |
|
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 | * Gets the format type of the formattable-string plugin pref. |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
256 | * |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
257 | * @param pref The plugin pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
258 | * @return The format of the pref |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
259 | */ |
| 15884 | 260 | PurpleStringFormatType purple_plugin_pref_get_format_type(PurplePluginPref *pref); |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
261 | |
| 8713 | 262 | /*@}*/ |
| 263 | ||
| 264 | #ifdef __cplusplus | |
| 265 | } | |
| 266 | #endif | |
| 267 | ||
| 15884 | 268 | #endif /* _PURPLE_PLUGINPREF_H_ */ |