libpurple/chat.h

Sun, 28 Aug 2016 16:27:57 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 28 Aug 2016 16:27:57 -0500
changeset 38016
3ac0882cd563
parent 37949
87d2c1513e5b
child 39738
14d425a528ad
permissions
-rw-r--r--

A few random cleanups and don't even try to document class structs

37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /* purple
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Purple is the legal property of its developers, whose names are too numerous
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * source distribution.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * (at your option) any later version.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * GNU General Public License for more details.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22 #ifndef PURPLE_CHAT_H
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #define PURPLE_CHAT_H
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 /**
37949
87d2c1513e5b Clean up some documentation comments
Gary Kramlich <grim@reaperworld.com>
parents: 37947
diff changeset
26 * SECTION:chat
87d2c1513e5b Clean up some documentation comments
Gary Kramlich <grim@reaperworld.com>
parents: 37947
diff changeset
27 * @section_id: libpurple-chat
87d2c1513e5b Clean up some documentation comments
Gary Kramlich <grim@reaperworld.com>
parents: 37947
diff changeset
28 * @short_description: <filename>chat.h</filename>
87d2c1513e5b Clean up some documentation comments
Gary Kramlich <grim@reaperworld.com>
parents: 37947
diff changeset
29 * @title: Chat Object
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #define PURPLE_TYPE_CHAT (purple_chat_get_type())
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33 #define PURPLE_CHAT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_CHAT, PurpleChat))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 #define PURPLE_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_CHAT, PurpleChatClass))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 #define PURPLE_IS_CHAT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_CHAT))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 #define PURPLE_IS_CHAT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_CHAT))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 #define PURPLE_CHAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_CHAT, PurpleChatClass))
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 typedef struct _PurpleChat PurpleChat;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 typedef struct _PurpleChatClass PurpleChatClass;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 #include "blistnode.h"
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 #include "group.h"
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
44
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
45 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 * PurpleChat:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 * A chat on the buddy list.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 struct _PurpleChat {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 PurpleBlistNode node;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 };
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
54 struct _PurpleChatClass {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 PurpleBlistNodeClass node_class;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 /*< private >*/
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 void (*_purple_reserved1)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 void (*_purple_reserved2)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60 void (*_purple_reserved3)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 void (*_purple_reserved4)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
62 };
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64 G_BEGIN_DECLS
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
66 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 * purple_chat_get_type:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69 * Returns: The #GType for the #PurpleChat object.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 GType purple_chat_get_type(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * purple_chat_new:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 * @account: The account this chat will get added to
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76 * @alias: The alias of the new chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 * @components: The info the protocol needs to join the chat. The
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * hash function should be g_str_hash() and the
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 * equal function should be g_str_equal().
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 * Creates a new chat for the buddy list
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 * Returns: A newly allocated chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 PurpleChat *purple_chat_new(PurpleAccount *account, const char *alias, GHashTable *components);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
88 * purple_chat_get_name:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
89 * @chat: The chat whose name will be returned.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91 * Returns the correct name to display for a blist chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 * Returns: The alias (if set), or first component value.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
95 const char *purple_chat_get_name(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
97 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
98 * purple_chat_get_name_only:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 * @chat: The chat whose name will be returned.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 * Returns the name of the chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
103 * Returns: The first component value.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
104 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
105 const char *purple_chat_get_name_only(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 * purple_chat_set_alias:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 * @chat: The chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 * @alias: The alias
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
112 * Sets the alias for a blist chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
113 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
114 void purple_chat_set_alias(PurpleChat *chat, const char *alias);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
116 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
117 * purple_chat_get_group:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
118 * @chat: The chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
119 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
120 * Returns the group of which the chat is a member.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
121 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
122 * Returns: The parent group, or %NULL if the chat is not in a group.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
123 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
124 PurpleGroup *purple_chat_get_group(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 * purple_chat_get_account:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 * @chat: The chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 * Returns the account the chat belongs to.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 * Returns: The account the chat belongs to.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 PurpleAccount *purple_chat_get_account(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 * purple_chat_get_components:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 * @chat: The chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 * Get a hashtable containing information about a chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 * Returns: (transfer none): The hashtable.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
143 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
144 GHashTable *purple_chat_get_components(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 G_END_DECLS
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
148 #endif /* PURPLE_CHAT_H */

mercurial