libpurple/protocols/ircv3/purpleircv3connection.h

Thu, 02 Nov 2023 23:52:49 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Thu, 02 Nov 2023 23:52:49 -0500
changeset 42474
a9285192c3d3
parent 42472
409148c5c5b7
child 42494
4d6baa511e52
permissions
-rw-r--r--

IRCv3: fix introspection

Testing Done:
Ran `ninja turtles` successfully.

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

41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This program is free software; you can redistribute it and/or modify
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * the Free Software Foundation; either version 2 of the License, or
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * (at your option) any later version.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * GNU General Public License for more details.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * along with this program; if not, see <https://www.gnu.org/licenses/>.
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
18 #if !defined(PURPLE_IRCV3_GLOBAL_HEADER_INSIDE) && \
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
19 !defined(PURPLE_IRCV3_COMPILATION)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
20 # error "only <libpurple/protocols/ircv3.h> may be included directly"
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
21 #endif
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 #ifndef PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 #define PURPLE_IRCV3_CONNECTION_H
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 #include <glib.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 #include <glib-object.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29 #include <gplugin.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
30 #include <gplugin-native.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 #include <purple.h>
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
34 #include "purpleircv3version.h"
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
35
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36 G_BEGIN_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 #define PURPLE_IRCV3_TYPE_CONNECTION (purple_ircv3_connection_get_type())
42474
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
39
a9285192c3d3 IRCv3: fix introspection
Gary Kramlich <grim@reaperworld.com>
parents: 42472
diff changeset
40 PURPLE_IRCV3_AVAILABLE_IN_ALL
42030
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
41 G_DECLARE_DERIVABLE_TYPE(PurpleIRCv3Connection, purple_ircv3_connection,
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
42 PURPLE_IRCV3, CONNECTION, PurpleConnection)
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
43
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
44 #include "purpleircv3capabilities.h"
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
45 #include "purpleircv3message.h"
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
46
42030
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
47 struct _PurpleIRCv3ConnectionClass {
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
48 /*< private >*/
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
49 PurpleConnectionClass parent;
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
50
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
51 /*< private >*/
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
52 gpointer reserved[8];
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
53 };
7af8ab97086d Make PurpleIRCv3Connection Derivable
Gary Kramlich <grim@reaperworld.com>
parents: 42023
diff changeset
54
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
55 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
56 * purple_ircv3_connection_register: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
57 * @plugin: The GTypeModule
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
58 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
59 * Registers the dynamic type using @plugin.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
60 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
61 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
62 */
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 G_GNUC_INTERNAL void purple_ircv3_connection_register(GPluginNativePlugin *plugin);
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
64
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
65 /**
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
66 * purple_ircv3_connection_get_cancellable: (skip)
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
67 * @connection: The instance.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
68 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
69 * This is a private method that is not exposed externally.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
70 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
71 * Gets the cancellable for @connection.
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
72 *
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
73 * Since: 3.0.0
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
74 */
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75 G_GNUC_INTERNAL GCancellable *purple_ircv3_connection_get_cancellable(PurpleIRCv3Connection *connection);
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
76
42000
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
77 /**
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
78 * purple_ircv3_connection_writef:
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
79 * @connection: The instance.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
80 * @format: The format string.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
81 * @...: The arguments for @format.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
82 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
83 * Similar to C `printf()` but writes the format string out to @connection.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
84 *
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
85 * This will add the proper line termination, so you do not need to worry about
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
86 * that.
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
87 */
0b26ebc842db Make purple_ircv3_connection_writef public
Gary Kramlich <grim@reaperworld.com>
parents: 41998
diff changeset
88 void purple_ircv3_connection_writef(PurpleIRCv3Connection *connection, const char *format, ...) G_GNUC_PRINTF(2, 3);
41793
2e6f09066f94 Add connection registration to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 41783
diff changeset
89
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
90 /**
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
91 * purple_ircv3_connection_get_capabilities:
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
92 * @connection: The instance.
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
93 *
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
94 * Gets the list of capabilities that the server supplied during registration.
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
95 *
42229
605f8cba9704 Add gobject-introspection for ircv3
Gary Kramlich <grim@reaperworld.com>
parents: 42220
diff changeset
96 * Returns: (transfer none): The list of capabilities that the server supports.
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
97 */
41951
00c472cd0fff Create PurpleIRCv3Capabilities for managing capabilities for each connection
Gary Kramlich <grim@reaperworld.com>
parents: 41870
diff changeset
98 PurpleIRCv3Capabilities *purple_ircv3_connection_get_capabilities(PurpleIRCv3Connection *connection);
41807
66d473190e94 Start adding capability support to the IRCv3 protocol
Gary Kramlich <grim@reaperworld.com>
parents: 41805
diff changeset
99
42013
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
100 /**
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
101 * purple_ircv3_connection_get_registered:
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
102 * @connection: The instance.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
103 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
104 * Gets whether or not the connection has finished the registration process.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
105 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
106 * Returns: %TRUE if registration has been completed otherwise %FALSE.
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
107 *
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
108 * Since: 3.0.0
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
109 */
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
110 PURPLE_IRCV3_AVAILABLE_IN_ALL
42013
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
111 gboolean purple_ircv3_connection_get_registered(PurpleIRCv3Connection *connection);
5634642aca06 Add a registered property to PurpleIRCv3Connection
Gary Kramlich <grim@reaperworld.com>
parents: 42000
diff changeset
112
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
113 /**
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
114 * purple_ircv3_connection_add_status_message:
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
115 * @connection: The instance.
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
116 * @message: The message.
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
117 *
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
118 * Adds a message to the status conversation/window for @connection.
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
119 *
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
120 * Since: 3.0.0
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
121 */
42472
409148c5c5b7 Add symbol visibility on IRCv3 protocol plugin
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42333
diff changeset
122 PURPLE_IRCV3_AVAILABLE_IN_ALL
42333
a34601ac633c Add PurpleIRCv3Message represent messages rather than multiple variables
Gary Kramlich <grim@reaperworld.com>
parents: 42275
diff changeset
123 void purple_ircv3_connection_add_status_message(PurpleIRCv3Connection *connection, PurpleIRCv3Message *message);
42275
7568bf87e388 Add a basic status window to the IRCv3 protocol plugin
Gary Kramlich <grim@reaperworld.com>
parents: 42229
diff changeset
124
41783
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
125 G_END_DECLS
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
126
5ea6c18ef7a8 Add the ability to connect to IRCv3
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
127 #endif /* PURPLE_IRCV3_CONNECTION_H */

mercurial