comparison libpurple/request.h @ 19867:1fb7dbe2c6ee

API says *crack*
author Gabriel Schulhof <nix@go-nix.ca>
date Sun, 12 Aug 2007 16:05:16 +0000
parents 14ad6eabb918
children 6a0d9fa477d4
comparison
equal deleted inserted replaced
19866:14ad6eabb918 19867:1fb7dbe2c6ee
186 const char *secondary, const char *default_value, 186 const char *secondary, const char *default_value,
187 gboolean multiline, gboolean masked, gchar *hint, 187 gboolean multiline, gboolean masked, gchar *hint,
188 const char *ok_text, GCallback ok_cb, 188 const char *ok_text, GCallback ok_cb,
189 const char *cancel_text, GCallback cancel_cb, 189 const char *cancel_text, GCallback cancel_cb,
190 PurpleAccount *account, const char *who, PurpleConversation *conv, 190 PurpleAccount *account, const char *who, PurpleConversation *conv,
191 void *user_data); 191 const char *ui_hint, void *user_data);
192 void *(*request_choice)(const char *title, const char *primary, 192 void *(*request_choice)(const char *title, const char *primary,
193 const char *secondary, unsigned int default_value, 193 const char *secondary, unsigned int default_value,
194 const char *ok_text, GCallback ok_cb, 194 const char *ok_text, GCallback ok_cb,
195 const char *cancel_text, GCallback cancel_cb, 195 const char *cancel_text, GCallback cancel_cb,
196 PurpleAccount *account, const char *who, PurpleConversation *conv, 196 PurpleAccount *account, const char *who, PurpleConversation *conv,
197 void *user_data, va_list choices); 197 const char *ui_hint, void *user_data, va_list choices);
198 void *(*request_action)(const char *title, const char *primary, 198 void *(*request_action)(const char *title, const char *primary,
199 const char *secondary, unsigned int default_action, 199 const char *secondary, unsigned int default_action,
200 PurpleAccount *account, const char *who, PurpleConversation *conv, 200 PurpleAccount *account, const char *who, PurpleConversation *conv,
201 void *user_data, size_t action_count, 201 const char *ui_hint, void *user_data, size_t action_count,
202 va_list actions); 202 va_list actions);
203 void *(*request_fields)(const char *title, const char *primary, 203 void *(*request_fields)(const char *title, const char *primary,
204 const char *secondary, PurpleRequestFields *fields, 204 const char *secondary, PurpleRequestFields *fields,
205 const char *ok_text, GCallback ok_cb, 205 const char *ok_text, GCallback ok_cb,
206 const char *cancel_text, GCallback cancel_cb, 206 const char *cancel_text, GCallback cancel_cb,
207 PurpleAccount *account, const char *who, PurpleConversation *conv, 207 PurpleAccount *account, const char *who, PurpleConversation *conv,
208 void *user_data); 208 const char *ui_hint, void *user_data);
209 void *(*request_file)(const char *title, const char *filename, 209 void *(*request_file)(const char *title, const char *filename,
210 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, 210 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb,
211 PurpleAccount *account, const char *who, PurpleConversation *conv, 211 PurpleAccount *account, const char *who, PurpleConversation *conv,
212 void *user_data); 212 const char *ui_hint, void *user_data);
213 void (*close_request)(PurpleRequestType type, void *ui_handle); 213 void (*close_request)(PurpleRequestType type, void *ui_handle);
214 void *(*request_folder)(const char *title, const char *dirname, 214 void *(*request_folder)(const char *title, const char *dirname,
215 GCallback ok_cb, GCallback cancel_cb, 215 GCallback ok_cb, GCallback cancel_cb,
216 PurpleAccount *account, const char *who, PurpleConversation *conv, 216 PurpleAccount *account, const char *who, PurpleConversation *conv,
217 void *user_data); 217 const char *ui_hint, void *user_data);
218 218
219 void (*_purple_reserved1)(void); 219 void (*_purple_reserved1)(void);
220 void (*_purple_reserved2)(void); 220 void (*_purple_reserved2)(void);
221 void (*_purple_reserved3)(void); 221 void (*_purple_reserved3)(void);
222 void (*_purple_reserved4)(void); 222 void (*_purple_reserved4)(void);
1184 * @param cancel_text The text for the @c Cancel button. 1184 * @param cancel_text The text for the @c Cancel button.
1185 * @param cancel_cb The callback for the @c Cancel button. 1185 * @param cancel_cb The callback for the @c Cancel button.
1186 * @param account The PurpleAccount associated with this request, or NULL if none is 1186 * @param account The PurpleAccount associated with this request, or NULL if none is
1187 * @param who The username of the buddy assocaited with this request, or NULL if none is 1187 * @param who The username of the buddy assocaited with this request, or NULL if none is
1188 * @param conv The PurpleConversation associated with this request, or NULL if none is 1188 * @param conv The PurpleConversation associated with this request, or NULL if none is
1189 * @param ui_hint UI hint
1189 * @param user_data The data to pass to the callback. 1190 * @param user_data The data to pass to the callback.
1190 * 1191 *
1191 * @return A UI-specific handle. 1192 * @return A UI-specific handle.
1192 */ 1193 */
1193 void *purple_request_input(void *handle, const char *title, 1194 void *purple_request_input(void *handle, const char *title,
1195 const char *default_value, 1196 const char *default_value,
1196 gboolean multiline, gboolean masked, gchar *hint, 1197 gboolean multiline, gboolean masked, gchar *hint,
1197 const char *ok_text, GCallback ok_cb, 1198 const char *ok_text, GCallback ok_cb,
1198 const char *cancel_text, GCallback cancel_cb, 1199 const char *cancel_text, GCallback cancel_cb,
1199 PurpleAccount *account, const char *who, PurpleConversation *conv, 1200 PurpleAccount *account, const char *who, PurpleConversation *conv,
1200 void *user_data); 1201 const char *ui_hint, void *user_data);
1201 1202
1202 /** 1203 /**
1203 * Prompts the user for multiple-choice input. 1204 * Prompts the user for multiple-choice input.
1204 * 1205 *
1205 * @param handle The plugin or connection handle. For some 1206 * @param handle The plugin or connection handle. For some
1214 * @param cancel_text The text for the @c Cancel button. 1215 * @param cancel_text The text for the @c Cancel button.
1215 * @param cancel_cb The callback for the @c Cancel button. 1216 * @param cancel_cb The callback for the @c Cancel button.
1216 * @param account The PurpleAccount associated with this request, or NULL if none is 1217 * @param account The PurpleAccount associated with this request, or NULL if none is
1217 * @param who The username of the buddy assocaited with this request, or NULL if none is 1218 * @param who The username of the buddy assocaited with this request, or NULL if none is
1218 * @param conv The PurpleConversation associated with this request, or NULL if none is 1219 * @param conv The PurpleConversation associated with this request, or NULL if none is
1220 * @param ui_hint UI hint
1219 * @param user_data The data to pass to the callback. 1221 * @param user_data The data to pass to the callback.
1220 * @param ... The choices. This argument list should be 1222 * @param ... The choices. This argument list should be
1221 * terminated with a NULL parameter. 1223 * terminated with a NULL parameter.
1222 * 1224 *
1223 * @return A UI-specific handle. 1225 * @return A UI-specific handle.
1226 const char *primary, const char *secondary, 1228 const char *primary, const char *secondary,
1227 unsigned int default_value, 1229 unsigned int default_value,
1228 const char *ok_text, GCallback ok_cb, 1230 const char *ok_text, GCallback ok_cb,
1229 const char *cancel_text, GCallback cancel_cb, 1231 const char *cancel_text, GCallback cancel_cb,
1230 PurpleAccount *account, const char *who, PurpleConversation *conv, 1232 PurpleAccount *account, const char *who, PurpleConversation *conv,
1231 void *user_data, ...) G_GNUC_NULL_TERMINATED; 1233 const char *ui_hint, void *user_data, ...) G_GNUC_NULL_TERMINATED;
1232 1234
1233 /** 1235 /**
1234 * Prompts the user for multiple-choice input. 1236 * Prompts the user for multiple-choice input.
1235 * 1237 *
1236 * @param handle The plugin or connection handle. For some 1238 * @param handle The plugin or connection handle. For some
1245 * @param cancel_text The text for the @c Cancel button. 1247 * @param cancel_text The text for the @c Cancel button.
1246 * @param cancel_cb The callback for the @c Cancel button. 1248 * @param cancel_cb The callback for the @c Cancel button.
1247 * @param account The PurpleAccount associated with this request, or NULL if none is 1249 * @param account The PurpleAccount associated with this request, or NULL if none is
1248 * @param who The username of the buddy assocaited with this request, or NULL if none is 1250 * @param who The username of the buddy assocaited with this request, or NULL if none is
1249 * @param conv The PurpleConversation associated with this request, or NULL if none is 1251 * @param conv The PurpleConversation associated with this request, or NULL if none is
1252 * @param ui_hint UI hint
1250 * @param user_data The data to pass to the callback. 1253 * @param user_data The data to pass to the callback.
1251 * @param choices The choices. This argument list should be 1254 * @param choices The choices. This argument list should be
1252 * terminated with a @c NULL parameter. 1255 * terminated with a @c NULL parameter.
1253 * 1256 *
1254 * @return A UI-specific handle. 1257 * @return A UI-specific handle.
1257 const char *primary, const char *secondary, 1260 const char *primary, const char *secondary,
1258 unsigned int default_value, 1261 unsigned int default_value,
1259 const char *ok_text, GCallback ok_cb, 1262 const char *ok_text, GCallback ok_cb,
1260 const char *cancel_text, GCallback cancel_cb, 1263 const char *cancel_text, GCallback cancel_cb,
1261 PurpleAccount *account, const char *who, PurpleConversation *conv, 1264 PurpleAccount *account, const char *who, PurpleConversation *conv,
1262 void *user_data, va_list choices); 1265 const char *ui_hint, void *user_data, va_list choices);
1263 1266
1264 /** 1267 /**
1265 * Prompts the user for an action. 1268 * Prompts the user for an action.
1266 * 1269 *
1267 * This is often represented as a dialog with a button for each action. 1270 * This is often represented as a dialog with a button for each action.
1274 * @param secondary The secondary information. 1277 * @param secondary The secondary information.
1275 * @param default_action The default value. 1278 * @param default_action The default value.
1276 * @param account The PurpleAccount associated with this request, or NULL if none is 1279 * @param account The PurpleAccount associated with this request, or NULL if none is
1277 * @param who The username of the buddy assocaited with this request, or NULL if none is 1280 * @param who The username of the buddy assocaited with this request, or NULL if none is
1278 * @param conv The PurpleConversation associated with this request, or NULL if none is 1281 * @param conv The PurpleConversation associated with this request, or NULL if none is
1282 * @param ui_hint UI hint
1279 * @param user_data The data to pass to the callback. 1283 * @param user_data The data to pass to the callback.
1280 * @param action_count The number of actions. 1284 * @param action_count The number of actions.
1281 * @param ... A list of actions. These are pairs of 1285 * @param ... A list of actions. These are pairs of
1282 * arguments. The first of each pair is the 1286 * arguments. The first of each pair is the
1283 * string that appears on the button. It should 1287 * string that appears on the button. It should
1290 */ 1294 */
1291 void *purple_request_action(void *handle, const char *title, 1295 void *purple_request_action(void *handle, const char *title,
1292 const char *primary, const char *secondary, 1296 const char *primary, const char *secondary,
1293 unsigned int default_action, 1297 unsigned int default_action,
1294 PurpleAccount *account, const char *who, PurpleConversation *conv, 1298 PurpleAccount *account, const char *who, PurpleConversation *conv,
1295 void *user_data, size_t action_count, ...); 1299 const char *ui_hint, void *user_data, size_t action_count, ...);
1296 1300
1297 /** 1301 /**
1298 * Prompts the user for an action. 1302 * Prompts the user for an action.
1299 * 1303 *
1300 * This is often represented as a dialog with a button for each action. 1304 * This is often represented as a dialog with a button for each action.
1307 * @param secondary The secondary information. 1311 * @param secondary The secondary information.
1308 * @param default_action The default value. 1312 * @param default_action The default value.
1309 * @param account The PurpleAccount associated with this request, or NULL if none is 1313 * @param account The PurpleAccount associated with this request, or NULL if none is
1310 * @param who The username of the buddy assocaited with this request, or NULL if none is 1314 * @param who The username of the buddy assocaited with this request, or NULL if none is
1311 * @param conv The PurpleConversation associated with this request, or NULL if none is 1315 * @param conv The PurpleConversation associated with this request, or NULL if none is
1316 * @param ui_hint UI hint
1312 * @param user_data The data to pass to the callback. 1317 * @param user_data The data to pass to the callback.
1313 * @param action_count The number of actions. 1318 * @param action_count The number of actions.
1314 * @param actions A list of actions and callbacks. 1319 * @param actions A list of actions and callbacks.
1315 * 1320 *
1316 * @return A UI-specific handle. 1321 * @return A UI-specific handle.
1317 */ 1322 */
1318 void *purple_request_action_varg(void *handle, const char *title, 1323 void *purple_request_action_varg(void *handle, const char *title,
1319 const char *primary, const char *secondary, 1324 const char *primary, const char *secondary,
1320 unsigned int default_action, 1325 unsigned int default_action,
1321 PurpleAccount *account, const char *who, PurpleConversation *conv, 1326 PurpleAccount *account, const char *who, PurpleConversation *conv,
1322 void *user_data, size_t action_count, 1327 const char *ui_hint, void *user_data, size_t action_count,
1323 va_list actions); 1328 va_list actions);
1324 1329
1325 /** 1330 /**
1326 * Displays groups of fields for the user to fill in. 1331 * Displays groups of fields for the user to fill in.
1327 * 1332 *
1337 * @param cancel_text The text for the @c Cancel button. 1342 * @param cancel_text The text for the @c Cancel button.
1338 * @param cancel_cb The callback for the @c Cancel button. 1343 * @param cancel_cb The callback for the @c Cancel button.
1339 * @param account The PurpleAccount associated with this request, or NULL if none is 1344 * @param account The PurpleAccount associated with this request, or NULL if none is
1340 * @param who The username of the buddy associated with this request, or NULL if none is 1345 * @param who The username of the buddy associated with this request, or NULL if none is
1341 * @param conv The PurpleConversation associated with this request, or NULL if none is 1346 * @param conv The PurpleConversation associated with this request, or NULL if none is
1347 * @param ui_hint UI hint
1342 * @param user_data The data to pass to the callback. 1348 * @param user_data The data to pass to the callback.
1343 * 1349 *
1344 * @return A UI-specific handle. 1350 * @return A UI-specific handle.
1345 */ 1351 */
1346 void *purple_request_fields(void *handle, const char *title, 1352 void *purple_request_fields(void *handle, const char *title,
1347 const char *primary, const char *secondary, 1353 const char *primary, const char *secondary,
1348 PurpleRequestFields *fields, 1354 PurpleRequestFields *fields,
1349 const char *ok_text, GCallback ok_cb, 1355 const char *ok_text, GCallback ok_cb,
1350 const char *cancel_text, GCallback cancel_cb, 1356 const char *cancel_text, GCallback cancel_cb,
1351 PurpleAccount *account, const char *who, PurpleConversation *conv, 1357 PurpleAccount *account, const char *who, PurpleConversation *conv,
1352 void *user_data); 1358 const char *ui_hint, void *user_data);
1353 1359
1354 /** 1360 /**
1355 * Closes a request. 1361 * Closes a request.
1356 * 1362 *
1357 * @param type The request type. 1363 * @param type The request type.
1369 /** 1375 /**
1370 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. 1376 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons.
1371 */ 1377 */
1372 #define purple_request_yes_no(handle, title, primary, secondary, \ 1378 #define purple_request_yes_no(handle, title, primary, secondary, \
1373 default_action, account, who, conv, \ 1379 default_action, account, who, conv, \
1374 user_data, yes_cb, no_cb) \ 1380 ui_hint, user_data, yes_cb, no_cb) \
1375 purple_request_action((handle), (title), (primary), (secondary), \ 1381 purple_request_action((handle), (title), (primary), (secondary), \
1376 (default_action), account, who, conv, (user_data), 2, \ 1382 (default_action), account, who, conv, (ui_hint), (user_data), 2, \
1377 _("_Yes"), (yes_cb), _("_No"), (no_cb)) 1383 _("_Yes"), (yes_cb), _("_No"), (no_cb))
1378 1384
1379 /** 1385 /**
1380 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. 1386 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons.
1381 */ 1387 */
1382 #define purple_request_ok_cancel(handle, title, primary, secondary, \ 1388 #define purple_request_ok_cancel(handle, title, primary, secondary, \
1383 default_action, account, who, conv, \ 1389 default_action, account, who, conv, \
1384 user_data, ok_cb, cancel_cb) \ 1390 ui_hint, user_data, ok_cb, cancel_cb) \
1385 purple_request_action((handle), (title), (primary), (secondary), \ 1391 purple_request_action((handle), (title), (primary), (secondary), \
1386 (default_action), account, who, conv, (user_data), 2, \ 1392 (default_action), account, who, conv, (ui_hint), (user_data), 2, \
1387 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) 1393 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb))
1388 1394
1389 /** 1395 /**
1390 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. 1396 * A wrapper for purple_request_action() that uses Accept and Cancel buttons.
1391 */ 1397 */
1392 #define purple_request_accept_cancel(handle, title, primary, secondary, \ 1398 #define purple_request_accept_cancel(handle, title, primary, secondary, \
1393 default_action, account, who, conv, \ 1399 default_action, account, who, conv, \
1394 user_data, accept_cb, cancel_cb) \ 1400 ui_hint, user_data, accept_cb, cancel_cb) \
1395 purple_request_action((handle), (title), (primary), (secondary), \ 1401 purple_request_action((handle), (title), (primary), (secondary), \
1396 (default_action), account, who, conv, (user_data), 2, \ 1402 (default_action), account, who, conv, (ui_hint), (user_data), 2, \
1397 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) 1403 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb))
1398 1404
1399 /** 1405 /**
1400 * Displays a file selector request dialog. Returns the selected filename to 1406 * Displays a file selector request dialog. Returns the selected filename to
1401 * the callback. Can be used for either opening a file or saving a file. 1407 * the callback. Can be used for either opening a file or saving a file.
1410 * @param ok_cb The callback for the @c OK button. 1416 * @param ok_cb The callback for the @c OK button.
1411 * @param cancel_cb The callback for the @c Cancel button. 1417 * @param cancel_cb The callback for the @c Cancel button.
1412 * @param account The PurpleAccount associated with this request, or NULL if none is 1418 * @param account The PurpleAccount associated with this request, or NULL if none is
1413 * @param who The username of the buddy assocaited with this request, or NULL if none is 1419 * @param who The username of the buddy assocaited with this request, or NULL if none is
1414 * @param conv The PurpleConversation associated with this request, or NULL if none is 1420 * @param conv The PurpleConversation associated with this request, or NULL if none is
1421 * @param ui_hint UI hint
1415 * @param user_data The data to pass to the callback. 1422 * @param user_data The data to pass to the callback.
1416 * 1423 *
1417 * @return A UI-specific handle. 1424 * @return A UI-specific handle.
1418 */ 1425 */
1419 void *purple_request_file(void *handle, const char *title, const char *filename, 1426 void *purple_request_file(void *handle, const char *title, const char *filename,
1420 gboolean savedialog, 1427 gboolean savedialog,
1421 GCallback ok_cb, GCallback cancel_cb, 1428 GCallback ok_cb, GCallback cancel_cb,
1422 PurpleAccount *account, const char *who, PurpleConversation *conv, 1429 PurpleAccount *account, const char *who, PurpleConversation *conv,
1423 void *user_data); 1430 const char *ui_hint, void *user_data);
1424 1431
1425 /** 1432 /**
1426 * Displays a folder select dialog. Returns the selected filename to 1433 * Displays a folder select dialog. Returns the selected filename to
1427 * the callback. 1434 * the callback.
1428 * 1435 *
1434 * @param ok_cb The callback for the @c OK button. 1441 * @param ok_cb The callback for the @c OK button.
1435 * @param cancel_cb The callback for the @c Cancel button. 1442 * @param cancel_cb The callback for the @c Cancel button.
1436 * @param account The PurpleAccount associated with this request, or NULL if none is 1443 * @param account The PurpleAccount associated with this request, or NULL if none is
1437 * @param who The username of the buddy assocaited with this request, or NULL if none is 1444 * @param who The username of the buddy assocaited with this request, or NULL if none is
1438 * @param conv The PurpleConversation associated with this request, or NULL if none is 1445 * @param conv The PurpleConversation associated with this request, or NULL if none is
1446 * @param ui_hint UI hint
1439 * @param user_data The data to pass to the callback. 1447 * @param user_data The data to pass to the callback.
1440 * 1448 *
1441 * @return A UI-specific handle. 1449 * @return A UI-specific handle.
1442 */ 1450 */
1443 void *purple_request_folder(void *handle, const char *title, const char *dirname, 1451 void *purple_request_folder(void *handle, const char *title, const char *dirname,
1444 GCallback ok_cb, GCallback cancel_cb, 1452 GCallback ok_cb, GCallback cancel_cb,
1445 PurpleAccount *account, const char *who, PurpleConversation *conv, 1453 PurpleAccount *account, const char *who, PurpleConversation *conv,
1446 void *user_data); 1454 const char *ui_hint, void *user_data);
1447 1455
1448 /*@}*/ 1456 /*@}*/
1449 1457
1450 /**************************************************************************/ 1458 /**************************************************************************/
1451 /** @name UI Registration Functions */ 1459 /** @name UI Registration Functions */