Mercurial > pidgin.yaz
comparison libpurple/request.h @ 21560:665e04562de0
This merge has the effect of reverting the hinting code from trunk.
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Sat, 17 Nov 2007 00:12:30 +0000 |
parents | 6de09629f091 fcb848b2d669 |
children | 554cb1447d06 |
comparison
equal
deleted
inserted
replaced
21544:9b4d1af17ced | 21560:665e04562de0 |
---|---|
196 | 196 |
197 void *ui_data; | 197 void *ui_data; |
198 | 198 |
199 } PurpleRequestField; | 199 } PurpleRequestField; |
200 | 200 |
201 /* | |
202 * UI hints for the request functions. These are used by libpurple. | |
203 */ | |
204 | |
205 /** | |
206 * @since 2.3.0 | |
207 */ | |
208 #define PURPLE_REQUEST_UI_HINT_ACCOUNT "account" | |
209 | |
210 /** | |
211 * @since 2.3.0 | |
212 */ | |
213 #define PURPLE_REQUEST_UI_HINT_BLIST "blist" | |
214 | |
215 /** | |
216 * @since 2.3.0 | |
217 */ | |
218 #define PURPLE_REQUEST_UI_HINT_BUDDY "buddy" | |
219 | |
220 /** | |
221 * @since 2.3.0 | |
222 */ | |
223 #define PURPLE_REQUEST_UI_HINT_CONV "conversation" | |
224 | |
225 /** | |
226 * @since 2.3.0 | |
227 */ | |
228 #define PURPLE_REQUEST_UI_HINT_REGISTER "register-account" | |
229 | |
230 /** | |
231 * @since 2.3.0 | |
232 */ | |
233 #define PURPLE_REQUEST_UI_HINT_XFER "xfer" | |
234 | |
235 | |
236 /* | |
237 * UI hints for the request functions. These are common hints used by UIs. | |
238 * UIs can still define any hints they like, but standardization is good. | |
239 */ | |
240 | |
241 /** | |
242 * @since 2.3.0 | |
243 */ | |
244 #define PURPLE_REQUEST_UI_HINT_ACCOUNTMGR "accountmgr" | |
245 | |
246 /** | |
247 * @since 2.3.0 | |
248 */ | |
249 #define PURPLE_REQUEST_UI_HINT_CERTMGR "certmgr" | |
250 | |
251 /** | |
252 * @since 2.3.0 | |
253 */ | |
254 #define PURPLE_REQUEST_UI_HINT_PLUGINMGR "pluginmgr" | |
255 | |
256 /** | |
257 * @since 2.3.0 | |
258 */ | |
259 #define PURPLE_REQUEST_UI_HINT_POUNCEMGR "pouncemgr" | |
260 | |
261 /** | |
262 * @since 2.3.0 | |
263 */ | |
264 #define PURPLE_REQUEST_UI_HINT_PREFSMGR "preferences" | |
265 | |
266 /** | |
267 * @since 2.3.0 | |
268 */ | |
269 #define PURPLE_REQUEST_UI_HINT_STATUSMGR "statusmgr" | |
270 | |
271 | |
272 /** | 201 /** |
273 * Request UI operations. | 202 * Request UI operations. |
274 */ | 203 */ |
275 typedef struct | 204 typedef struct |
276 { | 205 { |
278 const char *secondary, const char *default_value, | 207 const char *secondary, const char *default_value, |
279 gboolean multiline, gboolean masked, gchar *hint, | 208 gboolean multiline, gboolean masked, gchar *hint, |
280 const char *ok_text, GCallback ok_cb, | 209 const char *ok_text, GCallback ok_cb, |
281 const char *cancel_text, GCallback cancel_cb, | 210 const char *cancel_text, GCallback cancel_cb, |
282 PurpleAccount *account, const char *who, PurpleConversation *conv, | 211 PurpleAccount *account, const char *who, PurpleConversation *conv, |
283 const char *ui_hint, void *user_data); | 212 void *user_data); |
284 void *(*request_choice)(const char *title, const char *primary, | 213 void *(*request_choice)(const char *title, const char *primary, |
285 const char *secondary, int default_value, | 214 const char *secondary, int default_value, |
286 const char *ok_text, GCallback ok_cb, | 215 const char *ok_text, GCallback ok_cb, |
287 const char *cancel_text, GCallback cancel_cb, | 216 const char *cancel_text, GCallback cancel_cb, |
288 PurpleAccount *account, const char *who, PurpleConversation *conv, | 217 PurpleAccount *account, const char *who, PurpleConversation *conv, |
289 const char *ui_hint, void *user_data, va_list choices); | 218 void *user_data, va_list choices); |
290 void *(*request_action)(const char *title, const char *primary, | 219 void *(*request_action)(const char *title, const char *primary, |
291 const char *secondary, int default_action, | 220 const char *secondary, int default_action, |
292 PurpleAccount *account, const char *who, PurpleConversation *conv, | 221 PurpleAccount *account, const char *who, PurpleConversation *conv, |
293 const char *ui_hint, void *user_data, size_t action_count, | 222 void *user_data, size_t action_count, |
294 va_list actions); | 223 va_list actions); |
295 void *(*request_fields)(const char *title, const char *primary, | 224 void *(*request_fields)(const char *title, const char *primary, |
296 const char *secondary, PurpleRequestFields *fields, | 225 const char *secondary, PurpleRequestFields *fields, |
297 const char *ok_text, GCallback ok_cb, | 226 const char *ok_text, GCallback ok_cb, |
298 const char *cancel_text, GCallback cancel_cb, | 227 const char *cancel_text, GCallback cancel_cb, |
299 PurpleAccount *account, const char *who, PurpleConversation *conv, | 228 PurpleAccount *account, const char *who, PurpleConversation *conv, |
300 const char *ui_hint, void *user_data); | 229 void *user_data); |
301 void *(*request_file)(const char *title, const char *filename, | 230 void *(*request_file)(const char *title, const char *filename, |
302 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, | 231 gboolean savedialog, GCallback ok_cb, GCallback cancel_cb, |
303 PurpleAccount *account, const char *who, PurpleConversation *conv, | 232 PurpleAccount *account, const char *who, PurpleConversation *conv, |
304 const char *ui_hint, void *user_data); | 233 void *user_data); |
305 void (*close_request)(PurpleRequestType type, void *ui_handle); | 234 void (*close_request)(PurpleRequestType type, void *ui_handle); |
306 void *(*request_folder)(const char *title, const char *dirname, | 235 void *(*request_folder)(const char *title, const char *dirname, |
307 GCallback ok_cb, GCallback cancel_cb, | 236 GCallback ok_cb, GCallback cancel_cb, |
308 PurpleAccount *account, const char *who, PurpleConversation *conv, | 237 PurpleAccount *account, const char *who, PurpleConversation *conv, |
309 const char *ui_hint, void *user_data); | 238 void *user_data); |
310 | 239 |
311 void (*_purple_reserved1)(void); | 240 void (*_purple_reserved1)(void); |
312 void (*_purple_reserved2)(void); | 241 void (*_purple_reserved2)(void); |
313 void (*_purple_reserved3)(void); | 242 void (*_purple_reserved3)(void); |
314 void (*_purple_reserved4)(void); | 243 void (*_purple_reserved4)(void); |
1336 /**************************************************************************/ | 1265 /**************************************************************************/ |
1337 /** @name Request API */ | 1266 /** @name Request API */ |
1338 /**************************************************************************/ | 1267 /**************************************************************************/ |
1339 /*@{*/ | 1268 /*@{*/ |
1340 | 1269 |
1341 /** | |
1342 * Prompts the user for text input. | |
1343 * | |
1344 * @param handle The plugin or connection handle. For some | |
1345 * things this is EXTREMELY important. The | |
1346 * handle is used to programmatically close | |
1347 * the request dialog when it is no longer | |
1348 * needed. For PRPLs this is often a pointer | |
1349 * to the PurpleConnection instance. For plugins | |
1350 * this should be a similar, unique memory | |
1351 * location. This value is important because | |
1352 * it allows a request to be closed, say, when | |
1353 * you sign offline. If the request is NOT | |
1354 * closed it is VERY likely to cause a crash | |
1355 * whenever the callback handler functions are | |
1356 * triggered. | |
1357 * @param title The title of the message. | |
1358 * @param primary The main point of the message. | |
1359 * @param secondary The secondary information. | |
1360 * @param default_value The default value. | |
1361 * @param multiline TRUE if the inputted text can span multiple lines. | |
1362 * @param masked TRUE if the inputted text should be masked in some way. | |
1363 * @param hint Optionally suggest how the input box should appear. | |
1364 * Use "html," for example, to allow the user to enter | |
1365 * HTML. | |
1366 * @param ok_text The text for the @c OK button. | |
1367 * @param ok_cb The callback for the @c OK button. | |
1368 * @param cancel_text The text for the @c Cancel button. | |
1369 * @param cancel_cb The callback for the @c Cancel button. | |
1370 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1371 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1372 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1373 * @param ui_hint UI hint | |
1374 * @param user_data The data to pass to the callback. | |
1375 * | |
1376 * @return A UI-specific handle. | |
1377 * | |
1378 * @since 2.3.0 | |
1379 */ | |
1380 void *purple_request_input_with_hint(void *handle, const char *title, | |
1381 const char *primary, const char *secondary, | |
1382 const char *default_value, | |
1383 gboolean multiline, gboolean masked, gchar *hint, | |
1384 const char *ok_text, GCallback ok_cb, | |
1385 const char *cancel_text, GCallback cancel_cb, | |
1386 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1387 const char *ui_hint, void *user_data); | |
1388 | |
1389 #ifndef PURPLE_DISABLE_DEPRECATED | |
1390 /** | 1270 /** |
1391 * Prompts the user for text input. | 1271 * Prompts the user for text input. |
1392 * | 1272 * |
1393 * @param handle The plugin or connection handle. For some | 1273 * @param handle The plugin or connection handle. For some |
1394 * things this is EXTREMELY important. The | 1274 * things this is EXTREMELY important. The |
1420 * @param who The username of the buddy assocaited with this request, or NULL if none is | 1300 * @param who The username of the buddy assocaited with this request, or NULL if none is |
1421 * @param conv The PurpleConversation associated with this request, or NULL if none is | 1301 * @param conv The PurpleConversation associated with this request, or NULL if none is |
1422 * @param user_data The data to pass to the callback. | 1302 * @param user_data The data to pass to the callback. |
1423 * | 1303 * |
1424 * @return A UI-specific handle. | 1304 * @return A UI-specific handle. |
1425 * | |
1426 * @deprecated Please use purple_request_input_with_hint() instead. | |
1427 */ | 1305 */ |
1428 void *purple_request_input(void *handle, const char *title, | 1306 void *purple_request_input(void *handle, const char *title, |
1429 const char *primary, const char *secondary, | 1307 const char *primary, const char *secondary, |
1430 const char *default_value, | 1308 const char *default_value, |
1431 gboolean multiline, gboolean masked, gchar *hint, | 1309 gboolean multiline, gboolean masked, gchar *hint, |
1432 const char *ok_text, GCallback ok_cb, | 1310 const char *ok_text, GCallback ok_cb, |
1433 const char *cancel_text, GCallback cancel_cb, | 1311 const char *cancel_text, GCallback cancel_cb, |
1434 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1312 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1435 void *user_data); | 1313 void *user_data); |
1436 #endif | 1314 |
1437 | |
1438 /** | |
1439 * Prompts the user for multiple-choice input. | |
1440 * | |
1441 * @param handle The plugin or connection handle. For some | |
1442 * things this is EXTREMELY important. See | |
1443 * the comments on purple_request_input. | |
1444 * @param title The title of the message. | |
1445 * @param primary The main point of the message. | |
1446 * @param secondary The secondary information. | |
1447 * @param default_value The default value. | |
1448 * @param ok_text The text for the @c OK button. | |
1449 * @param ok_cb The callback for the @c OK button. | |
1450 * @param cancel_text The text for the @c Cancel button. | |
1451 * @param cancel_cb The callback for the @c Cancel button. | |
1452 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1453 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1454 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1455 * @param ui_hint UI hint | |
1456 * @param user_data The data to pass to the callback. | |
1457 * @param ... The choices. This argument list should be | |
1458 * terminated with a NULL parameter. | |
1459 * | |
1460 * @return A UI-specific handle. | |
1461 * | |
1462 * @since 2.3.0 | |
1463 */ | |
1464 void *purple_request_choice_with_hint(void *handle, const char *title, | |
1465 const char *primary, const char *secondary, | |
1466 int default_value, | |
1467 const char *ok_text, GCallback ok_cb, | |
1468 const char *cancel_text, GCallback cancel_cb, | |
1469 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1470 const char *ui_hint, void *user_data, ...) G_GNUC_NULL_TERMINATED; | |
1471 | |
1472 #ifndef PURPLE_DISABLE_DEPRECATED | |
1473 /** | 1315 /** |
1474 * Prompts the user for multiple-choice input. | 1316 * Prompts the user for multiple-choice input. |
1475 * | 1317 * |
1476 * @param handle The plugin or connection handle. For some | 1318 * @param handle The plugin or connection handle. For some |
1477 * things this is EXTREMELY important. See | 1319 * things this is EXTREMELY important. See |
1490 * @param user_data The data to pass to the callback. | 1332 * @param user_data The data to pass to the callback. |
1491 * @param ... The choices. This argument list should be | 1333 * @param ... The choices. This argument list should be |
1492 * terminated with a NULL parameter. | 1334 * terminated with a NULL parameter. |
1493 * | 1335 * |
1494 * @return A UI-specific handle. | 1336 * @return A UI-specific handle. |
1495 * | |
1496 * @deprecated Please use purple_request_choice_with_hint() instead. | |
1497 */ | 1337 */ |
1498 void *purple_request_choice(void *handle, const char *title, | 1338 void *purple_request_choice(void *handle, const char *title, |
1499 const char *primary, const char *secondary, | 1339 const char *primary, const char *secondary, |
1500 int default_value, | 1340 int default_value, |
1501 const char *ok_text, GCallback ok_cb, | 1341 const char *ok_text, GCallback ok_cb, |
1502 const char *cancel_text, GCallback cancel_cb, | 1342 const char *cancel_text, GCallback cancel_cb, |
1503 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1343 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1504 void *user_data, ...) G_GNUC_NULL_TERMINATED; | 1344 void *user_data, ...) G_GNUC_NULL_TERMINATED; |
1505 #endif | 1345 |
1506 | |
1507 /** | |
1508 * Prompts the user for multiple-choice input. | |
1509 * | |
1510 * @param handle The plugin or connection handle. For some | |
1511 * things this is EXTREMELY important. See | |
1512 * the comments on purple_request_input. | |
1513 * @param title The title of the message. | |
1514 * @param primary The main point of the message. | |
1515 * @param secondary The secondary information. | |
1516 * @param default_value The default value. | |
1517 * @param ok_text The text for the @c OK button. | |
1518 * @param ok_cb The callback for the @c OK button. | |
1519 * @param cancel_text The text for the @c Cancel button. | |
1520 * @param cancel_cb The callback for the @c Cancel button. | |
1521 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1522 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1523 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1524 * @param ui_hint UI hint | |
1525 * @param user_data The data to pass to the callback. | |
1526 * @param choices The choices. This argument list should be | |
1527 * terminated with a @c NULL parameter. | |
1528 * | |
1529 * @return A UI-specific handle. | |
1530 * | |
1531 * @since 2.3.0 | |
1532 */ | |
1533 void *purple_request_choice_varg_with_hint(void *handle, const char *title, | |
1534 const char *primary, const char *secondary, | |
1535 int default_value, | |
1536 const char *ok_text, GCallback ok_cb, | |
1537 const char *cancel_text, GCallback cancel_cb, | |
1538 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1539 const char *ui_hint, void *user_data, va_list choices); | |
1540 | |
1541 #ifndef PURPLE_DISABLE_DEPRECATED | |
1542 /** | 1346 /** |
1543 * Prompts the user for multiple-choice input. | 1347 * Prompts the user for multiple-choice input. |
1544 * | 1348 * |
1545 * @param handle The plugin or connection handle. For some | 1349 * @param handle The plugin or connection handle. For some |
1546 * things this is EXTREMELY important. See | 1350 * things this is EXTREMELY important. See |
1559 * @param user_data The data to pass to the callback. | 1363 * @param user_data The data to pass to the callback. |
1560 * @param choices The choices. This argument list should be | 1364 * @param choices The choices. This argument list should be |
1561 * terminated with a @c NULL parameter. | 1365 * terminated with a @c NULL parameter. |
1562 * | 1366 * |
1563 * @return A UI-specific handle. | 1367 * @return A UI-specific handle. |
1564 * | |
1565 * @deprecated Please use purple_request_choice_varg_with_hint() instead. | |
1566 */ | 1368 */ |
1567 void *purple_request_choice_varg(void *handle, const char *title, | 1369 void *purple_request_choice_varg(void *handle, const char *title, |
1568 const char *primary, const char *secondary, | 1370 const char *primary, const char *secondary, |
1569 int default_value, | 1371 int default_value, |
1570 const char *ok_text, GCallback ok_cb, | 1372 const char *ok_text, GCallback ok_cb, |
1571 const char *cancel_text, GCallback cancel_cb, | 1373 const char *cancel_text, GCallback cancel_cb, |
1572 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1374 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1573 void *user_data, va_list choices); | 1375 void *user_data, va_list choices); |
1574 #endif | 1376 |
1575 | |
1576 /** | |
1577 * Prompts the user for an action. | |
1578 * | |
1579 * This is often represented as a dialog with a button for each action. | |
1580 * | |
1581 * @param handle The plugin or connection handle. For some | |
1582 * things this is EXTREMELY important. See | |
1583 * the comments on purple_request_input. | |
1584 * @param title The title of the message. | |
1585 * @param primary The main point of the message. | |
1586 * @param secondary The secondary information. | |
1587 * @param default_action The default value. | |
1588 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1589 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1590 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1591 * @param ui_hint UI hint | |
1592 * @param user_data The data to pass to the callback. | |
1593 * @param action_count The number of actions. | |
1594 * @param ... A list of actions. These are pairs of | |
1595 * arguments. The first of each pair is the | |
1596 * string that appears on the button. It should | |
1597 * have an underscore before the letter you want | |
1598 * to use as the accelerator key for the button. | |
1599 * The second of each pair is the callback | |
1600 * function to use when the button is clicked. | |
1601 * | |
1602 * @return A UI-specific handle. | |
1603 * | |
1604 * @since 2.3.0 | |
1605 */ | |
1606 void *purple_request_action_with_hint(void *handle, const char *title, | |
1607 const char *primary, const char *secondary, | |
1608 int default_action, | |
1609 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1610 const char *ui_hint, void *user_data, size_t action_count, ...); | |
1611 | |
1612 #ifndef PURPLE_DISABLE_DEPRECATED | |
1613 /** | 1377 /** |
1614 * Prompts the user for an action. | 1378 * Prompts the user for an action. |
1615 * | 1379 * |
1616 * This is often represented as a dialog with a button for each action. | 1380 * This is often represented as a dialog with a button for each action. |
1617 * | 1381 * |
1634 * to use as the accelerator key for the button. | 1398 * to use as the accelerator key for the button. |
1635 * The second of each pair is the callback | 1399 * The second of each pair is the callback |
1636 * function to use when the button is clicked. | 1400 * function to use when the button is clicked. |
1637 * | 1401 * |
1638 * @return A UI-specific handle. | 1402 * @return A UI-specific handle. |
1639 * | |
1640 * @deprecated Please use purple_request_action_with_hint() instead. | |
1641 */ | 1403 */ |
1642 void *purple_request_action(void *handle, const char *title, | 1404 void *purple_request_action(void *handle, const char *title, |
1643 const char *primary, const char *secondary, | 1405 const char *primary, const char *secondary, |
1644 int default_action, | 1406 int default_action, |
1645 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1407 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1646 void *user_data, size_t action_count, ...); | 1408 void *user_data, size_t action_count, ...); |
1647 #endif | 1409 |
1648 | |
1649 /** | |
1650 * Prompts the user for an action. | |
1651 * | |
1652 * This is often represented as a dialog with a button for each action. | |
1653 * | |
1654 * @param handle The plugin or connection handle. For some | |
1655 * things this is EXTREMELY important. See | |
1656 * the comments on purple_request_input. | |
1657 * @param title The title of the message. | |
1658 * @param primary The main point of the message. | |
1659 * @param secondary The secondary information. | |
1660 * @param default_action The default value. | |
1661 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1662 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1663 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1664 * @param ui_hint UI hint | |
1665 * @param user_data The data to pass to the callback. | |
1666 * @param action_count The number of actions. | |
1667 * @param actions A list of actions and callbacks. | |
1668 * | |
1669 * @return A UI-specific handle. | |
1670 * | |
1671 * @since 2.3.0 | |
1672 */ | |
1673 void *purple_request_action_varg_with_hint(void *handle, const char *title, | |
1674 const char *primary, const char *secondary, | |
1675 int default_action, | |
1676 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1677 const char *ui_hint, void *user_data, size_t action_count, | |
1678 va_list actions); | |
1679 | |
1680 #ifndef PURPLE_DISABLE_DEPRECATED | |
1681 /** | 1410 /** |
1682 * Prompts the user for an action. | 1411 * Prompts the user for an action. |
1683 * | 1412 * |
1684 * This is often represented as a dialog with a button for each action. | 1413 * This is often represented as a dialog with a button for each action. |
1685 * | 1414 * |
1696 * @param user_data The data to pass to the callback. | 1425 * @param user_data The data to pass to the callback. |
1697 * @param action_count The number of actions. | 1426 * @param action_count The number of actions. |
1698 * @param actions A list of actions and callbacks. | 1427 * @param actions A list of actions and callbacks. |
1699 * | 1428 * |
1700 * @return A UI-specific handle. | 1429 * @return A UI-specific handle. |
1701 * | |
1702 * @deprecated Please use purple_request_action_varg_with_hint() instead. | |
1703 */ | 1430 */ |
1704 void *purple_request_action_varg(void *handle, const char *title, | 1431 void *purple_request_action_varg(void *handle, const char *title, |
1705 const char *primary, const char *secondary, | 1432 const char *primary, const char *secondary, |
1706 int default_action, | 1433 int default_action, |
1707 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1434 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1708 void *user_data, size_t action_count, | 1435 void *user_data, size_t action_count, |
1709 va_list actions); | 1436 va_list actions); |
1710 #endif | 1437 |
1711 | |
1712 /** | |
1713 * Displays groups of fields for the user to fill in. | |
1714 * | |
1715 * @param handle The plugin or connection handle. For some | |
1716 * things this is EXTREMELY important. See | |
1717 * the comments on purple_request_input. | |
1718 * @param title The title of the message. | |
1719 * @param primary The main point of the message. | |
1720 * @param secondary The secondary information. | |
1721 * @param fields The list of fields. | |
1722 * @param ok_text The text for the @c OK button. | |
1723 * @param ok_cb The callback for the @c OK button. | |
1724 * @param cancel_text The text for the @c Cancel button. | |
1725 * @param cancel_cb The callback for the @c Cancel button. | |
1726 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1727 * @param who The username of the buddy associated with this request, or NULL if none is | |
1728 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1729 * @param ui_hint UI hint | |
1730 * @param user_data The data to pass to the callback. | |
1731 * | |
1732 * @return A UI-specific handle. | |
1733 * | |
1734 * @since 2.3.0 | |
1735 */ | |
1736 void *purple_request_fields_with_hint(void *handle, const char *title, | |
1737 const char *primary, const char *secondary, | |
1738 PurpleRequestFields *fields, | |
1739 const char *ok_text, GCallback ok_cb, | |
1740 const char *cancel_text, GCallback cancel_cb, | |
1741 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1742 const char *ui_hint, void *user_data); | |
1743 | |
1744 #ifndef PURPLE_DISABLE_DEPRECATED | |
1745 /** | 1438 /** |
1746 * Displays groups of fields for the user to fill in. | 1439 * Displays groups of fields for the user to fill in. |
1747 * | 1440 * |
1748 * @param handle The plugin or connection handle. For some | 1441 * @param handle The plugin or connection handle. For some |
1749 * things this is EXTREMELY important. See | 1442 * things this is EXTREMELY important. See |
1760 * @param who The username of the buddy associated with this request, or NULL if none is | 1453 * @param who The username of the buddy associated with this request, or NULL if none is |
1761 * @param conv The PurpleConversation associated with this request, or NULL if none is | 1454 * @param conv The PurpleConversation associated with this request, or NULL if none is |
1762 * @param user_data The data to pass to the callback. | 1455 * @param user_data The data to pass to the callback. |
1763 * | 1456 * |
1764 * @return A UI-specific handle. | 1457 * @return A UI-specific handle. |
1765 * | |
1766 * @deprecated Please use purple_request_fields_with_hint() instead. | |
1767 */ | 1458 */ |
1768 void *purple_request_fields(void *handle, const char *title, | 1459 void *purple_request_fields(void *handle, const char *title, |
1769 const char *primary, const char *secondary, | 1460 const char *primary, const char *secondary, |
1770 PurpleRequestFields *fields, | 1461 PurpleRequestFields *fields, |
1771 const char *ok_text, GCallback ok_cb, | 1462 const char *ok_text, GCallback ok_cb, |
1772 const char *cancel_text, GCallback cancel_cb, | 1463 const char *cancel_text, GCallback cancel_cb, |
1773 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1464 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1774 void *user_data); | 1465 void *user_data); |
1775 #endif | |
1776 | 1466 |
1777 /** | 1467 /** |
1778 * Closes a request. | 1468 * Closes a request. |
1779 * | 1469 * |
1780 * @param type The request type. | 1470 * @param type The request type. |
1789 */ | 1479 */ |
1790 void purple_request_close_with_handle(void *handle); | 1480 void purple_request_close_with_handle(void *handle); |
1791 | 1481 |
1792 /** | 1482 /** |
1793 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. | 1483 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. |
1794 * | |
1795 * @since 2.3.0 | |
1796 */ | |
1797 #define purple_request_yes_no_with_hint(handle, title, primary, secondary, \ | |
1798 default_action, account, who, conv, \ | |
1799 ui_hint, user_data, yes_cb, no_cb) \ | |
1800 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1801 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | |
1802 _("_Yes"), (yes_cb), _("_No"), (no_cb)) | |
1803 | |
1804 #ifndef PURPLE_DISABLE_DEPRECATED | |
1805 /** | |
1806 * A wrapper for purple_request_action() that uses @c Yes and @c No buttons. | |
1807 * | |
1808 * @deprecated Please use purple_request_yes_no_with_hint instead. | |
1809 */ | 1484 */ |
1810 #define purple_request_yes_no(handle, title, primary, secondary, \ | 1485 #define purple_request_yes_no(handle, title, primary, secondary, \ |
1811 default_action, account, who, conv, \ | 1486 default_action, account, who, conv, \ |
1812 user_data, yes_cb, no_cb) \ | 1487 user_data, yes_cb, no_cb) \ |
1813 purple_request_action((handle), (title), (primary), (secondary), \ | 1488 purple_request_action((handle), (title), (primary), (secondary), \ |
1814 (default_action), account, who, conv, (user_data), 2, \ | 1489 (default_action), account, who, conv, (user_data), 2, \ |
1815 _("_Yes"), (yes_cb), _("_No"), (no_cb)) | 1490 _("_Yes"), (yes_cb), _("_No"), (no_cb)) |
1816 #endif | |
1817 | 1491 |
1818 /** | 1492 /** |
1819 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. | 1493 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. |
1820 * | |
1821 * @since 2.3.0 | |
1822 */ | |
1823 #define purple_request_ok_cancel_with_hint(handle, title, primary, secondary, \ | |
1824 default_action, account, who, conv, \ | |
1825 ui_hint, user_data, ok_cb, cancel_cb) \ | |
1826 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1827 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | |
1828 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) | |
1829 | |
1830 #ifndef PURPLE_DISABLE_DEPRECATED | |
1831 /** | |
1832 * A wrapper for purple_request_action() that uses @c OK and @c Cancel buttons. | |
1833 * | |
1834 * @deprecated Please use purple_request_ok_cancel_with_hint instead. | |
1835 */ | 1494 */ |
1836 #define purple_request_ok_cancel(handle, title, primary, secondary, \ | 1495 #define purple_request_ok_cancel(handle, title, primary, secondary, \ |
1837 default_action, account, who, conv, \ | 1496 default_action, account, who, conv, \ |
1838 user_data, ok_cb, cancel_cb) \ | 1497 user_data, ok_cb, cancel_cb) \ |
1839 purple_request_action((handle), (title), (primary), (secondary), \ | 1498 purple_request_action((handle), (title), (primary), (secondary), \ |
1840 (default_action), account, who, conv, (user_data), 2, \ | 1499 (default_action), account, who, conv, (user_data), 2, \ |
1841 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) | 1500 _("_OK"), (ok_cb), _("_Cancel"), (cancel_cb)) |
1842 #endif | |
1843 | 1501 |
1844 /** | 1502 /** |
1845 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. | 1503 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. |
1846 * | |
1847 * @since 2.3.0 | |
1848 */ | |
1849 #define purple_request_accept_cancel_with_hint(handle, title, primary, secondary, \ | |
1850 default_action, account, who, conv, \ | |
1851 ui_hint, user_data, accept_cb, cancel_cb) \ | |
1852 purple_request_action_with_hint((handle), (title), (primary), (secondary), \ | |
1853 (default_action), account, who, conv, (ui_hint), (user_data), 2, \ | |
1854 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) | |
1855 | |
1856 #ifndef PURPLE_DISABLE_DEPRECATED | |
1857 /** | |
1858 * A wrapper for purple_request_action() that uses Accept and Cancel buttons. | |
1859 * | |
1860 * @deprecated Please use purple_request_accept_cancel_with_hint instead. | |
1861 */ | 1504 */ |
1862 #define purple_request_accept_cancel(handle, title, primary, secondary, \ | 1505 #define purple_request_accept_cancel(handle, title, primary, secondary, \ |
1863 default_action, account, who, conv, \ | 1506 default_action, account, who, conv, \ |
1864 user_data, accept_cb, cancel_cb) \ | 1507 user_data, accept_cb, cancel_cb) \ |
1865 purple_request_action((handle), (title), (primary), (secondary), \ | 1508 purple_request_action((handle), (title), (primary), (secondary), \ |
1866 (default_action), account, who, conv, (user_data), 2, \ | 1509 (default_action), account, who, conv, (user_data), 2, \ |
1867 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) | 1510 _("_Accept"), (accept_cb), _("_Cancel"), (cancel_cb)) |
1868 #endif | 1511 |
1869 | |
1870 /** | |
1871 * Displays a file selector request dialog. Returns the selected filename to | |
1872 * the callback. Can be used for either opening a file or saving a file. | |
1873 * | |
1874 * @param handle The plugin or connection handle. For some | |
1875 * things this is EXTREMELY important. See | |
1876 * the comments on purple_request_input. | |
1877 * @param title The title for the dialog (may be @c NULL) | |
1878 * @param filename The default filename (may be @c NULL) | |
1879 * @param savedialog True if this dialog is being used to save a file. | |
1880 * False if it is being used to open a file. | |
1881 * @param ok_cb The callback for the @c OK button. | |
1882 * @param cancel_cb The callback for the @c Cancel button. | |
1883 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1884 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1885 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1886 * @param ui_hint UI hint | |
1887 * @param user_data The data to pass to the callback. | |
1888 * | |
1889 * @return A UI-specific handle. | |
1890 * | |
1891 * @since 2.3.0 | |
1892 */ | |
1893 void *purple_request_file_with_hint(void *handle, const char *title, const char *filename, | |
1894 gboolean savedialog, | |
1895 GCallback ok_cb, GCallback cancel_cb, | |
1896 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1897 const char *ui_hint, void *user_data); | |
1898 | |
1899 #ifndef PURPLE_DISABLE_DEPRECATED | |
1900 /** | 1512 /** |
1901 * Displays a file selector request dialog. Returns the selected filename to | 1513 * Displays a file selector request dialog. Returns the selected filename to |
1902 * the callback. Can be used for either opening a file or saving a file. | 1514 * the callback. Can be used for either opening a file or saving a file. |
1903 * | 1515 * |
1904 * @param handle The plugin or connection handle. For some | 1516 * @param handle The plugin or connection handle. For some |
1914 * @param who The username of the buddy assocaited with this request, or NULL if none is | 1526 * @param who The username of the buddy assocaited with this request, or NULL if none is |
1915 * @param conv The PurpleConversation associated with this request, or NULL if none is | 1527 * @param conv The PurpleConversation associated with this request, or NULL if none is |
1916 * @param user_data The data to pass to the callback. | 1528 * @param user_data The data to pass to the callback. |
1917 * | 1529 * |
1918 * @return A UI-specific handle. | 1530 * @return A UI-specific handle. |
1919 * | |
1920 * @deprecated Please use purple_request_file_with_hint() instead. | |
1921 */ | 1531 */ |
1922 void *purple_request_file(void *handle, const char *title, const char *filename, | 1532 void *purple_request_file(void *handle, const char *title, const char *filename, |
1923 gboolean savedialog, | 1533 gboolean savedialog, |
1924 GCallback ok_cb, GCallback cancel_cb, | 1534 GCallback ok_cb, GCallback cancel_cb, |
1925 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1535 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1926 void *user_data); | 1536 void *user_data); |
1927 #endif | 1537 |
1928 | |
1929 /** | |
1930 * Displays a folder select dialog. Returns the selected filename to | |
1931 * the callback. | |
1932 * | |
1933 * @param handle The plugin or connection handle. For some | |
1934 * things this is EXTREMELY important. See | |
1935 * the comments on purple_request_input. | |
1936 * @param title The title for the dialog (may be @c NULL) | |
1937 * @param dirname The default directory name (may be @c NULL) | |
1938 * @param ok_cb The callback for the @c OK button. | |
1939 * @param cancel_cb The callback for the @c Cancel button. | |
1940 * @param account The PurpleAccount associated with this request, or NULL if none is | |
1941 * @param who The username of the buddy assocaited with this request, or NULL if none is | |
1942 * @param conv The PurpleConversation associated with this request, or NULL if none is | |
1943 * @param ui_hint UI hint | |
1944 * @param user_data The data to pass to the callback. | |
1945 * | |
1946 * @return A UI-specific handle. | |
1947 * | |
1948 * @since 2.3.0 | |
1949 */ | |
1950 void *purple_request_folder_with_hint(void *handle, const char *title, const char *dirname, | |
1951 GCallback ok_cb, GCallback cancel_cb, | |
1952 PurpleAccount *account, const char *who, PurpleConversation *conv, | |
1953 const char *ui_hint, void *user_data); | |
1954 | |
1955 #ifndef PURPLE_DISABLE_DEPRECATED | |
1956 /** | 1538 /** |
1957 * Displays a folder select dialog. Returns the selected filename to | 1539 * Displays a folder select dialog. Returns the selected filename to |
1958 * the callback. | 1540 * the callback. |
1959 * | 1541 * |
1960 * @param handle The plugin or connection handle. For some | 1542 * @param handle The plugin or connection handle. For some |
1968 * @param who The username of the buddy assocaited with this request, or NULL if none is | 1550 * @param who The username of the buddy assocaited with this request, or NULL if none is |
1969 * @param conv The PurpleConversation associated with this request, or NULL if none is | 1551 * @param conv The PurpleConversation associated with this request, or NULL if none is |
1970 * @param user_data The data to pass to the callback. | 1552 * @param user_data The data to pass to the callback. |
1971 * | 1553 * |
1972 * @return A UI-specific handle. | 1554 * @return A UI-specific handle. |
1973 * | |
1974 * @deprecated Please use purple_request_folder_with_hint() instead. | |
1975 */ | 1555 */ |
1976 void *purple_request_folder(void *handle, const char *title, const char *dirname, | 1556 void *purple_request_folder(void *handle, const char *title, const char *dirname, |
1977 GCallback ok_cb, GCallback cancel_cb, | 1557 GCallback ok_cb, GCallback cancel_cb, |
1978 PurpleAccount *account, const char *who, PurpleConversation *conv, | 1558 PurpleAccount *account, const char *who, PurpleConversation *conv, |
1979 void *user_data); | 1559 void *user_data); |
1980 #endif | |
1981 | 1560 |
1982 /*@}*/ | 1561 /*@}*/ |
1983 | 1562 |
1984 /**************************************************************************/ | 1563 /**************************************************************************/ |
1985 /** @name UI Registration Functions */ | 1564 /** @name UI Registration Functions */ |