libpurple/chat.h

Mon, 15 Aug 2022 02:39:09 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 15 Aug 2022 02:39:09 -0500
branch
gtk4
changeset 41561
ac5416e7e4f5
parent 41200
92a47aa620cf
child 42344
c51d37734155
permissions
-rw-r--r--

Port PidginAddBuddyDialog to GTK4

Testing Done:
Compiled

Reviewed at https://reviews.imfreedom.org/r/1586/

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
40474
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39738
diff changeset
22 #if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39738
diff changeset
23 # error "only <purple.h> may be included directly"
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39738
diff changeset
24 #endif
1341be8e3402 Make it so only libpurple can directly include libpurple header files.
Gary Kramlich <grim@reaperworld.com>
parents: 39738
diff changeset
25
37947
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #ifndef PURPLE_CHAT_H
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #define PURPLE_CHAT_H
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #define PURPLE_TYPE_CHAT (purple_chat_get_type())
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #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
31 #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
32 #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
33 #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
34 #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
35
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 typedef struct _PurpleChat PurpleChat;
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 typedef struct _PurpleChatClass 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 #include "blistnode.h"
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 #include "group.h"
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 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43 * PurpleChat:
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 * A chat on the buddy list.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 struct _PurpleChat {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48 PurpleBlistNode node;
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
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 struct _PurpleChatClass {
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
52 PurpleBlistNodeClass node_class;
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 /*< private >*/
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 void (*_purple_reserved1)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 void (*_purple_reserved2)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
57 void (*_purple_reserved3)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 void (*_purple_reserved4)(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 };
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
61 G_BEGIN_DECLS
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 * purple_chat_get_type:
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 * Returns: The #GType for the #PurpleChat object.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 GType purple_chat_get_type(void);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
69
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 * purple_chat_new:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72 * @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
73 * @alias: The alias of the new chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 * @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
75 * 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
76 * equal function should be g_str_equal().
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
77 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 * Creates a new chat for the buddy list
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80 * Returns: A newly allocated chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
81 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
82 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
83
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 * purple_chat_get_name:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 * @chat: The chat whose name will be returned.
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 * 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
89 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 * 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
91 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 const char *purple_chat_get_name(PurpleChat *chat);
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93
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 * purple_chat_get_name_only:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
96 * @chat: The chat whose name will be returned.
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 * Returns the name of the chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
99 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
100 * Returns: The first component value.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
101 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
102 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
103
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 * purple_chat_set_alias:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
106 * @chat: The chat
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
107 * @alias: The alias
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
108 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
109 * Sets the alias for a blist chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
110 */
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
111 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
112
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 * purple_chat_get_group:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
115 * @chat: The chat.
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 * 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
118 *
39738
14d425a528ad Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38016
diff changeset
119 * Returns: (transfer none): The parent group, or %NULL if the chat is not in a
14d425a528ad Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38016
diff changeset
120 * group.
37947
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 PurpleGroup *purple_chat_get_group(PurpleChat *chat);
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 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 * purple_chat_get_account:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126 * @chat: The chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
128 * Returns the account the chat belongs to.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
129 *
39738
14d425a528ad Add missing transfer annotations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 38016
diff changeset
130 * Returns: (transfer none): The account the chat belongs to.
37947
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 PurpleAccount *purple_chat_get_account(PurpleChat *chat);
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 /**
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 * purple_chat_get_components:
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136 * @chat: The chat.
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
137 *
12ce09a23094 Move PurpleChat to it's own file
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
138 * Get a hashtable containing information about a 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 * Returns: (transfer none): The hashtable.
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 GHashTable *purple_chat_get_components(PurpleChat *chat);
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 G_END_DECLS
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 #endif /* PURPLE_CHAT_H */

mercurial