pidgin/plugins/disco/xmppdiscoservice.h

Mon, 30 Jun 2025 23:04:59 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 30 Jun 2025 23:04:59 -0500
changeset 43273
b2e7a32950ae
parent 42090
a109a8cc8059
child 43286
1861a365a664
permissions
-rw-r--r--

Update metainfo.xml for the release

And prepare for the next release right away.

Testing Done:
Ran `meson dist`

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

42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
1 /* pidgin
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
2 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
5 * source distribution.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
6 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
10 * (at your option) any later version.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
11 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
15 * GNU General Public License for more details.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
16 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
18 * along with this program; if not, see <https://www.gnu.org/licenses/>.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
19 */
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
20
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
21 #ifndef PIDGIN_XMPP_DISCO_SERVICE_H
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
22 #define PIDGIN_XMPP_DISCO_SERVICE_H
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
23
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
24 #include <glib-object.h>
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
25
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
26 #include <purple.h>
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
27
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
28 #define XMPP_DISCO_TYPE_SERVICE (xmpp_disco_service_get_type())
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
29 G_DECLARE_FINAL_TYPE(XmppDiscoService, xmpp_disco_service, XMPP_DISCO, SERVICE,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
30 GObject)
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
31
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
32 #include "gtkdisco.h"
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
33
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
34 /**
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
35 * XmppDiscoServiceType:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
36 * @XMPP_DISCO_SERVICE_TYPE_UNSET: An unset service type.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
37 * @XMPP_DISCO_SERVICE_TYPE_GATEWAY: A registerable gateway to another
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
38 * protocol. An example would be XMPP legacy
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
39 * transports.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
40 * @XMPP_DISCO_SERVICE_TYPE_DIRECTORY: A directory (e.g. allows the user to
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
41 * search for other users).
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
42 * @XMPP_DISCO_SERVICE_TYPE_CHAT: A chat (multi-user conversation).
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
43 * @XMPP_DISCO_SERVICE_TYPE_PUBSUB_COLLECTION: A pubsub collection (contains
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
44 * nodes).
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
45 * @XMPP_DISCO_SERVICE_TYPE_PUBSUB_LEAF: A pubsub leaf (contains stuff, not
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
46 * nodes).
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
47 * @XMPP_DISCO_SERVICE_TYPE_OTHER: Something else. Do we need more categories?
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
48 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
49 * The types of services.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
50 */
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
51 typedef enum {
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
52 XMPP_DISCO_SERVICE_TYPE_UNSET,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
53 XMPP_DISCO_SERVICE_TYPE_GATEWAY,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
54 XMPP_DISCO_SERVICE_TYPE_DIRECTORY,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
55 XMPP_DISCO_SERVICE_TYPE_CHAT,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
56 XMPP_DISCO_SERVICE_TYPE_PUBSUB_COLLECTION,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
57 XMPP_DISCO_SERVICE_TYPE_PUBSUB_LEAF,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
58 XMPP_DISCO_SERVICE_TYPE_OTHER
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
59 } XmppDiscoServiceType;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
60
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
61 /**
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
62 * XmppDiscoServiceFlags:
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
63 * @XMPP_DISCO_NONE: No flags.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
64 * @XMPP_DISCO_ADD: Supports an 'add' operation.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
65 * @XMPP_DISCO_BROWSE: Supports browsing.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
66 * @XMPP_DISCO_REGISTER: Supports a 'register' operation.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
67 *
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
68 * The flags of services.
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
69 */
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
70 typedef enum { /*< flags >*/
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
71 XMPP_DISCO_NONE = 0x0000,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
72 XMPP_DISCO_ADD = 0x0001,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
73 XMPP_DISCO_BROWSE = 0x0002,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
74 XMPP_DISCO_REGISTER = 0x0004,
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
75 } XmppDiscoServiceFlags;
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
76
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
77 void xmpp_disco_service_register(PurplePlugin *plugin);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
78
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
79 XmppDiscoService *xmpp_disco_service_new(PidginDiscoList *list);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
80
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
81 PidginDiscoList *xmpp_disco_service_get_list(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
82
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
83 const char *xmpp_disco_service_get_name(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
84 void xmpp_disco_service_set_name(XmppDiscoService *service, const char *name);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
85
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
86 const char *xmpp_disco_service_get_description(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
87 void xmpp_disco_service_set_description(XmppDiscoService *service, const char *description);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
88
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
89 XmppDiscoServiceType xmpp_disco_service_get_service_type(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
90 void xmpp_disco_service_set_service_type(XmppDiscoService *service, XmppDiscoServiceType type);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
91
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
92 const char *xmpp_disco_service_get_gateway_type(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
93 void xmpp_disco_service_set_gateway_type(XmppDiscoService *service, const char *gateway_type);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
94
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
95 XmppDiscoServiceFlags xmpp_disco_service_get_flags(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
96 void xmpp_disco_service_set_flags(XmppDiscoService *service, XmppDiscoServiceFlags flags);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
97 void xmpp_disco_service_add_flags(XmppDiscoService *service, XmppDiscoServiceFlags flags);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
98 void xmpp_disco_service_remove_flags(XmppDiscoService *service, XmppDiscoServiceFlags flags);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
99
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
100 const char *xmpp_disco_service_get_jid(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
101 void xmpp_disco_service_set_jid(XmppDiscoService *service, const char *jid);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
102
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
103 const char *xmpp_disco_service_get_node(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
104 void xmpp_disco_service_set_node(XmppDiscoService *service, const char *node);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
105
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
106 gboolean xmpp_disco_service_get_expanded(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
107 void xmpp_disco_service_set_expanded(XmppDiscoService *service, gboolean expanded);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
108
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
109 char *xmpp_disco_service_get_icon_name(XmppDiscoService *service);
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
110
42090
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
111 GListModel *xmpp_disco_service_get_child_model(XmppDiscoService *service);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
112 void xmpp_disco_service_add_child(XmppDiscoService *service, XmppDiscoService *child);
a109a8cc8059 Convert XMPP Service Discovery to GtkColumnView
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42037
diff changeset
113
42037
af20db93f2c2 Convert XmppDiscoService into a GObject
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
diff changeset
114 #endif /* PIDGIN_XMPP_DISCO_SERVICE_H */

mercurial