summaryrefslogtreecommitdiff
path: root/telepathy-glib/connection-contact-list.h
blob: d04ba45bf40bb859d3366b286d8efac35e1d587c (plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 * connection-contact-list.h - ContactList and ContactGroup support
 *
 * Copyright © 2011 Collabora Ltd. <http://www.collabora.co.uk/>
 *
 * 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 __TP_CONNECTION_CONTACT_LIST_H__
#define __TP_CONNECTION_CONTACT_LIST_H__

#include <telepathy-glib/enums.h>
#include <telepathy-glib/connection.h>
#include <telepathy-glib/contact.h>

G_BEGIN_DECLS

#define TP_CONNECTION_FEATURE_CONTACT_LIST \
  (tp_connection_get_feature_quark_contact_list ())
GQuark tp_connection_get_feature_quark_contact_list (void) G_GNUC_CONST;

TpContactListState tp_connection_get_contact_list_state (TpConnection *self);
gboolean tp_connection_get_contact_list_persists (TpConnection *self);
gboolean tp_connection_get_can_change_contact_list (TpConnection *self);
gboolean tp_connection_get_request_uses_message (TpConnection *self);
GPtrArray *tp_connection_dup_contact_list (TpConnection *self);

void tp_connection_request_subscription_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    const gchar *message,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_request_subscription_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_authorize_publication_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_authorize_publication_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_remove_contacts_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_remove_contacts_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_unsubscribe_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_unsubscribe_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_unpublish_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_unpublish_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

#define TP_CONNECTION_FEATURE_CONTACT_GROUPS \
  (tp_connection_get_feature_quark_contact_groups ())
GQuark tp_connection_get_feature_quark_contact_groups (void) G_GNUC_CONST;

gboolean tp_connection_get_disjoint_groups (TpConnection *self);
TpContactMetadataStorageType tp_connection_get_group_storage (TpConnection *self);
const gchar * const *tp_connection_get_contact_groups (TpConnection *self);

void tp_connection_set_group_members_async (TpConnection *self,
    const gchar *group,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_set_group_members_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_add_to_group_async (TpConnection *self,
    const gchar *group,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_add_to_group_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_remove_from_group_async (TpConnection *self,
    const gchar *group,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_remove_from_group_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_remove_group_async (TpConnection *self,
    const gchar *group,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_remove_group_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_rename_group_async (TpConnection *self,
    const gchar *old_name,
    const gchar *new_name,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_rename_group_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

/* ContactBlocking */

void tp_connection_block_contacts_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    gboolean report_abusive,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_block_contacts_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

void tp_connection_unblock_contacts_async (TpConnection *self,
    guint n_contacts,
    TpContact * const *contacts,
    GAsyncReadyCallback callback,
    gpointer user_data);
gboolean tp_connection_unblock_contacts_finish (TpConnection *self,
    GAsyncResult *result,
    GError **error);

#define TP_CONNECTION_FEATURE_CONTACT_BLOCKING \
  (tp_connection_get_feature_quark_contact_blocking ())
GQuark tp_connection_get_feature_quark_contact_blocking (void) G_GNUC_CONST;

gboolean tp_connection_can_report_abusive (TpConnection *self);

GPtrArray * tp_connection_get_blocked_contacts (TpConnection *self);

G_END_DECLS

#endif