comparison src/blist.h @ 7693:1d0314b99747

[gaim-migrate @ 8338] this doesn't seem to crash, so I figured I'd put it in get rid of the gaim_{buddy,chat,group}_{get,set}_setting() functions and replace them with gaim_blist_node_{get,set}_{bool,int,string} so we can have types, and clean up the code, all at the same time. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 02 Dec 2003 07:08:02 +0000
parents 3d49c33db741
children 2e6e269504a4
comparison
equal deleted inserted replaced
7692:8a826b27fcfb 7693:1d0314b99747
83 GaimBlistNodeType type; /**< The type of node this is */ 83 GaimBlistNodeType type; /**< The type of node this is */
84 GaimBlistNode *prev; /**< The sibling before this buddy. */ 84 GaimBlistNode *prev; /**< The sibling before this buddy. */
85 GaimBlistNode *next; /**< The sibling after this buddy. */ 85 GaimBlistNode *next; /**< The sibling after this buddy. */
86 GaimBlistNode *parent; /**< The parent of this node */ 86 GaimBlistNode *parent; /**< The parent of this node */
87 GaimBlistNode *child; /**< The child of this node */ 87 GaimBlistNode *child; /**< The child of this node */
88 GHashTable *settings; /**< per-node settings */
88 void *ui_data; /**< The UI can put data here. */ 89 void *ui_data; /**< The UI can put data here. */
89 }; 90 };
90 91
91 /** 92 /**
92 * A buddy. This contains everything Gaim will ever need to know about someone on the buddy list. Everything. 93 * A buddy. This contains everything Gaim will ever need to know about someone on the buddy list. Everything.
103 int idle; /**< The time the buddy has been idle in minutes. */ 104 int idle; /**< The time the buddy has been idle in minutes. */
104 int uc; /**< This is a cryptic bitmask that makes sense only to the prpl. This will get changed */ 105 int uc; /**< This is a cryptic bitmask that makes sense only to the prpl. This will get changed */
105 void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */ 106 void *proto_data; /**< This allows the prpl to associate whatever data it wants with a buddy */
106 GaimBuddyIcon *icon; /**< The buddy icon. */ 107 GaimBuddyIcon *icon; /**< The buddy icon. */
107 GaimAccount *account; /**< the account this buddy belongs to */ 108 GaimAccount *account; /**< the account this buddy belongs to */
108 GHashTable *settings; /**< per-buddy settings from the XML buddy list, set by plugins and the likes. */
109 guint timer; /**< The timer handle. */ 109 guint timer; /**< The timer handle. */
110 }; 110 };
111 111
112 /** 112 /**
113 * A contact. This contains everything Gaim will ever need to know about a contact. 113 * A contact. This contains everything Gaim will ever need to know about a contact.
130 GaimBlistNode node; /**< The node that this group inherits from */ 130 GaimBlistNode node; /**< The node that this group inherits from */
131 char *name; /**< The name of this group. */ 131 char *name; /**< The name of this group. */
132 int totalsize; /**< The number of chats and contacts in this group */ 132 int totalsize; /**< The number of chats and contacts in this group */
133 int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */ 133 int currentsize; /**< The number of chats and contacts in this group corresponding to online accounts */
134 int online; /**< The number of chats and contacts in this group who are currently online */ 134 int online; /**< The number of chats and contacts in this group who are currently online */
135 GHashTable *settings; /**< per-group settings from the XML buddy list, set by plugins and the likes. */
136 }; 135 };
137 136
138 /** 137 /**
139 * A chat. This contains everything Gaim needs to put a chat room in the 138 * A chat. This contains everything Gaim needs to put a chat room in the
140 * buddy list. 139 * buddy list.
142 struct _GaimChat { 141 struct _GaimChat {
143 GaimBlistNode node; /**< The node that this chat inherits from */ 142 GaimBlistNode node; /**< The node that this chat inherits from */
144 char *alias; /**< The display name of this chat. */ 143 char *alias; /**< The display name of this chat. */
145 GHashTable *components; /**< the stuff the protocol needs to know to join the chat */ 144 GHashTable *components; /**< the stuff the protocol needs to know to join the chat */
146 GaimAccount *account; /**< The account this chat is attached to */ 145 GaimAccount *account; /**< The account this chat is attached to */
147 GHashTable *settings; /**< per-chat settings from the XML buddy list, set by plugins and the likes. */
148 }; 146 };
149 147
150 148
151 /** 149 /**
152 * The Buddy List 150 * The Buddy List
704 * buddy list. 702 * buddy list.
705 */ 703 */
706 void gaim_blist_request_add_group(void); 704 void gaim_blist_request_add_group(void);
707 705
708 /** 706 /**
707 * Associates a boolean with a node in the buddy list
708 *
709 * @param node The node to associate the data with
710 * @param key The identifier for the data
711 * @param value The value to set
712 */
713 void gaim_blist_node_set_bool(GaimBlistNode *node, const char *key, gboolean value);
714
715 /**
716 * Retreives a named boolean setting from a node in the buddy list
717 *
718 * @param node The node to retreive the data from
719 * @param key The identifier of the data
720 *
721 * @return The value, or FALSE if there is no setting
722 */
723 gboolean gaim_blist_node_get_bool(GaimBlistNode *node, const char *key);
724
725 /**
726 * Associates an integer with a node in the buddy list
727 *
728 * @param node The node to associate the data with
729 * @param key The identifier for the data
730 * @param value The value to set
731 */
732 void gaim_blist_node_set_int(GaimBlistNode *node, const char *key, int value);
733
734 /**
735 * Retreives a named integer setting from a node in the buddy list
736 *
737 * @param node The node to retreive the data from
738 * @param key The identifier of the data
739 *
740 * @return The value, or 0 if there is no setting
741 */
742 int gaim_blist_node_get_int(GaimBlistNode *node, const char *key);
743
744 /**
745 * Associates a string with a node in the buddy list
746 *
747 * @param node The node to associate the data with
748 * @param key The identifier for the data
749 * @param value The value to set
750 */
751 void gaim_blist_node_set_string(GaimBlistNode *node, const char *key,
752 const char *value);
753
754 /**
755 * Retreives a named string setting from a node in the buddy list
756 *
757 * @param node The node to retreive the data from
758 * @param key The identifier of the data
759 *
760 * @return The value, or NULL if there is no setting
761 */
762 const char *gaim_blist_node_get_string(GaimBlistNode *node, const char *key);
763
764 /**
709 * Associates some data with the group in the xml buddy list 765 * Associates some data with the group in the xml buddy list
710 * 766 *
711 * @param g The group the data is associated with 767 * @param g The group the data is associated with
712 * @param key The key used to retrieve the data 768 * @param key The key used to retrieve the data
713 * @param value The data to set 769 * @param value The data to set