1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/*
* plugin-connection.h — Connection API available to telepathy-gabble plugins
* Copyright © 2012 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GABBLE_PLUGIN_CONNECTION_H
#define GABBLE_PLUGIN_CONNECTION_H
#include <glib-object.h>
#include <telepathy-glib/base-connection.h>
#include <telepathy-glib/base-contact-list.h>
#include <gabble/capabilities-set.h>
#include <gabble/types.h>
#include <wocky/wocky-xep-0115-capabilities.h>
G_BEGIN_DECLS
typedef struct _GabblePluginConnection GabblePluginConnection;
typedef struct _GabblePluginConnectionInterface GabblePluginConnectionInterface;
#define GABBLE_TYPE_PLUGIN_CONNECTION (gabble_plugin_connection_get_type ())
#define GABBLE_PLUGIN_CONNECTION(o) \
(G_TYPE_CHECK_INSTANCE_CAST ((o), GABBLE_TYPE_PLUGIN_CONNECTION, \
GabblePluginConnection))
#define GABBLE_IS_PLUGIN_CONNECTION(o) \
(G_TYPE_CHECK_INSTANCE_TYPE ((o), GABBLE_TYPE_PLUGIN_CONNECTION))
#define GABBLE_PLUGIN_CONNECTION_GET_IFACE(o) \
(G_TYPE_INSTANCE_GET_INTERFACE ((o), GABBLE_TYPE_PLUGIN_CONNECTION, \
GabblePluginConnectionInterface))
GType gabble_plugin_connection_get_type (void) G_GNUC_CONST;
typedef gchar * (*GabblePluginConnectionAddSidecarCapsFunc) (
GabblePluginConnection *connection_service,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities);
typedef gchar * (*GabblePluginConnectionAddSidecarCapsFullFunc) (
GabblePluginConnection *plugin_connection,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities,
GPtrArray *data_forms);
typedef WockySession * (*GabblePluginConnectionGetSessionFunc) (
GabblePluginConnection *plugin_connection);
typedef gchar *(*GabblePluginConnectionGetFullJidFunc) (
GabblePluginConnection *plugin_connection);
typedef const gchar * (*GabblePluginConnectionGetJidForCapsFunc) (
GabblePluginConnection *plugin_connection,
WockyXep0115Capabilities *caps);
typedef const gchar* (*GabblePluginConnectionPickBestResourceForCaps) (
GabblePluginConnection *plugin_connection,
const gchar *jid,
GabbleCapabilitySetPredicate predicate,
gconstpointer user_data);
typedef TpBaseContactList * (*GabblePluginConnectionGetContactList) (
GabblePluginConnection *plugin_connection);
typedef WockyXep0115Capabilities * (*GabblePluginConnectionGetCaps) (
GabblePluginConnection *plugin_connection,
TpHandle handle);
struct _GabblePluginConnectionInterface
{
GTypeInterface parent;
GabblePluginConnectionAddSidecarCapsFunc add_sidecar_own_caps;
GabblePluginConnectionAddSidecarCapsFullFunc add_sidecar_own_caps_full;
GabblePluginConnectionGetSessionFunc get_session;
GabblePluginConnectionGetFullJidFunc get_full_jid;
GabblePluginConnectionGetJidForCapsFunc get_jid_for_caps;
GabblePluginConnectionPickBestResourceForCaps pick_best_resource_for_caps;
GabblePluginConnectionGetContactList get_contact_list;
GabblePluginConnectionGetCaps get_caps;
};
gchar *gabble_plugin_connection_add_sidecar_own_caps (
GabblePluginConnection *plugin_service,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities);
gchar *gabble_plugin_connection_add_sidecar_own_caps_full (
GabblePluginConnection *plugin_connection,
const GabbleCapabilitySet *cap_set,
const GPtrArray *identities,
GPtrArray *data_forms) G_GNUC_WARN_UNUSED_RESULT;
WockySession *gabble_plugin_connection_get_session (
GabblePluginConnection *plugin_connection);
gchar *gabble_plugin_connection_get_full_jid (GabblePluginConnection *conn);
const gchar *gabble_plugin_connection_get_jid_for_caps (
GabblePluginConnection *plugin_connection,
WockyXep0115Capabilities *caps);
const gchar *gabble_plugin_connection_pick_best_resource_for_caps (
GabblePluginConnection *plugin_connection,
const gchar *jid,
GabbleCapabilitySetPredicate predicate,
gconstpointer user_data);
TpBaseContactList *gabble_plugin_connection_get_contact_list (
GabblePluginConnection *plugin_connection);
WockyXep0115Capabilities *gabble_plugin_connection_get_caps (
GabblePluginConnection *plugin_connection,
TpHandle handle);
G_END_DECLS
#endif
|