3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
27 * @section_id: libpurple-chat
28 * @short_description: <filename>chat.h</filename>
32 #define PURPLE_TYPE_CHAT (purple_chat_get_type())
33 #define PURPLE_CHAT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_CHAT, PurpleChat))
34 #define PURPLE_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_CHAT, PurpleChatClass))
35 #define PURPLE_IS_CHAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_CHAT))
36 #define PURPLE_IS_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CHAT))
37 #define PURPLE_CHAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CHAT, PurpleChatClass))
39 typedef struct _PurpleChat PurpleChat
;
40 typedef struct _PurpleChatClass PurpleChatClass
;
42 #include "blistnode.h"
48 * A chat on the buddy list.
54 struct _PurpleChatClass
{
55 PurpleBlistNodeClass node_class
;
58 void (*_purple_reserved1
)(void);
59 void (*_purple_reserved2
)(void);
60 void (*_purple_reserved3
)(void);
61 void (*_purple_reserved4
)(void);
67 * purple_chat_get_type:
69 * Returns: The #GType for the #PurpleChat object.
71 GType
purple_chat_get_type(void);
75 * @account: The account this chat will get added to
76 * @alias: The alias of the new chat
77 * @components: The info the protocol needs to join the chat. The
78 * hash function should be g_str_hash() and the
79 * equal function should be g_str_equal().
81 * Creates a new chat for the buddy list
83 * Returns: A newly allocated chat
85 PurpleChat
*purple_chat_new(PurpleAccount
*account
, const char *alias
, GHashTable
*components
);
88 * purple_chat_get_name:
89 * @chat: The chat whose name will be returned.
91 * Returns the correct name to display for a blist chat.
93 * Returns: The alias (if set), or first component value.
95 const char *purple_chat_get_name(PurpleChat
*chat
);
98 * purple_chat_get_name_only:
99 * @chat: The chat whose name will be returned.
101 * Returns the name of the chat
103 * Returns: The first component value.
105 const char *purple_chat_get_name_only(PurpleChat
*chat
);
108 * purple_chat_set_alias:
112 * Sets the alias for a blist chat.
114 void purple_chat_set_alias(PurpleChat
*chat
, const char *alias
);
117 * purple_chat_get_group:
120 * Returns the group of which the chat is a member.
122 * Returns: (transfer none): The parent group, or %NULL if the chat is not in a
125 PurpleGroup
*purple_chat_get_group(PurpleChat
*chat
);
128 * purple_chat_get_account:
131 * Returns the account the chat belongs to.
133 * Returns: (transfer none): The account the chat belongs to.
135 PurpleAccount
*purple_chat_get_account(PurpleChat
*chat
);
138 * purple_chat_get_components:
141 * Get a hashtable containing information about a chat.
143 * Returns: (transfer none): The hashtable.
145 GHashTable
*purple_chat_get_components(PurpleChat
*chat
);
149 #endif /* PURPLE_CHAT_H */