Mercurial > pidgin
comparison libpurple/request.h @ 20598:285bb637a2b7
Updated hinting to be less invasive
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 22 Sep 2007 16:19:34 +0000 |
parents | 591267f6f1d5 |
children | 56a470fc7be8 |
comparison
equal
deleted
inserted
replaced
20597:591267f6f1d5 | 20598:285bb637a2b7 |
---|---|
1190 * @param ui_hint UI hint | 1190 * @param ui_hint UI hint |
1191 * @param user_data The data to pass to the callback. | 1191 * @param user_data The data to pass to the callback. |
1192 * | 1192 * |
1193 * @return A UI-specific handle. | 1193 * @return A UI-specific handle. |
1194 */ | 1194 */ |
1195 void *purple_request_input_with_hint(void *handle, const char *title, | |
1196 const char *primary, const char *secondary, | |
1197 const char *default_value, | |
1198 gboolean multiline, gboolean masked, gchar *hint, | |
1199 const char *ok_text, GCallback ok_cb, | |
1200 const char *cancel_text, GCallback cancel_cb, | |
1201 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1202 const char *ui_hint, void *user_data); | |
1203 | |
1204 /** | |
1205 * @deprecated Please use purple_request_input_with_hint() instead. | |
1206 */ | |
1195 void *purple_request_input(void *handle, const char *title, | 1207 void *purple_request_input(void *handle, const char *title, |
1196 const char *primary, const char *secondary, | 1208 const char *primary, const char *secondary, |
1197 const char *default_value, | 1209 const char *default_value, |
1198 gboolean multiline, gboolean masked, gchar *hint, | 1210 gboolean multiline, gboolean masked, gchar *hint, |
1199 const char *ok_text, GCallback ok_cb, | 1211 const char *ok_text, GCallback ok_cb, |
1200 const char *cancel_text, GCallback cancel_cb, | 1212 const char *cancel_text, GCallback cancel_cb, |
1201 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1213 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1202 const char *ui_hint, void *user_data); | 1214 void *user_data); |
1203 | 1215 |
1204 /** | 1216 /** |
1205 * Prompts the user for multiple-choice input. | 1217 * Prompts the user for multiple-choice input. |
1206 * | 1218 * |
1207 * @param handle The plugin or connection handle. For some | 1219 * @param handle The plugin or connection handle. For some |
1223 * @param ... The choices. This argument list should be | 1235 * @param ... The choices. This argument list should be |
1224 * terminated with a NULL parameter. | 1236 * terminated with a NULL parameter. |
1225 * | 1237 * |
1226 * @return A UI-specific handle. | 1238 * @return A UI-specific handle. |
1227 */ | 1239 */ |
1240 void *purple_request_choice_with_hint(void *handle, const char *title, | |
1241 const char *primary, const char *secondary, | |
1242 int default_value, | |
1243 const char *ok_text, GCallback ok_cb, | |
1244 const char *cancel_text, GCallback cancel_cb, | |
1245 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1246 const char *ui_hint, void *user_data, ...) G_GNUC_NULL_TERMINATED; | |
1247 | |
1248 /** | |
1249 * @deprecated Please use purple_request_choice_with_hint() instead. | |
1250 */ | |
1228 void *purple_request_choice(void *handle, const char *title, | 1251 void *purple_request_choice(void *handle, const char *title, |
1229 const char *primary, const char *secondary, | 1252 const char *primary, const char *secondary, |
1230 int default_value, | 1253 int default_value, |
1231 const char *ok_text, GCallback ok_cb, | 1254 const char *ok_text, GCallback ok_cb, |
1232 const char *cancel_text, GCallback cancel_cb, | 1255 const char *cancel_text, GCallback cancel_cb, |
1233 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1256 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1234 const char *ui_hint, void *user_data, ...) G_GNUC_NULL_TERMINATED; | 1257 void *user_data, ...) G_GNUC_NULL_TERMINATED; |
1235 | 1258 |
1236 /** | 1259 /** |
1237 * Prompts the user for multiple-choice input. | 1260 * Prompts the user for multiple-choice input. |
1238 * | 1261 * |
1239 * @param handle The plugin or connection handle. For some | 1262 * @param handle The plugin or connection handle. For some |
1255 * @param choices The choices. This argument list should be | 1278 * @param choices The choices. This argument list should be |
1256 * terminated with a @c NULL parameter. | 1279 * terminated with a @c NULL parameter. |
1257 * | 1280 * |
1258 * @return A UI-specific handle. | 1281 * @return A UI-specific handle. |
1259 */ | 1282 */ |
1283 void *purple_request_choice_varg_with_hint(void *handle, const char *title, | |
1284 const char *primary, const char *secondary, | |
1285 int default_value, | |
1286 const char *ok_text, GCallback ok_cb, | |
1287 const char *cancel_text, GCallback cancel_cb, | |
1288 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1289 const char *ui_hint, void *user_data, va_list choices); | |
1290 | |
1291 /** | |
1292 * @deprecated Please use purple_request_choice_varg_with_hint() instead. | |
1293 */ | |
1260 void *purple_request_choice_varg(void *handle, const char *title, | 1294 void *purple_request_choice_varg(void *handle, const char *title, |
1261 const char *primary, const char *secondary, | 1295 const char *primary, const char *secondary, |
1262 int default_value, | 1296 int default_value, |
1263 const char *ok_text, GCallback ok_cb, | 1297 const char *ok_text, GCallback ok_cb, |
1264 const char *cancel_text, GCallback cancel_cb, | 1298 const char *cancel_text, GCallback cancel_cb, |
1265 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1299 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1266 const char *ui_hint, void *user_data, va_list choices); | 1300 void *user_data, va_list choices); |
1267 | 1301 |
1268 /** | 1302 /** |
1269 * Prompts the user for an action. | 1303 * Prompts the user for an action. |
1270 * | 1304 * |
1271 * This is often represented as a dialog with a button for each action. | 1305 * This is often represented as a dialog with a button for each action. |
1291 * The second of each pair is the callback | 1325 * The second of each pair is the callback |
1292 * function to use when the button is clicked. | 1326 * function to use when the button is clicked. |
1293 * | 1327 * |
1294 * @return A UI-specific handle. | 1328 * @return A UI-specific handle. |
1295 */ | 1329 */ |
1330 void *purple_request_action_with_hint(void *handle, const char *title, | |
1331 const char *primary, const char *secondary, | |
1332 int default_action, | |
1333 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1334 const char *ui_hint, void *user_data, size_t action_count, ...); | |
1335 | |
1336 /** | |
1337 * @deprecated Please use purple_request_action_with_hint() instead. | |
1338 */ | |
1296 void *purple_request_action(void *handle, const char *title, | 1339 void *purple_request_action(void *handle, const char *title, |
1297 const char *primary, const char *secondary, | 1340 const char *primary, const char *secondary, |
1298 int default_action, | 1341 int default_action, |
1299 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1342 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1300 const char *ui_hint, void *user_data, size_t action_count, ...); | 1343 void *user_data, size_t action_count, ...); |
1301 | 1344 |
1302 /** | 1345 /** |
1303 * Prompts the user for an action. | 1346 * Prompts the user for an action. |
1304 * | 1347 * |
1305 * This is often represented as a dialog with a button for each action. | 1348 * This is often represented as a dialog with a button for each action. |
1319 * @param action_count The number of actions. | 1362 * @param action_count The number of actions. |
1320 * @param actions A list of actions and callbacks. | 1363 * @param actions A list of actions and callbacks. |
1321 * | 1364 * |
1322 * @return A UI-specific handle. | 1365 * @return A UI-specific handle. |
1323 */ | 1366 */ |
1367 void *purple_request_action_varg_with_hint(void *handle, const char *title, | |
1368 const char *primary, const char *secondary, | |
1369 int default_action, | |
1370 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1371 const char *ui_hint, void *user_data, size_t action_count, | |
1372 va_list actions); | |
1373 | |
1374 /** | |
1375 * @deprecated Please use purple_request_action_varg_with_hint() instead. | |
1376 */ | |
1324 void *purple_request_action_varg(void *handle, const char *title, | 1377 void *purple_request_action_varg(void *handle, const char *title, |
1325 const char *primary, const char *secondary, | 1378 const char *primary, const char *secondary, |
1326 int default_action, | 1379 int default_action, |
1327 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1380 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1328 const char *ui_hint, void *user_data, size_t action_count, | 1381 void *user_data, size_t action_count, |
1329 va_list actions); | 1382 va_list actions); |
1330 | 1383 |
1331 /** | 1384 /** |
1332 * Displays groups of fields for the user to fill in. | 1385 * Displays groups of fields for the user to fill in. |
1333 * | 1386 * |
1348 * @param ui_hint UI hint | 1401 * @param ui_hint UI hint |
1349 * @param user_data The data to pass to the callback. | 1402 * @param user_data The data to pass to the callback. |
1350 * | 1403 * |
1351 * @return A UI-specific handle. | 1404 * @return A UI-specific handle. |
1352 */ | 1405 */ |
1406 void *purple_request_fields_with_hint(void *handle, const char *title, | |
1407 const char *primary, const char *secondary, | |
1408 PurpleRequestFields *fields, | |
1409 const char *ok_text, GCallback ok_cb, | |
1410 const char *cancel_text, GCallback cancel_cb, | |
1411 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1412 const char *ui_hint, void *user_data); | |
1413 | |
1414 /** | |
1415 * @deprecated Please use purple_request_fields_with_hint() instead. | |
1416 */ | |
1353 void *purple_request_fields(void *handle, const char *title, | 1417 void *purple_request_fields(void *handle, const char *title, |
1354 const char *primary, const char *secondary, | 1418 const char *primary, const char *secondary, |
1355 PurpleRequestFields *fields, | 1419 PurpleRequestFields *fields, |
1356 const char *ok_text, GCallback ok_cb, | 1420 const char *ok_text, GCallback ok_cb, |
1357 const char *cancel_text, GCallback cancel_cb, | 1421 const char *cancel_text, GCallback cancel_cb, |
1358 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1422 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1359 const char *ui_hint, void *user_data); | 1423 void *user_data); |
1360 | 1424 |
1361 /** | 1425 /** |
1362 * Closes a request. | 1426 * Closes a request. |
1363 * | 1427 * |
1364 * @param type The request type. | 1428 * @param type The request type. |
1374 void purple_request_close_with_handle(void *handle); | 1438 void purple_request_close_with_handle(void *handle); |
1375 | 1439 |
1376 /** | 1440 /** |
1377 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. | 1441 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. |
1378 */ | 1442 */ |
1443 #define purple_request_yes_no_with_hint(handle, title, primary, secondary, \ | |
1444 default_action, account, who, conv, \ | |
1445 ui_hint, user_data, yes_cb, no_cb) \ | |
1446 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1447 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | |
1448 _("_Yes"), (yes_cb), _("_No"), (no_cb)) | |
1449 | |
1450 /** | |
1451 * @deprecated Please use purple_request_yes_no_with_hint instead. | |
1452 */ | |
1379 #define purple_request_yes_no(handle, title, primary, secondary, \ | 1453 #define purple_request_yes_no(handle, title, primary, secondary, \ |
1380 default_action, account, who, conv, \ | 1454 default_action, account, who, conv, \ |
1381 ui_hint, user_data, yes_cb, no_cb) \ | 1455 user_data, yes_cb, no_cb) \ |
1382 purple_request_action((handle), (title), (primary), (secondary), \ | 1456 purple_request_action((handle), (title), (primary), (secondary), \ |
1457 (default_action), account, who, conv, (user_data), 2, \ | |
1458 _("_Yes"), (yes_cb), _("_No"), (no_cb)) | |
1459 | |
1460 /** | |
1461 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. | |
1462 */ | |
1463 #define purple_request_ok_cancel_with_hint(handle, title, primary, secondary, \ | |
1464 default_action, account, who, conv, \ | |
1465 ui_hint, user_data, ok_cb, cancel_cb) \ | |
1466 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1383 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | 1467 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ |
1384 _("_Yes"), (yes_cb), _("_No"), (no_cb)) | 1468 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) |
1385 | 1469 |
1386 /** | 1470 /** |
1387 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. | 1471 * @deprecated Please use purple_request_ok_cancel_with_hint instead. |
1388 */ | 1472 */ |
1389 #define purple_request_ok_cancel(handle, title, primary, secondary, \ | 1473 #define purple_request_ok_cancel(handle, title, primary, secondary, \ |
1390 default_action, account, who, conv, \ | 1474 default_action, account, who, conv, \ |
1391 ui_hint, user_data, ok_cb, cancel_cb) \ | 1475 user_data, ok_cb, cancel_cb) \ |
1392 purple_request_action((handle), (title), (primary), (secondary), \ | 1476 purple_request_action((handle), (title), (primary), (secondary), \ |
1477 (default_action), account, who, conv, (user_data), 2, \ | |
1478 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) | |
1479 | |
1480 /** | |
1481 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. | |
1482 */ | |
1483 #define purple_request_accept_cancel_with_hint(handle, title, primary, secondary, \ | |
1484 default_action, account, who, conv, \ | |
1485 ui_hint, user_data, accept_cb, cancel_cb) \ | |
1486 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1393 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | 1487 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ |
1394 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) | 1488 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) |
1395 | 1489 |
1396 /** | 1490 /** |
1397 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. | 1491 * @deprecated Please use purple_request_accept_cancel_with_hint instead. |
1398 */ | 1492 */ |
1399 #define purple_request_accept_cancel(handle, title, primary, secondary, \ | 1493 #define purple_request_accept_cancel(handle, title, primary, secondary, \ |
1400 default_action, account, who, conv, \ | 1494 default_action, account, who, conv, \ |
1401 ui_hint, user_data, accept_cb, cancel_cb) \ | 1495 user_data, accept_cb, cancel_cb) \ |
1402 purple_request_action((handle), (title), (primary), (secondary), \ | 1496 purple_request_action((handle), (title), (primary), (secondary), \ |
1403 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | 1497 (default_action), account, who, conv, (user_data), 2, \ |
1404 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) | 1498 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) |
1405 | 1499 |
1406 /** | 1500 /** |
1407 * Displays a file selector request dialog. Returns the selected filename to | 1501 * Displays a file selector request dialog. Returns the selected filename to |
1408 * the callback. Can be used for either opening a file or saving a file. | 1502 * the callback. Can be used for either opening a file or saving a file. |
1422 * @param ui_hint UI hint | 1516 * @param ui_hint UI hint |
1423 * @param user_data The data to pass to the callback. | 1517 * @param user_data The data to pass to the callback. |
1424 * | 1518 * |
1425 * @return A UI-specific handle. | 1519 * @return A UI-specific handle. |
1426 */ | 1520 */ |
1521 void *purple_request_file_with_hint(void *handle, const char *title, const char *filename, | |
1522 gboolean savedialog, | |
1523 GCallback ok_cb, GCallback cancel_cb, | |
1524 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1525 const char *ui_hint, void *user_data); | |
1526 | |
1527 /** | |
1528 * @deprecated Please use purple_request_file_with_hint() instead. | |
1529 */ | |
1427 void *purple_request_file(void *handle, const char *title, const char *filename, | 1530 void *purple_request_file(void *handle, const char *title, const char *filename, |
1428 gboolean savedialog, | 1531 gboolean savedialog, |
1429 GCallback ok_cb, GCallback cancel_cb, | 1532 GCallback ok_cb, GCallback cancel_cb, |
1430 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1533 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1431 const char *ui_hint, void *user_data); | 1534 void *user_data); |
1432 | 1535 |
1433 /** | 1536 /** |
1434 * Displays a folder select dialog. Returns the selected filename to | 1537 * Displays a folder select dialog. Returns the selected filename to |
1435 * the callback. | 1538 * the callback. |
1436 * | 1539 * |
1447 * @param ui_hint UI hint | 1550 * @param ui_hint UI hint |
1448 * @param user_data The data to pass to the callback. | 1551 * @param user_data The data to pass to the callback. |
1449 * | 1552 * |
1450 * @return A UI-specific handle. | 1553 * @return A UI-specific handle. |
1451 */ | 1554 */ |
1555 void *purple_request_folder_with_hint(void *handle, const char *title, const char *dirname, | |
1556 GCallback ok_cb, GCallback cancel_cb, | |
1557 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1558 const char *ui_hint, void *user_data); | |
1559 | |
1560 /** | |
1561 * @deprecated Please use purple_request_folder_with_hint() instead. | |
1562 */ | |
1452 void *purple_request_folder(void *handle, const char *title, const char *dirname, | 1563 void *purple_request_folder(void *handle, const char *title, const char *dirname, |
1453 GCallback ok_cb, GCallback cancel_cb, | 1564 GCallback ok_cb, GCallback cancel_cb, |
1454 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1565 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1455 void *user_data); | 1566 void *user_data); |
1456 | 1567 |