comparison libpurple/request.h @ 19820:14ad6eabb918

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