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
|
/*
* contacts-conn.h - header for a connection with contact info
*
* Copyright (C) 2007-2008 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright (C) 2007-2008 Nokia Corporation
*
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved.
*/
#ifndef TESTS_LIB_CONTACTS_CONN_H
#define TESTS_LIB_CONTACTS_CONN_H
#include <glib-object.h>
#include <telepathy-glib/base-connection.h>
#include <telepathy-glib/contacts-mixin.h>
#include <telepathy-glib/presence-mixin.h>
#include "simple-conn.h"
G_BEGIN_DECLS
typedef struct _ContactsConnection ContactsConnection;
typedef struct _ContactsConnectionClass ContactsConnectionClass;
typedef struct _ContactsConnectionPrivate ContactsConnectionPrivate;
struct _ContactsConnectionClass {
SimpleConnectionClass parent_class;
TpPresenceMixinClass presence_mixin;
TpContactsMixinClass contacts_mixin;
};
struct _ContactsConnection {
SimpleConnection parent;
TpPresenceMixin presence_mixin;
TpContactsMixin contacts_mixin;
ContactsConnectionPrivate *priv;
};
GType contacts_connection_get_type (void);
/* Must match my_statuses in the .c */
typedef enum {
CONTACTS_CONNECTION_STATUS_AVAILABLE,
CONTACTS_CONNECTION_STATUS_BUSY,
CONTACTS_CONNECTION_STATUS_AWAY,
CONTACTS_CONNECTION_STATUS_OFFLINE,
CONTACTS_CONNECTION_STATUS_UNKNOWN,
CONTACTS_CONNECTION_STATUS_ERROR
} ContactsConnectionPresenceStatusIndex;
/* TYPE MACROS */
#define CONTACTS_TYPE_CONNECTION \
(contacts_connection_get_type ())
#define CONTACTS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), CONTACTS_TYPE_CONNECTION, \
ContactsConnection))
#define CONTACTS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), CONTACTS_TYPE_CONNECTION, \
ContactsConnectionClass))
#define CONTACTS_IS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), CONTACTS_TYPE_CONNECTION))
#define CONTACTS_IS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), CONTACTS_TYPE_CONNECTION))
#define CONTACTS_CONNECTION_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONNECTION, \
ContactsConnectionClass))
void contacts_connection_change_aliases (ContactsConnection *self, guint n,
const TpHandle *handles, const gchar * const *aliases);
void contacts_connection_change_presences (ContactsConnection *self, guint n,
const TpHandle *handles,
const ContactsConnectionPresenceStatusIndex *indexes,
const gchar * const *messages);
void contacts_connection_change_avatar_tokens (ContactsConnection *self,
guint n, const TpHandle *handles, const gchar * const *tokens);
void contacts_connection_change_locations (ContactsConnection *self,
guint n,
const TpHandle *handles,
GHashTable **locations);
void contacts_connection_change_capabilities (ContactsConnection *self,
GHashTable *capabilities);
/* Legacy version (no Contacts interface) */
typedef struct _LegacyContactsConnection LegacyContactsConnection;
typedef struct _LegacyContactsConnectionClass LegacyContactsConnectionClass;
typedef struct _LegacyContactsConnectionPrivate
LegacyContactsConnectionPrivate;
struct _LegacyContactsConnectionClass {
ContactsConnectionClass parent_class;
};
struct _LegacyContactsConnection {
ContactsConnection parent;
LegacyContactsConnectionPrivate *priv;
};
GType legacy_contacts_connection_get_type (void);
/* TYPE MACROS */
#define LEGACY_CONTACTS_TYPE_CONNECTION \
(legacy_contacts_connection_get_type ())
#define LEGACY_CONTACTS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), LEGACY_CONTACTS_TYPE_CONNECTION, \
LegacyContactsConnection))
#define LEGACY_CONTACTS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), LEGACY_CONTACTS_TYPE_CONNECTION, \
LegacyContactsConnectionClass))
#define LEGACY_CONTACTS_IS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), LEGACY_CONTACTS_TYPE_CONNECTION))
#define LEGACY_CONTACTS_IS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), LEGACY_CONTACTS_TYPE_CONNECTION))
#define LEGACY_CONTACTS_CONNECTION_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), LEGACY_CONTACTS_TYPE_CONNECTION, \
LegacyContactsConnectionClass))
/* No Requests version */
typedef struct _NoRequestsConnection NoRequestsConnection;
typedef struct _NoRequestsConnectionClass NoRequestsConnectionClass;
typedef struct _NoRequestsConnectionPrivate
NoRequestsConnectionPrivate;
struct _NoRequestsConnectionClass {
ContactsConnectionClass parent_class;
};
struct _NoRequestsConnection {
ContactsConnection parent;
NoRequestsConnectionPrivate *priv;
};
GType no_requests_connection_get_type (void);
/* TYPE MACROS */
#define NO_REQUESTS_TYPE_CONNECTION \
(no_requests_connection_get_type ())
#define NO_REQUESTS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj), NO_REQUESTS_TYPE_CONNECTION, \
NoRequestsConnection))
#define NO_REQUESTS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST((klass), NO_REQUESTS_TYPE_CONNECTION, \
NoRequestsConnectionClass))
#define NO_REQUESTS_IS_CONNECTION(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), NO_REQUESTS_TYPE_CONNECTION))
#define NO_REQUESTS_IS_CONNECTION_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass), NO_REQUESTS_TYPE_CONNECTION))
#define NO_REQUESTS_CONNECTION_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NO_REQUESTS_TYPE_CONNECTION, \
NoRequestsConnectionClass))
G_END_DECLS
#endif
|