/usr/include/telepathy-1.0/telepathy-glib/base-contact-list.h is in libtelepathy-glib-dev 0.18.0-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 | /* ContactList channel manager
*
* Copyright © 2010 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 __TP_BASE_CONTACT_LIST_H__
#define __TP_BASE_CONTACT_LIST_H__
#include <glib-object.h>
#include <gio/gio.h>
#include <telepathy-glib/base-connection.h>
#include <telepathy-glib/handle-repo.h>
#include <telepathy-glib/svc-connection.h>
G_BEGIN_DECLS
typedef struct _TpBaseContactList TpBaseContactList;
typedef struct _TpBaseContactListClass TpBaseContactListClass;
typedef struct _TpBaseContactListPrivate TpBaseContactListPrivate;
typedef struct _TpBaseContactListClassPrivate TpBaseContactListClassPrivate;
struct _TpBaseContactList {
/*<private>*/
GObject parent;
TpBaseContactListPrivate *priv;
};
GType tp_base_contact_list_get_type (void);
#define TP_TYPE_BASE_CONTACT_LIST \
(tp_base_contact_list_get_type ())
#define TP_BASE_CONTACT_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), TP_TYPE_BASE_CONTACT_LIST, \
TpBaseContactList))
#define TP_BASE_CONTACT_LIST_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), TP_TYPE_BASE_CONTACT_LIST, \
TpBaseContactListClass))
#define TP_IS_BASE_CONTACT_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), TP_TYPE_BASE_CONTACT_LIST))
#define TP_IS_BASE_CONTACT_LIST_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), TP_TYPE_BASE_CONTACT_LIST))
#define TP_BASE_CONTACT_LIST_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), TP_TYPE_BASE_CONTACT_LIST, \
TpBaseContactListClass))
/* ---- Utility stuff which subclasses can use ---- */
TpContactListState tp_base_contact_list_get_state (TpBaseContactList *self,
GError **error);
TpBaseConnection *tp_base_contact_list_get_connection (
TpBaseContactList *self, GError **error);
gboolean tp_base_contact_list_get_download_at_connection (
TpBaseContactList *self);
/* ---- Called by subclasses for ContactList (or both) ---- */
void tp_base_contact_list_set_list_pending (TpBaseContactList *self);
void tp_base_contact_list_set_list_failed (TpBaseContactList *self,
GQuark domain,
gint code,
const gchar *message);
void tp_base_contact_list_set_list_received (TpBaseContactList *self);
void tp_base_contact_list_contacts_changed (TpBaseContactList *self,
TpHandleSet *changed,
TpHandleSet *removed);
void tp_base_contact_list_one_contact_changed (TpBaseContactList *self,
TpHandle changed);
void tp_base_contact_list_one_contact_removed (TpBaseContactList *self,
TpHandle removed);
/* ---- Implemented by subclasses for ContactList (mandatory read-only
* things) ---- */
typedef gboolean (*TpBaseContactListBooleanFunc) (
TpBaseContactList *self);
gboolean tp_base_contact_list_true_func (TpBaseContactList *self);
gboolean tp_base_contact_list_false_func (TpBaseContactList *self);
gboolean tp_base_contact_list_get_contact_list_persists (
TpBaseContactList *self);
typedef TpHandleSet *(*TpBaseContactListDupContactsFunc) (
TpBaseContactList *self);
TpHandleSet *tp_base_contact_list_dup_contacts (TpBaseContactList *self);
typedef void (*TpBaseContactListDupStatesFunc) (
TpBaseContactList *self,
TpHandle contact,
TpSubscriptionState *subscribe,
TpSubscriptionState *publish,
gchar **publish_request);
void tp_base_contact_list_dup_states (TpBaseContactList *self,
TpHandle contact,
TpSubscriptionState *subscribe,
TpSubscriptionState *publish,
gchar **publish_request);
typedef void (*TpBaseContactListAsyncFunc) (
TpBaseContactList *self,
GAsyncReadyCallback callback,
gpointer user_data);
void tp_base_contact_list_download_async (TpBaseContactList *self,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_download_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
typedef gboolean (*TpBaseContactListAsyncFinishFunc) (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
struct _TpBaseContactListClass {
GObjectClass parent_class;
TpBaseContactListDupContactsFunc dup_contacts;
TpBaseContactListDupStatesFunc dup_states;
TpBaseContactListBooleanFunc get_contact_list_persists;
TpBaseContactListAsyncFunc download_async;
TpBaseContactListAsyncFinishFunc download_finish;
/*<private>*/
GCallback _padding[5];
TpBaseContactListClassPrivate *priv;
};
/* ---- Implemented by subclasses for ContactList modification ---- */
#define TP_TYPE_MUTABLE_CONTACT_LIST \
(tp_mutable_contact_list_get_type ())
#define TP_IS_MUTABLE_CONTACT_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
TP_TYPE_MUTABLE_CONTACT_LIST))
#define TP_MUTABLE_CONTACT_LIST_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
TP_TYPE_MUTABLE_CONTACT_LIST, TpMutableContactListInterface))
typedef struct _TpMutableContactListInterface TpMutableContactListInterface;
typedef void (*TpBaseContactListRequestSubscriptionFunc) (
TpBaseContactList *self,
TpHandleSet *contacts,
const gchar *message,
GAsyncReadyCallback callback,
gpointer user_data);
typedef void (*TpBaseContactListActOnContactsFunc) (
TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
struct _TpMutableContactListInterface {
GTypeInterface parent;
/* _async mandatory-to-implement, _finish has a default implementation
* suitable for a GSimpleAsyncResult */
TpBaseContactListRequestSubscriptionFunc request_subscription_async;
TpBaseContactListAsyncFinishFunc request_subscription_finish;
TpBaseContactListActOnContactsFunc authorize_publication_async;
TpBaseContactListAsyncFinishFunc authorize_publication_finish;
TpBaseContactListActOnContactsFunc remove_contacts_async;
TpBaseContactListAsyncFinishFunc remove_contacts_finish;
TpBaseContactListActOnContactsFunc unsubscribe_async;
TpBaseContactListAsyncFinishFunc unsubscribe_finish;
TpBaseContactListActOnContactsFunc unpublish_async;
TpBaseContactListAsyncFinishFunc unpublish_finish;
/* optional-to-implement */
TpBaseContactListActOnContactsFunc store_contacts_async;
TpBaseContactListAsyncFinishFunc store_contacts_finish;
TpBaseContactListBooleanFunc can_change_contact_list;
TpBaseContactListBooleanFunc get_request_uses_message;
};
GType tp_mutable_contact_list_get_type (void) G_GNUC_CONST;
gboolean tp_base_contact_list_can_change_contact_list (
TpBaseContactList *self);
gboolean tp_base_contact_list_get_request_uses_message (
TpBaseContactList *self);
void tp_base_contact_list_request_subscription_async (TpBaseContactList *self,
TpHandleSet *contacts,
const gchar *message,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_request_subscription_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_authorize_publication_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_authorize_publication_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_store_contacts_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_store_contacts_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_remove_contacts_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_remove_contacts_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_unsubscribe_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_unsubscribe_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_unpublish_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_unpublish_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
/* ---- contact blocking ---- */
#define TP_TYPE_BLOCKABLE_CONTACT_LIST \
(tp_blockable_contact_list_get_type ())
GType tp_blockable_contact_list_get_type (void) G_GNUC_CONST;
#define TP_IS_BLOCKABLE_CONTACT_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
TP_TYPE_BLOCKABLE_CONTACT_LIST))
#define TP_BLOCKABLE_CONTACT_LIST_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
TP_TYPE_BLOCKABLE_CONTACT_LIST, TpBlockableContactListInterface))
typedef struct _TpBlockableContactListInterface
TpBlockableContactListInterface;
void tp_base_contact_list_contact_blocking_changed (
TpBaseContactList *self,
TpHandleSet *changed);
gboolean tp_base_contact_list_can_block (TpBaseContactList *self);
TpHandleSet *tp_base_contact_list_dup_blocked_contacts (
TpBaseContactList *self);
void tp_base_contact_list_block_contacts_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_block_contacts_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_block_contacts_with_abuse_async (
TpBaseContactList *self,
TpHandleSet *contacts,
gboolean report_abusive,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_block_contacts_with_abuse_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_unblock_contacts_async (TpBaseContactList *self,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_unblock_contacts_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
typedef void (*TpBaseContactListBlockContactsWithAbuseFunc) (
TpBaseContactList *self,
TpHandleSet *contacts,
gboolean report_abusive,
GAsyncReadyCallback callback,
gpointer user_data);
struct _TpBlockableContactListInterface {
GTypeInterface parent;
/* mandatory to implement */
TpBaseContactListDupContactsFunc dup_blocked_contacts;
/* unblock_contacts_async is mandatory to implement; either
* block_contacts_async or block_contacts_with_abuse_async (but not both!)
* must also be implemented. _finish have default implementations
* suitable for a GSimpleAsyncResult */
TpBaseContactListActOnContactsFunc block_contacts_async;
TpBaseContactListAsyncFinishFunc block_contacts_finish;
TpBaseContactListActOnContactsFunc unblock_contacts_async;
TpBaseContactListAsyncFinishFunc unblock_contacts_finish;
/* optional to implement */
TpBaseContactListBooleanFunc can_block;
/* see above. block_contacts_finish is the corresponding _finish function.
*/
TpBaseContactListBlockContactsWithAbuseFunc block_contacts_with_abuse_async;
};
/* ---- Called by subclasses for ContactGroups ---- */
void tp_base_contact_list_groups_created (TpBaseContactList *self,
const gchar * const *created, gssize n_created);
void tp_base_contact_list_groups_removed (TpBaseContactList *self,
const gchar * const *removed, gssize n_removed);
void tp_base_contact_list_group_renamed (TpBaseContactList *self,
const gchar *old_name,
const gchar *new_name);
void tp_base_contact_list_groups_changed (TpBaseContactList *self,
TpHandleSet *contacts,
const gchar * const *added, gssize n_added,
const gchar * const *removed, gssize n_removed);
void tp_base_contact_list_one_contact_groups_changed (TpBaseContactList *self,
TpHandle contact,
const gchar * const *added, gssize n_added,
const gchar * const *removed, gssize n_removed);
/* ---- Implemented by subclasses for ContactGroups ---- */
gboolean tp_base_contact_list_has_disjoint_groups (TpBaseContactList *self);
typedef GStrv (*TpBaseContactListDupGroupsFunc) (
TpBaseContactList *self);
GStrv tp_base_contact_list_dup_groups (TpBaseContactList *self);
typedef GStrv (*TpBaseContactListDupContactGroupsFunc) (
TpBaseContactList *self,
TpHandle contact);
GStrv tp_base_contact_list_dup_contact_groups (TpBaseContactList *self,
TpHandle contact);
typedef TpHandleSet *(*TpBaseContactListDupGroupMembersFunc) (
TpBaseContactList *self,
const gchar *group);
TpHandleSet *tp_base_contact_list_dup_group_members (TpBaseContactList *self,
const gchar *group);
typedef gchar *(*TpBaseContactListNormalizeFunc) (
TpBaseContactList *self,
const gchar *s);
gchar *tp_base_contact_list_normalize_group (
TpBaseContactList *self,
const gchar *s);
#define TP_TYPE_CONTACT_GROUP_LIST \
(tp_contact_group_list_get_type ())
GType tp_contact_group_list_get_type (void) G_GNUC_CONST;
#define TP_IS_CONTACT_GROUP_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
TP_TYPE_CONTACT_GROUP_LIST))
#define TP_CONTACT_GROUP_LIST_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
TP_TYPE_CONTACT_GROUP_LIST, TpContactGroupListInterface))
typedef struct _TpContactGroupListInterface
TpContactGroupListInterface;
struct _TpContactGroupListInterface {
GTypeInterface parent;
/* mandatory to implement */
TpBaseContactListDupGroupsFunc dup_groups;
TpBaseContactListDupGroupMembersFunc dup_group_members;
TpBaseContactListDupContactGroupsFunc dup_contact_groups;
/* optional to implement */
TpBaseContactListBooleanFunc has_disjoint_groups;
TpBaseContactListNormalizeFunc normalize_group;
};
/* ---- Implemented by subclasses for mutable ContactGroups ---- */
typedef guint (*TpBaseContactListUIntFunc) (
TpBaseContactList *self);
TpContactMetadataStorageType tp_base_contact_list_get_group_storage (
TpBaseContactList *self);
typedef void (*TpBaseContactListSetContactGroupsFunc) (TpBaseContactList *self,
TpHandle contact,
const gchar * const *normalized_names,
gsize n_names,
GAsyncReadyCallback callback,
gpointer user_data);
void tp_base_contact_list_set_contact_groups_async (TpBaseContactList *self,
TpHandle contact,
const gchar * const *normalized_names,
gsize n_names,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_set_contact_groups_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
typedef void (*TpBaseContactListGroupContactsFunc) (TpBaseContactList *self,
const gchar *group,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
void tp_base_contact_list_add_to_group_async (TpBaseContactList *self,
const gchar *group,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_add_to_group_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_remove_from_group_async (TpBaseContactList *self,
const gchar *group,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_remove_from_group_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
void tp_base_contact_list_set_group_members_async (TpBaseContactList *self,
const gchar *normalized_group,
TpHandleSet *contacts,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_set_group_members_finish (
TpBaseContactList *self,
GAsyncResult *result,
GError **error);
typedef void (*TpBaseContactListRemoveGroupFunc) (TpBaseContactList *self,
const gchar *group,
GAsyncReadyCallback callback,
gpointer user_data);
void tp_base_contact_list_remove_group_async (TpBaseContactList *self,
const gchar *group,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_remove_group_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
typedef void (*TpBaseContactListRenameGroupFunc) (TpBaseContactList *self,
const gchar *old_name,
const gchar *new_name,
GAsyncReadyCallback callback,
gpointer user_data);
void tp_base_contact_list_rename_group_async (TpBaseContactList *self,
const gchar *old_name,
const gchar *new_name,
GAsyncReadyCallback callback,
gpointer user_data);
gboolean tp_base_contact_list_rename_group_finish (TpBaseContactList *self,
GAsyncResult *result,
GError **error);
#define TP_TYPE_MUTABLE_CONTACT_GROUP_LIST \
(tp_mutable_contact_group_list_get_type ())
GType tp_mutable_contact_group_list_get_type (void) G_GNUC_CONST;
#define TP_IS_MUTABLE_CONTACT_GROUP_LIST(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST))
#define TP_MUTABLE_CONTACT_GROUP_LIST_GET_INTERFACE(obj) \
(G_TYPE_INSTANCE_GET_INTERFACE ((obj), \
TP_TYPE_MUTABLE_CONTACT_GROUP_LIST, TpMutableContactGroupListInterface))
typedef struct _TpMutableContactGroupListInterface
TpMutableContactGroupListInterface;
struct _TpMutableContactGroupListInterface {
GTypeInterface parent;
/* _async mandatory-to-implement, _finish has a default implementation
* suitable for a GSimpleAsyncResult */
TpBaseContactListSetContactGroupsFunc set_contact_groups_async;
TpBaseContactListAsyncFinishFunc set_contact_groups_finish;
TpBaseContactListGroupContactsFunc set_group_members_async;
TpBaseContactListAsyncFinishFunc set_group_members_finish;
TpBaseContactListGroupContactsFunc add_to_group_async;
TpBaseContactListAsyncFinishFunc add_to_group_finish;
TpBaseContactListGroupContactsFunc remove_from_group_async;
TpBaseContactListAsyncFinishFunc remove_from_group_finish;
TpBaseContactListRemoveGroupFunc remove_group_async;
TpBaseContactListAsyncFinishFunc remove_group_finish;
/* optional to implement */
TpBaseContactListRenameGroupFunc rename_group_async;
TpBaseContactListAsyncFinishFunc rename_group_finish;
TpBaseContactListUIntFunc get_group_storage;
};
/* ---- Mixin-like functionality for our parent TpBaseConnection ---- */
void tp_base_contact_list_mixin_class_init (TpBaseConnectionClass *cls);
void tp_base_contact_list_mixin_register_with_contacts_mixin (
TpBaseConnection *conn);
void tp_base_contact_list_mixin_list_iface_init (
TpSvcConnectionInterfaceContactListClass *klass);
void tp_base_contact_list_mixin_groups_iface_init (
TpSvcConnectionInterfaceContactGroupsClass *klass);
void tp_base_contact_list_mixin_blocking_iface_init (
TpSvcConnectionInterfaceContactBlockingClass *klass);
G_END_DECLS
#endif
|