1 /* pidgin
2  *
3  * Pidgin 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
5  * source distribution.
6  *
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.
11  *
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.
16  *
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
20  */
21 
22 #ifndef PIDGIN_XMPP_DISCO_H
23 #define PIDGIN_XMPP_DISCO_H
24 
25 typedef struct _XmppDiscoService XmppDiscoService;
26 
27 #include "gtkdisco.h"
28 
29 #define XMPP_PLUGIN_ID      "prpl-jabber"
30 #define NS_DISCO_INFO       "http://jabber.org/protocol/disco#info"
31 #define NS_DISCO_ITEMS      "http://jabber.org/protocol/disco#items"
32 #define NS_MUC              "http://jabber.org/protocol/muc"
33 #define NS_REGISTER         "jabber:iq:register"
34 
35 #include "plugin.h"
36 extern PurplePlugin *my_plugin;
37 
38 /**
39  * The types of services.
40  */
41 typedef enum
42 {
43 	XMPP_DISCO_SERVICE_TYPE_UNSET,
44 	/**
45 	 * A registerable gateway to another protocol. An example would be
46 	 * XMPP legacy transports.
47 	 */
48 	XMPP_DISCO_SERVICE_TYPE_GATEWAY,
49 
50 	/**
51 	 * A directory (e.g. allows the user to search for other users).
52 	 */
53 	XMPP_DISCO_SERVICE_TYPE_DIRECTORY,
54 
55 	/**
56 	 * A chat (multi-user conversation).
57 	 */
58 	XMPP_DISCO_SERVICE_TYPE_CHAT,
59 
60 	/**
61 	 * A pubsub collection (contains nodes)
62 	 */
63 	XMPP_DISCO_SERVICE_TYPE_PUBSUB_COLLECTION,
64 
65 	/**
66 	 * A pubsub leaf (contains stuff, not nodes).
67 	 */
68 	XMPP_DISCO_SERVICE_TYPE_PUBSUB_LEAF,
69 
70 	/**
71 	 * Something else. Do we need more categories?
72 	 */
73 	XMPP_DISCO_SERVICE_TYPE_OTHER
74 } XmppDiscoServiceType;
75 
76 /**
77  * The flags of services.
78  */
79 typedef enum
80 {
81 	XMPP_DISCO_NONE          = 0x0000,
82 	XMPP_DISCO_ADD           = 0x0001, /**< Supports an 'add' operation */
83 	XMPP_DISCO_BROWSE        = 0x0002, /**< Supports browsing */
84 	XMPP_DISCO_REGISTER      = 0x0004  /**< Supports a 'register' operation */
85 } XmppDiscoServiceFlags;
86 
87 struct _XmppDiscoService {
88 	PidginDiscoList *list;
89 	gchar *name;
90 	gchar *description;
91 
92 	gchar *gateway_type;
93 	XmppDiscoServiceType type;
94 	XmppDiscoServiceFlags flags;
95 
96 	XmppDiscoService *parent;
97 	gchar *jid;
98 	gchar *node;
99 	gboolean expanded;
100 };
101 
102 void xmpp_disco_start(PidginDiscoList *list);
103 
104 void xmpp_disco_service_expand(XmppDiscoService *service);
105 void xmpp_disco_service_register(XmppDiscoService *service);
106 
107 #endif /* PIDGIN_XMPP_DISCO_H */
108