Mercurial > pidgin
comparison src/request.h @ 7898:9c0ea21997a9
[gaim-migrate @ 8558]
Added the core list request stuff. This will be added to in a moment,
because I just realized I forgot something really stupid.
committer: Tailor Script <tailor@pidgin.im>
| author | Christian Hammond <chipx86@chipx86.com> |
|---|---|
| date | Sun, 21 Dec 2003 07:52:26 +0000 |
| parents | 7d1909655fd0 |
| children | 7b64108b8ae3 |
comparison
equal
deleted
inserted
replaced
| 7897:e90d3d430798 | 7898:9c0ea21997a9 |
|---|---|
| 46 { | 46 { |
| 47 GAIM_REQUEST_FIELD_NONE, | 47 GAIM_REQUEST_FIELD_NONE, |
| 48 GAIM_REQUEST_FIELD_STRING, | 48 GAIM_REQUEST_FIELD_STRING, |
| 49 GAIM_REQUEST_FIELD_INTEGER, | 49 GAIM_REQUEST_FIELD_INTEGER, |
| 50 GAIM_REQUEST_FIELD_BOOLEAN, | 50 GAIM_REQUEST_FIELD_BOOLEAN, |
| 51 GAIM_REQUEST_FIELD_CHOICE | 51 GAIM_REQUEST_FIELD_CHOICE, |
| 52 GAIM_REQUEST_FIELD_LIST | |
| 52 | 53 |
| 53 } GaimRequestFieldType; | 54 } GaimRequestFieldType; |
| 54 | 55 |
| 55 /** | 56 /** |
| 56 * A request field. | 57 * A request field. |
| 94 int value; | 95 int value; |
| 95 | 96 |
| 96 GList *labels; | 97 GList *labels; |
| 97 | 98 |
| 98 } choice; | 99 } choice; |
| 100 | |
| 101 struct | |
| 102 { | |
| 103 GList *items; | |
| 104 GList *selected; | |
| 105 | |
| 106 gboolean multiple_selection; | |
| 107 | |
| 108 } list; | |
| 99 | 109 |
| 100 } u; | 110 } u; |
| 101 | 111 |
| 102 void *ui_data; | 112 void *ui_data; |
| 103 | 113 |
| 432 | 442 |
| 433 /** | 443 /** |
| 434 * Returns the default value in a string field. | 444 * Returns the default value in a string field. |
| 435 * | 445 * |
| 436 * @param field The field. | 446 * @param field The field. |
| 437 * | 447 * |
| 438 * @return The default value. | 448 * @return The default value. |
| 439 */ | 449 */ |
| 440 const char *gaim_request_field_string_get_default_value( | 450 const char *gaim_request_field_string_get_default_value( |
| 441 const GaimRequestField *field); | 451 const GaimRequestField *field); |
| 442 | 452 |
| 515 | 525 |
| 516 /** | 526 /** |
| 517 * Returns the default value in an integer field. | 527 * Returns the default value in an integer field. |
| 518 * | 528 * |
| 519 * @param field The field. | 529 * @param field The field. |
| 520 * | 530 * |
| 521 * @return The default value. | 531 * @return The default value. |
| 522 */ | 532 */ |
| 523 int gaim_request_field_int_get_default_value(const GaimRequestField *field); | 533 int gaim_request_field_int_get_default_value(const GaimRequestField *field); |
| 524 | 534 |
| 525 /** | 535 /** |
| 640 | 650 |
| 641 /** | 651 /** |
| 642 * Returns the default value in an choice field. | 652 * Returns the default value in an choice field. |
| 643 * | 653 * |
| 644 * @param field The field. | 654 * @param field The field. |
| 645 * | 655 * |
| 646 * @return The default value. | 656 * @return The default value. |
| 647 */ | 657 */ |
| 648 int gaim_request_field_choice_get_default_value(const GaimRequestField *field); | 658 int gaim_request_field_choice_get_default_value(const GaimRequestField *field); |
| 649 | 659 |
| 650 /** | 660 /** |
| 664 * @return The list of labels. | 674 * @return The list of labels. |
| 665 */ | 675 */ |
| 666 GList *gaim_request_field_choice_get_labels(const GaimRequestField *field); | 676 GList *gaim_request_field_choice_get_labels(const GaimRequestField *field); |
| 667 | 677 |
| 668 /*@}*/ | 678 /*@}*/ |
| 679 | |
| 680 /**************************************************************************/ | |
| 681 /** @name List Field API */ | |
| 682 /**************************************************************************/ | |
| 683 /*@{*/ | |
| 684 | |
| 685 /** | |
| 686 * Creates a multiple list item field. | |
| 687 * | |
| 688 * @param id The field ID. | |
| 689 * @param text The optional label of the field. | |
| 690 * @param items The list of items. | |
| 691 * | |
| 692 * @return The new field. | |
| 693 */ | |
| 694 GaimRequestField *gaim_request_field_list_new(const char *id, const char *text, | |
| 695 GList *items); | |
| 696 | |
| 697 /** | |
| 698 * Sets the list of items in a list field. | |
| 699 * | |
| 700 * The items are not copied. The actual list passed is assigned to the field. | |
| 701 * | |
| 702 * @param field The list field. | |
| 703 * @param items The items. | |
| 704 */ | |
| 705 void gaim_request_field_list_set_items(GaimRequestField *field, GList *items); | |
| 706 | |
| 707 /** | |
| 708 * Adds an item to a list field. | |
| 709 * | |
| 710 * @param field The list field. | |
| 711 * @param item The list item. | |
| 712 */ | |
| 713 void gaim_request_field_list_add(GaimRequestField *field, const char *item); | |
| 714 | |
| 715 /** | |
| 716 * Returns a list of selected items in a list field. | |
| 717 * | |
| 718 * @param field The field. | |
| 719 * | |
| 720 * @return The list of selected items. | |
| 721 */ | |
| 722 const GList *gaim_request_field_list_get_selected( | |
| 723 const GaimRequestField *field); | |
| 724 | |
| 725 /** | |
| 726 * Returns a list of items in a list field. | |
| 727 * | |
| 728 * @param field The field. | |
| 729 * | |
| 730 * @return The list of items. | |
| 731 */ | |
| 732 const GList *gaim_request_field_list_get_items(const GaimRequestField *field); | |
| 733 | |
| 734 /*@}*/ | |
| 735 | |
| 669 | 736 |
| 670 /**************************************************************************/ | 737 /**************************************************************************/ |
| 671 /** @name Request API */ | 738 /** @name Request API */ |
| 672 /**************************************************************************/ | 739 /**************************************************************************/ |
| 673 /*@{*/ | 740 /*@{*/ |
