Fri, 13 Oct 2006 00:28:18 +0000
[gaim-migrate @ 17474]
As far as I can tell GaimStringFormatType is only used by the pluginpref api
and was added as part of a change to the pluginpref stuff, so why it was put
in prefs.h I'm not sure, pluginpref.h seems like a better place to me.
| 8713 | 1 | /** |
| 2 | * @file pluginpref.h Plugin Preferences API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim 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 | |
| 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 | */ | |
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
26 | #ifndef _GAIM_PLUGINPREF_H_ |
|
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
27 | #define _GAIM_PLUGINPREF_H_ |
| 8713 | 28 | |
| 29 | typedef struct _GaimPluginPrefFrame GaimPluginPrefFrame; | |
| 30 | typedef struct _GaimPluginPref GaimPluginPref; | |
| 31 | ||
| 14782 | 32 | /** |
| 33 | * String format for preferences. | |
| 34 | */ | |
| 35 | typedef enum | |
| 36 | { | |
| 37 | GAIM_STRING_FORMAT_TYPE_NONE = 0, | |
| 38 | GAIM_STRING_FORMAT_TYPE_MULTILINE = 1 << 0, | |
| 39 | GAIM_STRING_FORMAT_TYPE_HTML = 1 << 1 | |
| 40 | } GaimStringFormatType; | |
| 41 | ||
| 8713 | 42 | typedef enum { |
| 43 | GAIM_PLUGIN_PREF_NONE, | |
|
9529
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
9000
diff
changeset
|
44 | GAIM_PLUGIN_PREF_CHOICE, |
|
377b70382202
[gaim-migrate @ 10356]
Christopher O'Brien <siege@pidgin.im>
parents:
9000
diff
changeset
|
45 | GAIM_PLUGIN_PREF_INFO, /**< no-value label */ |
|
12712
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
46 | GAIM_PLUGIN_PREF_STRING_FORMAT |
| 8713 | 47 | } GaimPluginPrefType; |
| 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 | * | |
| 64 | * @return a new GaimPluginPrefFrame | |
| 65 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
10414
diff
changeset
|
66 | GaimPluginPrefFrame *gaim_plugin_pref_frame_new(void); |
| 8713 | 67 | |
| 68 | /** | |
| 69 | * Destroy a plugin preference frame | |
| 70 | * | |
| 71 | * @param frame The plugin frame to destroy | |
| 72 | */ | |
| 73 | void gaim_plugin_pref_frame_destroy(GaimPluginPrefFrame *frame); | |
| 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 | */ | |
| 81 | void gaim_plugin_pref_frame_add(GaimPluginPrefFrame *frame, GaimPluginPref *pref); | |
| 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 | */ | |
| 89 | GList *gaim_plugin_pref_frame_get_prefs(GaimPluginPrefFrame *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 | * | |
| 94 | * @return a new GaimPluginPref | |
| 95 | */ | |
|
12323
f52908fb23b0
[gaim-migrate @ 14627]
Richard Laager <rlaager@pidgin.im>
parents:
10414
diff
changeset
|
96 | GaimPluginPref *gaim_plugin_pref_new(void); |
| 8713 | 97 | |
| 98 | /** | |
| 99 | * Create a new plugin preference with name | |
| 100 | * | |
| 101 | * @param name The name of the pref | |
| 102 | * @return a new GaimPluginPref | |
| 103 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
104 | GaimPluginPref *gaim_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 | |
| 110 | * @return a new GaimPluginPref | |
| 111 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
112 | GaimPluginPref *gaim_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 | |
| 119 | * @return a new GaimPluginPref | |
| 120 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
121 | GaimPluginPref *gaim_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 | */ | |
| 128 | void gaim_plugin_pref_destroy(GaimPluginPref *pref); | |
| 129 | ||
| 130 | /** | |
| 131 | * Set a plugin pref name | |
| 132 | * | |
| 133 | * @param pref The plugin pref | |
| 134 | * @param name The name of the pref | |
| 135 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
136 | void gaim_plugin_pref_set_name(GaimPluginPref *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 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
144 | const char *gaim_plugin_pref_get_name(GaimPluginPref *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 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
152 | void gaim_plugin_pref_set_label(GaimPluginPref *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 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
160 | const char *gaim_plugin_pref_get_label(GaimPluginPref *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 | */ | |
| 169 | void gaim_plugin_pref_set_bounds(GaimPluginPref *pref, int min, int max); | |
| 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 | */ | |
| 178 | void gaim_plugin_pref_get_bounds(GaimPluginPref *pref, int *min, int *max); | |
| 179 | ||
| 180 | /** | |
| 181 | * Set the type of a plugin pref | |
| 182 | * | |
| 183 | * @param pref The plugin pref | |
| 184 | * @param type The type | |
| 185 | */ | |
| 186 | void gaim_plugin_pref_set_type(GaimPluginPref *pref, GaimPluginPrefType type); | |
| 187 | ||
| 188 | /** | |
| 189 | * Get the type of a plugin pref | |
| 190 | * | |
| 191 | * @param pref The plugin pref | |
| 192 | * @return The type | |
| 193 | */ | |
| 194 | GaimPluginPrefType gaim_plugin_pref_get_type(GaimPluginPref *pref); | |
| 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 | */ | |
|
13107
704041197f4d
[gaim-migrate @ 15468]
Richard Laager <rlaager@pidgin.im>
parents:
12712
diff
changeset
|
203 | void gaim_plugin_pref_add_choice(GaimPluginPref *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 | */ | |
| 211 | GList *gaim_plugin_pref_get_choices(GaimPluginPref *pref); | |
| 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 | */ |
| 219 | void gaim_plugin_pref_set_max_length(GaimPluginPref *pref, unsigned int max_length); | |
| 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 | */ | |
| 227 | unsigned int gaim_plugin_pref_get_max_length(GaimPluginPref *pref); | |
| 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 | */ |
| 235 | void gaim_plugin_pref_set_masked(GaimPluginPref *pref, gboolean mask); | |
| 236 | ||
| 237 | /** | |
| 238 | * Gets the masking of a string plugin pref | |
| 239 | * | |
| 240 | * @param pref The plugin pref | |
| 241 | * @return The masking | |
| 242 | */ | |
| 243 | gboolean gaim_plugin_pref_get_masked(GaimPluginPref *pref); | |
| 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 |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
247 | * pref type to GAIM_PLUGIN_PREF_STRING_FORMAT first before setting the format. |
|
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 | */ |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
252 | void gaim_plugin_pref_set_format_type(GaimPluginPref *pref, GaimStringFormatType format); |
|
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 | */ |
|
21ea46d3dee9
[gaim-migrate @ 15056]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12323
diff
changeset
|
260 | GaimStringFormatType gaim_plugin_pref_get_format_type(GaimPluginPref *pref); |
|
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 | ||
|
9713
bb37562302a1
[gaim-migrate @ 10574]
Mark Doliner <markdoliner@pidgin.im>
parents:
9529
diff
changeset
|
268 | #endif /* _GAIM_PLUGINPREF_H_ */ |